summaryrefslogtreecommitdiff
path: root/controller/admin.php
diff options
context:
space:
mode:
Diffstat (limited to 'controller/admin.php')
-rw-r--r--controller/admin.php31
1 files changed, 2 insertions, 29 deletions
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)
9 $page_actuelle = "melaine"; 9 $page_actuelle = "melaine";
10 10
11 // tableau $articles[] 11 // tableau $articles[]
12 require('model/melaine-read.php');
13 $croissant = False; 12 $croissant = False;
14 $articles = lireArticles($page_actuelle, $croissant); 13 $articles = lireArticles($page_actuelle, $croissant);
15 14
@@ -17,46 +16,20 @@ function melaineEdit($numArticle)
17 { 16 {
18 $title = "Ajouter un article"; 17 $title = "Ajouter un article";
19 $texte = ''; 18 $texte = '';
20 //$numArticle = count($articles) + 1;
21 } 19 }
22 else 20 else
23 { 21 {
24 $title = "Modifier un article"; 22 $title = "Modifier un article";
25 // faire correspondre le numéro de l'article du GET et le tableau des articles qui est inversé 23 $texte = lireUnArticle($_SESSION['nomFichier']);
26 $texte = $articles[count($articles) - $numArticle];
27 } 24 }
28 25
29 // traitements PHP pour l'éditeur 26 // traitements PHP pour l'éditeur
30 require('controller/ckeditor.php'); 27 require('controller/ckeditor.php');
31 // sécurisation du contenu pré-existant inséré dans l'éditeur 28 // sécurisation du contenu pré-existant inséré dans l'éditeur
32 $initial = preparationCKeditor($numArticle, $texte); 29 $texte = preparationCKeditor($numArticle, $texte);
33 30
34 // NB: penser à ajouter au template la fonctionnalité "autosave" 31 // NB: penser à ajouter au template la fonctionnalité "autosave"
35 // https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/saving-data.html 32 // https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/saving-data.html
36
37 // if($numArticle > $nombreDarticles || $numArticle < 0) // erreur nombre trop grand (bug?)
38 // {
39 // header('Location: index.php?page=melaine');
40 // }
41 // elseif($numArticle == 0) // nouvel article
42 // {
43 // $texte = '';
44 // $numArticle = $nombreDarticles + 1;
45 // }
46 // else // modification d'un article
47 // {
48 // $texte = $articles[$numArticle - 1];
49 // }
50
51
52 // if($initial == '')
53 // {
54 // $article = "nouveau";
55 // }
56 // else
57 // {
58 // $article = "modif";
59 // }
60 33
61 // variable $editeurHTML, $initial est inséré dedans 34 // variable $editeurHTML, $initial est inséré dedans
62 require('view/template-ckeditor.php'); 35 require('view/template-ckeditor.php');