getPage($pageSlug); if (!$page) { die("Page introuvable."); } $editTitle = $page["title"]; $editType = "page"; } else { $editType = "apropos"; $value = $db->getAproposContent($aproposKey); $editTitle = match($aproposKey) { 'contacts' => 'Contacts', 'credits' => 'Crédits', }; } } catch (Exception $e) { die("Erreur: " . htmlspecialchars($e->getMessage())); } $pageTitle = "Éditer : " . $editTitle; $extraJs = ["/assets/js/overtype.min.js"]; $extraJsInline = <<<'JS' var OT = window.OverType.default || window.OverType; var hidden = document.getElementById('content'); var editor = new OT(document.getElementById('editor'), { value: hidden.value, minHeight: '400px', spellcheck: false, onChange: function(value) { hidden.value = value; } }); JS; $aproposEditorJs = null; if ($editType === 'apropos' && in_array($aproposKey, ['contacts', 'credits'])) { // Rich textarea for JSON arrays rendered as structured form $aproposEditorJs = <<<'JS' // Auto-format JSON in the hidden field for display purposes JS; } $initialContent = ''; if ($editType === 'page') { $initialContent = $page["content"] ?? ""; } else { // For apropos, show structured form } ?>

Éditer :

">
"> $group): ?>
$entry): ?>