Skip to content

Commit 5b46b00

Browse files
committed
place in a table for better readability
1 parent 14f38d2 commit 5b46b00

1 file changed

Lines changed: 40 additions & 8 deletions

File tree

public_html/lists/admin/spageedit.php

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@
370370
}
371371

372372
$listsHTML = '<h3><a name="lists">'.s('Select the lists to offer').'</a></h3>';
373-
$listsHTML .= '<div>';
373+
$listsHTML .= '<div class="spageedit-lists">';
374374
$listsHTML .= sprintf('<label for="listcategories">%s</label><br/>',
375375
s('Display list categories'));
376376
$listsHTML .= sprintf('<input type="radio" name="showcategories" value="no" %s />%s<br/>',
@@ -398,23 +398,38 @@
398398
if (!in_array($preselectList, $selected_lists)) {
399399
$preselectList = 0;
400400
}
401-
$listsHTML .= sprintf('<p><label><input type="radio" name="preselectlist" value="0" %s /> %s</label></p>',
402-
empty($preselectList) ? 'checked="checked"' : '',
403-
s('Do not preselect any list'));
401+
$listsHTML .= '<table class="spageedit-lists-table">';
402+
$listsHTML .= sprintf(
403+
'<thead><tr><th>%s</th><th>%s</th><th>%s</th></tr></thead>',
404+
s('Select'),
405+
s('Default'),
406+
s('Description')
407+
);
408+
$listsHTML .= '<tbody>';
404409
while ($row = Sql_Fetch_Array($req)) {
405410
$listSelected = in_array($row['id'], $selected_lists);
411+
$listName = htmlspecialchars(stripslashes($row['name'] ?? ''), ENT_QUOTES);
412+
$listDescription = htmlspecialchars(stripslashes($row['description'] ?? ''), ENT_QUOTES);
413+
if ($listDescription === '') {
414+
$listDescription = '&nbsp;';
415+
}
406416
$listsHTML .= sprintf(
407-
'<label><input type="checkbox" name="list[%d]" value="%d" %s /> %s</label> <label><input type="radio" name="preselectlist" value="%d" %s /> %s</label><div>%s</div>',
417+
'<tr><td><label><input type="checkbox" name="list[%d]" value="%d" %s /> %s</label></td><td><input type="radio" name="preselectlist" value="%d" %s /></td><td>%s</td></tr>',
408418
$row['id'],
409419
$row['id'],
410420
$listSelected ? 'checked="checked"' : '',
411-
stripslashes($row['name'] ?? ''),
421+
$listName,
412422
$row['id'],
413423
$preselectList == $row['id'] ? 'checked="checked"' : '',
414-
s('Preselect'),
415-
htmlspecialchars(stripslashes($row['description'] ?? ''))
424+
$listDescription
416425
);
417426
}
427+
$listsHTML .= sprintf(
428+
'<tr><td></td><td><label><input type="radio" name="preselectlist" value="0" %s /> %s</label></td><td></td></tr>',
429+
empty($preselectList) ? 'checked="checked"' : '',
430+
s('none')
431+
);
432+
$listsHTML .= '</tbody></table>';
418433

419434
$listsHTML .= '</div>';
420435

@@ -429,6 +444,23 @@
429444

430445
echo '</div>'; // accordion
431446

447+
echo '
448+
<style>
449+
.spageedit-lists-table th,
450+
.spageedit-lists-table td {
451+
border-bottom: 1px solid #ddd;
452+
padding: 10px 8px;
453+
vertical-align: top;
454+
}
455+
.spageedit-lists-table th {
456+
font-weight: bold;
457+
}
458+
.spageedit-lists-table td label {
459+
margin: 0;
460+
font-weight: normal;
461+
}
462+
</style>';
463+
432464
$ownerHTML = $singleOwner = '';
433465
$adminCount = 0;
434466
if (isSuperUser() || accessLevel('spageedit') == 'all') {

0 commit comments

Comments
 (0)