From 51a5391c96043829f7bbccda1262a51a8b8f93d8 Mon Sep 17 00:00:00 2001 From: git-pc-greta Date: Mon, 3 Feb 2025 22:41:21 +0100 Subject: bouton supprimer --- index.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'index.php') diff --git a/index.php b/index.php index f33b47b..3e89113 100644 --- a/index.php +++ b/index.php @@ -71,6 +71,20 @@ elseif($ckeditor->getStorageMode() === 'files') $id_array[] = rtrim($file_name, '.html'); } } + + // suppression et rechargement + if(isset($_GET['action']) && $_GET['action'] === 'delete_article') + { + if(in_array($id_article, $id_array)) + { + unlink(CKEditor::DATA_PATH . '/html/' . $id_article . '.html'); + //$ckeditor->deleteSideEffects(); + } + header('Location: index.php?page=' . $from); + die; + } + + // affichage foreach($id_array as $id) { $texte = trim(file_get_contents(CKEditor::DATA_PATH . '/html/' . $id . '.html')); -- cgit v1.2.3