mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
Created templates/partials/form/form.php as the unified form template driven by
$mode ('add'|'edit'|'partage') and boolean flags for optional sections.
The three calling templates (templates/admin/add.php, templates/admin/edit.php,
partage/index.php renderShareLinkForm) now only set variables then include the
shared partial. ~200 lines of duplicated fieldset HTML eliminated.
50 lines
1.7 KiB
PHP
50 lines
1.7 KiB
PHP
<main id="main-content">
|
|
<h1>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"]) . '">';
|
|
|
|
$synopsisExtra = '';
|
|
|
|
// Jury: fresh add (all empty)
|
|
$juryPromoteur = null;
|
|
$juryPromoteurUlb = null;
|
|
$lecteursInternes = [];
|
|
$lecteursExternes = [];
|
|
$juryPresident = null;
|
|
$showPresident = false;
|
|
$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 = true;
|
|
$showContextNote = true;
|
|
$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 = [];
|
|
$currentAuthorEmail = null;
|
|
$currentAuthorShowContact = false;
|
|
$currentContextNote = null;
|
|
|
|
include APP_ROOT . '/templates/partials/form/form.php';
|
|
?>
|
|
</main>
|