mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
- Hardcode source code URL and credits in about template, remove from DB/admin interface; only contacts remains editable - Merge apropos editables into one À propos section, remove charte, add editable source code URL
71 lines
3.3 KiB
PHP
71 lines
3.3 KiB
PHP
<main id="main-content">
|
|
<h1>Éditer : <?= htmlspecialchars($editTitle) ?></h1>
|
|
|
|
<?php if ($editType === 'about_page'): ?>
|
|
|
|
<!-- ── Markdown content ──────────────────────────────────────────────── -->
|
|
<h2>Contenu de la page</h2>
|
|
<form action="/admin/actions/page.php" method="post" class="admin-form">
|
|
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION["csrf_token"]) ?>">
|
|
<input type="hidden" name="slug" value="about">
|
|
|
|
<label for="editor">Contenu (Markdown) :</label>
|
|
<input type="hidden" id="content" name="content"
|
|
value="<?= htmlspecialchars($initialContent) ?>">
|
|
<div id="editor"></div>
|
|
|
|
<div class="admin-form-footer">
|
|
<button type="submit" class="btn btn--primary">Enregistrer</button>
|
|
<a href="/admin/contenus.php" class="btn btn--secondary admin-cancel-link">Annuler</a>
|
|
</div>
|
|
</form>
|
|
|
|
<!-- ── Contacts ──────────────────────────────────────────────────────── -->
|
|
<h2 style="margin-top:3rem;">Contacts</h2>
|
|
<?php
|
|
$aproposKey = 'contacts';
|
|
$groups = $aboutContacts ?? [];
|
|
include APP_ROOT . '/templates/admin/apropos-groups-form.php';
|
|
?>
|
|
|
|
<?php elseif ($editType === 'page' && $pageSlug !== 'about'): ?>
|
|
<form action="/admin/actions/page.php" method="post" class="admin-form">
|
|
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION["csrf_token"]) ?>">
|
|
<input type="hidden" name="slug" value="<?= htmlspecialchars($pageSlug) ?>">
|
|
|
|
<label for="editor">Contenu (Markdown) :</label>
|
|
<input type="hidden" id="content" name="content"
|
|
value="<?= htmlspecialchars($initialContent) ?>">
|
|
<div id="editor"></div>
|
|
|
|
<div class="admin-form-footer">
|
|
<button type="submit" class="btn btn--primary">Enregistrer</button>
|
|
<a href="/admin/contenus.php" class="btn btn--secondary admin-cancel-link">Annuler</a>
|
|
</div>
|
|
</form>
|
|
|
|
<?php elseif ($editType === 'form_help'): ?>
|
|
<p class="param-note">Ce texte est affiché dans le formulaire de soumission des étudiant·es (lien de partage). Supporte le Markdown.</p>
|
|
<form action="/admin/actions/form-help.php" method="post" class="admin-form">
|
|
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">
|
|
<input type="hidden" name="form_help_key" value="<?= htmlspecialchars($formHelpKey) ?>">
|
|
|
|
<label for="editor">Contenu (Markdown) :</label>
|
|
<input type="hidden" id="content" name="content"
|
|
value="<?= htmlspecialchars($initialContent) ?>">
|
|
<div id="editor"></div>
|
|
|
|
<div class="admin-form-footer">
|
|
<button type="submit" class="btn btn--primary">Enregistrer</button>
|
|
<a href="/admin/contenus.php#form-help-blocks" class="btn btn--secondary admin-cancel-link">Annuler</a>
|
|
</div>
|
|
</form>
|
|
|
|
<?php else: ?>
|
|
<?php
|
|
$groups = is_array($value) ? $value : [];
|
|
?>
|
|
<?php include APP_ROOT . '/templates/admin/apropos-groups-form.php'; ?>
|
|
<?php endif; ?>
|
|
</main>
|