mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
All admin pages refactored to thin controllers + pure view templates, mirroring the public-page pattern: Controllers (public/admin/*.php): auth, data loading, include template Views (templates/admin/*.php): pure HTML/PHP output Fragment partials (templates/admin/partials/): toast, system-log-panel, system-nginx-config-panel Pages migrated: login, tags, contenus, contenus-edit, account, acces-etudiante, thanks, add, edit, parametres, system, index Fragment endpoints refactored: system-fragment.php, toast-fragment.php Skipped (pure redirects): logout, logs, status, import
22 lines
560 B
PHP
22 lines
560 B
PHP
<?php
|
|
/**
|
|
* Toast fragment endpoint — HTMX target.
|
|
*
|
|
* Reads flash messages from the session and returns the toast markup.
|
|
* Returns an empty 204 when there is nothing to show.
|
|
* Called via hx-get on the #toast-region aside in the admin footer.
|
|
*/
|
|
require_once __DIR__ . '/../../bootstrap.php';
|
|
require_once __DIR__ . '/../../src/AdminAuth.php';
|
|
|
|
AdminAuth::requireLogin();
|
|
|
|
$flash = App::consumeFlash();
|
|
|
|
if (!$flash['error'] && !$flash['success']) {
|
|
http_response_code(204);
|
|
exit;
|
|
}
|
|
|
|
include APP_ROOT . '/templates/admin/partials/toast.php';
|