summaryrefslogtreecommitdiff
path: root/view
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2021-07-22 03:49:28 +0200
committerpolo <ordipolo@gmx.fr>2021-07-22 03:49:28 +0200
commit86c2a611e55c9e35384febecf34964e214c0296e (patch)
treee910a2f9a135bfc7059fd28c9af6c00ae46b5fde /view
parenta23573d5aff91e18d1240a6ac84c2962a8a15f87 (diff)
downloadmelaine-86c2a611e55c9e35384febecf34964e214c0296e.zip
patch modifs
Diffstat (limited to 'view')
-rw-r--r--view/melaine.php56
-rw-r--r--view/template-ckeditor.php2
2 files changed, 27 insertions, 31 deletions
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)
67// on pourrait paginer avec des onglets contenant 5 ou 10 articles chacun 67// on pourrait paginer avec des onglets contenant 5 ou 10 articles chacun
68 68
69// tableau articles[] du dernier au premier (1 case = 1 article) 69// tableau articles[] du dernier au premier (1 case = 1 article)
70//for ($i=$nombreDarticles - 1; $i >= 0 ; $i--)
71
72//$j = 0;
73$j = count($articles); 70$j = count($articles);
74foreach ($articles as $article) 71foreach ($articles as $article)
75{ 72{
76 //$j = $i + 1;
77
78 // la div invisible sert à la compensation des liens d'ancre # 73 // la div invisible sert à la compensation des liens d'ancre #
79?> 74?>
80 <div class="zoneVideNav" ></div> 75 <div class="zoneVideNav" ></div>
81 <article id="article<?= $j ?>" > 76 <article id="article<?= $j ?>" >
82<?php 77<?php
83 78
84// remplacer un article par l'éditeur 79 // remplacer un article par l'éditeur
85if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'editor' && isset($_GET['article']) && $_GET['article'] == $j) 80 if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'editor' && isset($_GET['article']) && $_GET['article'] == $j)
86{ 81 {
87 echo("\n<p>Modifier l'article " . $j . "</p>"); 82 // on pourrait utiliser le timedate, ou encore le nom de l'article
88 //echo("<p>Modification d'un article</p>"); 83 echo("\n<p>Modifier l'article " . $j . "</p>");
89 echo "\n"; 84 //echo("<p>Modification d'un article</p>");
90 85 echo "\n";
91 echo($editeurHTML); // injection de template-editor.php
92}
93 86
94// placer un article 87 echo($editeurHTML); // injection de template-editor.php
95else 88 }
96{
97 // c'était pas compliqué
98 echo($article . "\n");
99 89
100 // bouton 90 // placer un article
101 if($_SESSION['admin'] == 1) 91 else
102 { 92 {
103 ?> 93 // c'était pas compliqué
104 <p class="boutonArticle" > 94 echo($article . "\n");
105 <a href="index.php?page=melaine&action=editor&article=<?= $j ?>#article<?= $j ?>" > 95
106 Modifier cet article 96 // bouton
107 </a> 97 if($_SESSION['admin'] == 1)
108 </p> 98 {
109 <?php 99 ?>
100 <p class="boutonArticle" >
101 <a href="index.php?page=melaine&action=editor&article=<?= $j ?>#article<?= $j ?>" >
102 Modifier cet article
103 </a>
104 </p>
105 <?php
106 }
110 } 107 }
111}
112 108
113?> 109?>
114 </article> 110 </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();
174 // obtenir la liste des plugins disponibles: 174 // obtenir la liste des plugins disponibles:
175 //alert(ClassicEditor.builtinPlugins.map( plugin => plugin.pluginName )); 175 //alert(ClassicEditor.builtinPlugins.map( plugin => plugin.pluginName ));
176 176
177 var initial = '<?= $initial ?>'; 177 var initial = '<?= $texte ?>';
178 editor.setData(initial); 178 editor.setData(initial);
179 } ) 179 } )
180 .catch( error => { 180 .catch( error => {