Files
xamxam/templates/partials/form/checkbox-list.php
Pontoporeia ff8e33727d admin: semantic HTML pass — checkbox fieldset, landmarks, dl/dt, autocomplete, inline styles
checkbox-list.php partial:
- Replace outer <div>/<label> with <div>/<span class="admin-row-label"> + inner
  <fieldset class="admin-checkbox-group"><legend class="sr-only"> to satisfy
  WCAG 1.3.1 (group label for multi-checkbox rows without duplicating visible text)
- Replace <div class="admin-checkbox-list"> with <ul>; each checkbox wrapped in <li>

admin.css:
- Drop .admin-checkbox-list; add .admin-body fieldset.admin-checkbox-group rules
  (border/padding reset so it doesn't inherit jury-fieldset box styling)
- Extend form-row label rule to span.admin-row-label
- .admin-inline-form + .admin-inline-form { margin-top:.35rem } replaces inline style
- .admin-input--inline / .admin-select--inline get width:160px (was inline style)
- .admin-tags-count + table th sizing via :has() replaces th inline styles

login.php: wrap content in <main id="main-content"> (missing landmark)

account.php:
- <div class="admin-account-status"> → <dl>; __label <span> → <dt>
- <div class="admin-danger-zone__description"> → <p>

index.php: <div class="admin-maintenance-bar"> → <aside role="status" aria-label="Statut du site">

add.php / edit.php: autocomplete="name" on author field, autocomplete="email" on
contact field (WCAG 1.3.5 / input purpose)

tags.php: all inline style= attributes removed (width, text-align, margin-top,
display:inline); all moved to CSS classes
2026-04-06 15:33:08 +02:00

40 lines
1.5 KiB
PHP

<?php
/**
* Checkbox list partial — renders a group of checkboxes (e.g. languages, formats).
*
* The group label uses a visible <span> as the first column (matching other form
* rows), while a <fieldset>/<legend> in the second column provides the accessible
* grouping required by WCAG 1.3.1. The <legend> is visually hidden (sr-only) to
* avoid duplicating the visible label text.
*
* Variables consumed:
* string $name — input name attribute (will be posted as array: name[])
* string $label — group label text
* array $options — each element must have 'id' and 'name' keys
* array $checked — array of 'id' values that are currently checked
*/
$checked = $checked ?? [];
?>
<div>
<span class="admin-row-label"><?= htmlspecialchars($label) ?></span>
<fieldset class="admin-checkbox-group">
<legend class="sr-only"><?= htmlspecialchars($label) ?></legend>
<ul>
<?php foreach ($options as $opt): ?>
<li>
<label class="admin-checkbox-label">
<input type="checkbox"
name="<?= htmlspecialchars($name) ?>[]"
value="<?= htmlspecialchars((string)$opt['id']) ?>"
<?= in_array((string)$opt['id'], array_map('strval', $checked)) ? 'checked' : '' ?>>
<?= htmlspecialchars($opt['name']) ?>
</label>
</li>
<?php endforeach; ?>
</ul>
</fieldset>
</div>
<?php
unset($checked);