summaryrefslogtreecommitdiff
path: root/view/melaine.php
diff options
context:
space:
mode:
Diffstat (limited to 'view/melaine.php')
-rw-r--r--view/melaine.php56
1 files changed, 26 insertions, 30 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>