Files
xamxam/templates/partials/flash-messages.php
Pontoporeia e9e012376d Replace .admin-alert BEM classes with semantic role/data-type attributes
- admin.css: replace .admin-alert / .admin-alert--error / .admin-alert--success
  selectors with [role="alert"][data-type="error"] and [role="status"][data-type="success"]
- All 10 admin templates updated: <div class="admin-alert admin-alert--{type}">
  becomes <p role="alert|status" data-type="error|success"> (or <div> for the
  import.php multi-item list that contains a <ul>)
- flash-messages.php partial updated to match
- WCAG benefit: role="alert" is an ARIA live region — errors are announced
  immediately by screen readers without focus movement (fixes WCAG 3.3.1, 4.1.2)
- role="status" (polite live region) used for success messages — announced
  without interrupting the user
- Removes two BEM modifier classes; CSS now targets element semantics directly
2026-04-02 12:35:23 +02:00

19 lines
658 B
PHP

<?php
/**
* Shared flash-message partial.
*
* Consumes all flash variants (unified _flash_* keys and legacy per-page keys)
* via App::consumeFlash(), then renders the standard alert markup.
*
* Usage: include this partial wherever flash messages should appear.
* No variables need to be set beforehand — it reads from the session directly.
*/
$_flash = App::consumeFlash();
?>
<?php if ($_flash['error']): ?>
<p role="alert" data-type="error">⚠ <?= htmlspecialchars($_flash['error']) ?></p>
<?php endif; ?>
<?php if ($_flash['success']): ?>
<p role="status" data-type="success">✓ <?= htmlspecialchars($_flash['success']) ?></p>
<?php endif; ?>