summaryrefslogtreecommitdiff
path: root/view/pageArticlesSimples.php
diff options
context:
space:
mode:
Diffstat (limited to 'view/pageArticlesSimples.php')
-rw-r--r--view/pageArticlesSimples.php123
1 files changed, 33 insertions, 90 deletions
diff --git a/view/pageArticlesSimples.php b/view/pageArticlesSimples.php
index 88cce4c..34f5dca 100644
--- a/view/pageArticlesSimples.php
+++ b/view/pageArticlesSimples.php
@@ -3,13 +3,23 @@
3 3
4// variable $css 4// variable $css
5ob_start(); 5ob_start();
6if($page == 'menu')
7{
8?>
9 <link rel="stylesheet" type="text/css" href="public/css/menu.css" />
10<?php
11}
12else
13{
6?> 14?>
7 <link rel="stylesheet" type="text/css" href="public/css/pages_articles_simples.css" /> 15 <link rel="stylesheet" type="text/css" href="public/css/pages_articles_simples.css" />
16<?php
17}
18?>
8 <link rel="stylesheet" type="text/css" href="public/css/donnees_hors_editeur.css" /> 19 <link rel="stylesheet" type="text/css" href="public/css/donnees_hors_editeur.css" />
9<?php 20<?php
10$css = ob_get_clean(); 21$css = ob_get_clean();
11 22
12
13//variable $js 23//variable $js
14ob_start(); 24ob_start();
15?> 25?>
@@ -51,107 +61,40 @@ ob_start();
51echo "\n"; 61echo "\n";
52?> 62?>
53 <header> 63 <header>
64
65<?php
66if($page == 'menu' && !empty($ArticlesContent))
67{
68?>
69 <h3>Actualité</h3>
70 <div class="sectionActu" >
71 <?= $ArticlesContent ?>
72 </div>
73<?php
74}
75?>
54 <div id="titre" > 76 <div id="titre" >
55 <div class="police_titre" ><?= $headerPaintedTitle ?></div> 77 <div class="police_titre" ><?= $headerPaintedTitle ?></div>
56 </div> 78 </div>
57 <?= $headerImage ?> 79<?php
80if($page != 'menu')
81{
82 echo($headerImage);
83}
84?>
58 </header> 85 </header>
59 <?php 86 <?php
60$header = ob_get_clean(); 87$header = ob_get_clean();
61 88
62 89
63
64// variable $content 90// variable $content
65ob_start(); 91ob_start();
66if($_SESSION['admin'] == 1) 92if($page == 'menu')
67{ 93{
68 // à la place du bouton après rechargement 94 echo($menu);
69 if(isset($_GET['action']) && $_GET['action'] == 'editor' && !isset($_GET['file_code']))
70 {
71 $style = 'class="articleAvecEditeur"';
72?>
73 <div <?= $style ?>>
74 <h3>Rédiger un nouvel article</h3>
75<?php
76 echo($editeurHTML); // injection de template-editor.php
77 }
78
79 // bouton
80 else
81 {
82?>
83 <div>
84 <p class="boutonArticle boutonNouvelArticle" >
85 <a href="index.php?page=<?= $page ?>&action=editor" >
86 Nouvel article
87 </a>
88 </p>
89<?php
90 }
91?>
92 </div>
93<?php
94} 95}
95 96else
96// on pourrait paginer avec des onglets de par exemple 10 articles
97
98// tableau articles[] du plus récent au plus ancien
99for($i = 0; $i < $Articles->fileListCount; $i++)
100{ 97{
101 // la div invisible sert à la compensation des liens d'ancre # 98 echo($ArticlesContent);
102
103 // article modifié sur fond coloré
104 if(isset($fileCode) && $Articles->fileList[$i]['fileCode'] == $fileCode)
105 {
106 $style = 'class="articleAvecEditeur"';
107 }
108 else
109 {
110 $style = '';
111 }
112?>
113 <div class="zoneVideNav" ></div>
114 <article id="<?= $Articles->fileList[$i]['fileCode'] ?>">
115 <div <?= $style ?>>
116<?php
117
118 // remplacer un article par l'éditeur
119 if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'editor' && isset($_GET['file_code'])
120 && $_GET['file_code'] == $Articles->fileList[$i]['fileCode']
121 )
122 {
123 // on pourrait utiliser ici le timedate, ou encore le nom de l'article
124?>
125 <h3>Modification d'un article</h3>
126<?php
127 echo($editeurHTML); // injection de template-editor.php
128 }
129
130 // placer un article
131 else
132 {
133 // et voila
134 echo($Articles->fileList[$i]['content'] . "\n");
135
136 // bouton
137 if($_SESSION['admin'] == 1)
138 {
139 ?>
140 <p class="boutonArticle" >
141 <a href="index.php?page=<?= $page ?>&action=editor&file_code=<?= $Articles->fileList[$i]['fileCode'] ?>#<?= $Articles->fileList[$i]['fileCode'] ?>" >
142 Modifier cet article
143 </a>
144 &nbsp;<!-- un espace -->
145 <a href="index.php?page=<?= $page ?>&action=suppression&file_code=<?= $Articles->fileList[$i]['fileCode'] ?>" onclick="confirmerSuppression()" >
146 Supprimer cet article
147 </a>
148 </p>
149 <?php
150 }
151 }
152?>
153 </div>
154 </article>
155<?php
156} 99}
157$content = ob_get_clean(); 100$content = ob_get_clean();