mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
WCAG 3.3.1 (Error Identification): failing fields now get aria-errormessage pointing to the flash-error container and aria-invalid="true". WCAG 3.3.3 (Error Suggestion): <small> hint text on inputs, selects, and file fields is now linked via aria-describedby (always, not just on error). Changes: - text-field.php, select-field.php, checkbox-list.php: accept $errorFieldName; add aria-errormessage/aria-invalid on match; add id to <small> and aria-describedby on the control - fieldset-tfe-info.php: aria-invalid on synopsis textarea - fichiers-fragment.php: aria-describedby on cover, note d'intention, TFE, annexes, and website inputs; aria-invalid on format checkboxes when error matches 'formats' - form.php: id="flash-error" + tabindex="-1" on flash-error div; accept $errorFieldName from callers - admin/add.php: set $errorFieldName, wire $withAutofocusFn (was identity default) - admin/edit.php: set $errorFieldName - partage/index.php: consume autofocus field, wire autofocus function, add App::flashAutofocus() in submit catch block Also fixes WCAG standards issue: removed invalid 'required' HTML attribute from <fieldset> elements in checkbox-list.php and fichiers-fragment.php (only aria-required stays). Added role="group" for explicit ARIA semantics.
55 lines
2.4 KiB
PHP
55 lines
2.4 KiB
PHP
<main id="main-content">
|
|
<h1><a href="/admin/" class="admin-back-btn" title="Retour à la liste"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48-88a8,8,0,0,1-8,8H107.31l18.35,18.34a8,8,0,0,1-11.32,11.32l-32-32a8,8,0,0,1,0-11.32l32-32a8,8,0,0,1,11.32,11.32L107.31,120H168A8,8,0,0,1,176,128Z"></path></svg></a> Ajouter un TFE</h1>
|
|
|
|
<?php
|
|
// ── Variables for the shared form partial ─────────────────────────────────
|
|
$mode = 'add';
|
|
$formAction = 'actions/formulaire.php';
|
|
$hiddenFields = '<input type="hidden" name="csrf_token" value="' . htmlspecialchars($_SESSION["csrf_token"]) . '">';
|
|
$errorFieldName = $autofocusField ?? null;
|
|
$withAutofocusFn = function (string $field, array $attrs = []) use ($autofocusField) {
|
|
if ($autofocusField === $field) $attrs['autofocus'] = true;
|
|
return $attrs;
|
|
};
|
|
|
|
$synopsisExtra = '';
|
|
|
|
// Jury: fresh add (all empty)
|
|
$juryPromoteur = null;
|
|
$juryPromoteurs = [];
|
|
$juryPromoteurUlb = null;
|
|
$juryPromoteursUlb = [];
|
|
$lecteursInternes = [];
|
|
$lecteursExternes = [];
|
|
$showPromoteurUlb = true;
|
|
$promoteurUlbConditional = false;
|
|
|
|
// Licence / access
|
|
$libreEnabled = ($siteSettings['access_type_libre_enabled'] ?? '0') === '1';
|
|
$interneEnabled = ($siteSettings['access_type_interne_enabled'] ?? '1') === '1';
|
|
$interditEnabled = ($siteSettings['access_type_interdit_enabled'] ?? '1') === '1';
|
|
$generalitiesHtml = $helpFn('fieldset_generalites');
|
|
$defaultAccessTypeId = 2;
|
|
|
|
// Optional sections
|
|
$showContact = false; // Admin: contact visibility controlled by filling 'mail' field in fieldset-tfe-info
|
|
$showBackoffice = true;
|
|
|
|
// Files: add mode
|
|
$filesMode = 'add';
|
|
|
|
// Website URL (repopulation)
|
|
$existingWebsiteUrl = $formData['website_url'] ?? '';
|
|
$existingWebsiteLabel = $formData['website_label'] ?? '';
|
|
|
|
// Backoffice (add mode: null → falls back to formData)
|
|
$currentRaw = [];
|
|
$contactInterne = null;
|
|
$contactPublic = false;
|
|
$currentContextNote = null;
|
|
$currentContactVisible = null;
|
|
|
|
include APP_ROOT . '/templates/partials/form/form.php';
|
|
?>
|
|
</main>
|