|
370 | 370 | } |
371 | 371 |
|
372 | 372 | $listsHTML = '<h3><a name="lists">'.s('Select the lists to offer').'</a></h3>'; |
373 | | -$listsHTML .= '<div>'; |
| 373 | +$listsHTML .= '<div class="spageedit-lists">'; |
374 | 374 | $listsHTML .= sprintf('<label for="listcategories">%s</label><br/>', |
375 | 375 | s('Display list categories')); |
376 | 376 | $listsHTML .= sprintf('<input type="radio" name="showcategories" value="no" %s />%s<br/>', |
|
398 | 398 | if (!in_array($preselectList, $selected_lists)) { |
399 | 399 | $preselectList = 0; |
400 | 400 | } |
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>'; |
404 | 409 | while ($row = Sql_Fetch_Array($req)) { |
405 | 410 | $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 = ' '; |
| 415 | + } |
406 | 416 | $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>', |
408 | 418 | $row['id'], |
409 | 419 | $row['id'], |
410 | 420 | $listSelected ? 'checked="checked"' : '', |
411 | | - stripslashes($row['name'] ?? ''), |
| 421 | + $listName, |
412 | 422 | $row['id'], |
413 | 423 | $preselectList == $row['id'] ? 'checked="checked"' : '', |
414 | | - s('Preselect'), |
415 | | - htmlspecialchars(stripslashes($row['description'] ?? '')) |
| 424 | + $listDescription |
416 | 425 | ); |
417 | 426 | } |
| 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>'; |
418 | 433 |
|
419 | 434 | $listsHTML .= '</div>'; |
420 | 435 |
|
|
429 | 444 |
|
430 | 445 | echo '</div>'; // accordion |
431 | 446 |
|
| 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 | + |
432 | 464 | $ownerHTML = $singleOwner = ''; |
433 | 465 | $adminCount = 0; |
434 | 466 | if (isSuperUser() || accessLevel('spageedit') == 'all') { |
|
0 commit comments