From 86c2a611e55c9e35384febecf34964e214c0296e Mon Sep 17 00:00:00 2001 From: polo Date: Thu, 22 Jul 2021 03:49:28 +0200 Subject: patch modifs --- view/melaine.php | 56 +++++++++++++++++++++------------------------- view/template-ckeditor.php | 2 +- 2 files changed, 27 insertions(+), 31 deletions(-) (limited to 'view') diff --git a/view/melaine.php b/view/melaine.php index acf4962..debd4e3 100644 --- a/view/melaine.php +++ b/view/melaine.php @@ -67,48 +67,44 @@ if($_SESSION['admin'] == 1) // on pourrait paginer avec des onglets contenant 5 ou 10 articles chacun // tableau articles[] du dernier au premier (1 case = 1 article) -//for ($i=$nombreDarticles - 1; $i >= 0 ; $i--) - -//$j = 0; $j = count($articles); foreach ($articles as $article) -{ - //$j = $i + 1; - +{ // la div invisible sert à la compensation des liens d'ancre # ?>
Modifier l'article " . $j . "

"); - //echo("

Modification d'un article

"); - echo "\n"; - - echo($editeurHTML); // injection de template-editor.php -} + // remplacer un article par l'éditeur + if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'editor' && isset($_GET['article']) && $_GET['article'] == $j) + { + // on pourrait utiliser le timedate, ou encore le nom de l'article + echo("\n

Modifier l'article " . $j . "

"); + //echo("

Modification d'un article

"); + echo "\n"; -// placer un article -else -{ - // c'était pas compliqué - echo($article . "\n"); + echo($editeurHTML); // injection de template-editor.php + } - // bouton - if($_SESSION['admin'] == 1) + // placer un article + else { - ?> -

- - Modifier cet article - -

- +

+ + Modifier cet article + +

+
diff --git a/view/template-ckeditor.php b/view/template-ckeditor.php index f95344a..12e1430 100644 --- a/view/template-ckeditor.php +++ b/view/template-ckeditor.php @@ -174,7 +174,7 @@ ob_start(); // obtenir la liste des plugins disponibles: //alert(ClassicEditor.builtinPlugins.map( plugin => plugin.pluginName )); - var initial = ''; + var initial = ''; editor.setData(initial); } ) .catch( error => { -- cgit v1.2.3