From 86c2a611e55c9e35384febecf34964e214c0296e Mon Sep 17 00:00:00 2001 From: polo Date: Thu, 22 Jul 2021 03:49:28 +0200 Subject: patch modifs --- controller/admin.php | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) (limited to 'controller/admin.php') diff --git a/controller/admin.php b/controller/admin.php index 77ab34e..a35f28a 100644 --- a/controller/admin.php +++ b/controller/admin.php @@ -9,7 +9,6 @@ function melaineEdit($numArticle) $page_actuelle = "melaine"; // tableau $articles[] - require('model/melaine-read.php'); $croissant = False; $articles = lireArticles($page_actuelle, $croissant); @@ -17,46 +16,20 @@ function melaineEdit($numArticle) { $title = "Ajouter un article"; $texte = ''; - //$numArticle = count($articles) + 1; } else { $title = "Modifier un article"; - // faire correspondre le numéro de l'article du GET et le tableau des articles qui est inversé - $texte = $articles[count($articles) - $numArticle]; + $texte = lireUnArticle($_SESSION['nomFichier']); } // traitements PHP pour l'éditeur require('controller/ckeditor.php'); // sécurisation du contenu pré-existant inséré dans l'éditeur - $initial = preparationCKeditor($numArticle, $texte); + $texte = preparationCKeditor($numArticle, $texte); // NB: penser à ajouter au template la fonctionnalité "autosave" // https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/saving-data.html - - // if($numArticle > $nombreDarticles || $numArticle < 0) // erreur nombre trop grand (bug?) - // { - // header('Location: index.php?page=melaine'); - // } - // elseif($numArticle == 0) // nouvel article - // { - // $texte = ''; - // $numArticle = $nombreDarticles + 1; - // } - // else // modification d'un article - // { - // $texte = $articles[$numArticle - 1]; - // } - - - // if($initial == '') - // { - // $article = "nouveau"; - // } - // else - // { - // $article = "modif"; - // } // variable $editeurHTML, $initial est inséré dedans require('view/template-ckeditor.php'); -- cgit v1.2.3