From dced7ae0db4f79958d5c9eb973b99d97b31aa22d Mon Sep 17 00:00:00 2001 From: Esenjin Date: Sun, 16 Feb 2025 22:22:37 +0100 Subject: [PATCH] =?UTF-8?q?ajout=20d'une=20page=20"=C3=A0=20propos"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- about.php | 74 +++++++++++ admin/options.php | 265 ++++++++++++++++++++++++++++++--------- assets/css/public.css | 20 +++ config.json | 5 + includes/site-upload.php | 128 +++++++++++++++++-- index.php | 4 + version.txt | 2 +- 7 files changed, 429 insertions(+), 69 deletions(-) create mode 100644 about.php diff --git a/about.php b/about.php new file mode 100644 index 0000000..50bf1e0 --- /dev/null +++ b/about.php @@ -0,0 +1,74 @@ + 'À propos', + 'content' => '', + 'background' => '' +]; + +// Fonction pour convertir le contenu Delta en HTML +function deltaToHtml($content) { + return DeltaConverter::toHtml($content); +} +?> + + + + + + <?= htmlspecialchars($about['title']) ?> - <?= htmlspecialchars($config['site']['name']) ?> + + + + + + + + + + +
+ +
+ +

+
+ + +
+
+ +
+
+ +
+ ← Retour à l'accueil +
+ + + + + + \ No newline at end of file diff --git a/admin/options.php b/admin/options.php index 171f8a4..7841855 100644 --- a/admin/options.php +++ b/admin/options.php @@ -17,10 +17,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { try { $config = Config::load(); - // Mise à jour des valeurs textuelles + // Mise à jour des valeurs textuelles du site $config['site']['name'] = trim($_POST['site_name'] ?? ''); $config['site']['description'] = trim($_POST['site_description'] ?? ''); + // Mise à jour des valeurs de la page À propos + $config['about']['title'] = trim($_POST['about_title'] ?? 'À propos'); + $config['about']['content'] = $_POST['about_content'] ?? ''; + // Validation if (empty($config['site']['name'])) { throw new Exception('Le nom du site est requis'); @@ -31,6 +35,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $uploadHandler = new SiteUploadHandler(); $config['site']['logo'] = $uploadHandler->handleLogoUpload($_FILES['site_logo']); } + + // Gestion de l'upload du background de la page À propos + if (isset($_FILES['about_background']) && $_FILES['about_background']['error'] !== UPLOAD_ERR_NO_FILE) { + $uploadHandler = new SiteUploadHandler(); + $config['about']['background'] = $uploadHandler->handleBackgroundUpload($_FILES['about_background']); + } // Sauvegarde Config::save($config); @@ -54,13 +64,12 @@ $config = Config::load(); +