summaryrefslogtreecommitdiff
path: root/controller/visitor.php
diff options
context:
space:
mode:
Diffstat (limited to 'controller/visitor.php')
-rw-r--r--controller/visitor.php19
1 files changed, 11 insertions, 8 deletions
diff --git a/controller/visitor.php b/controller/visitor.php
index d03197d..92f3db7 100644
--- a/controller/visitor.php
+++ b/controller/visitor.php
@@ -21,7 +21,7 @@ function accueil()
21function pageArticlesSimplesVisitor(string $page, string $title, string $headerPaintedTitle) 21function pageArticlesSimplesVisitor(string $page, string $title, string $headerPaintedTitle)
22{ 22{
23 // infos sur les fichiers $Articles->fileList 23 // infos sur les fichiers $Articles->fileList
24 $Articles = new Article($page); 24 $Articles = new Article($page, $page);
25 25
26 // données des dates 26 // données des dates
27 //print_r($Articles->fileList[$i]['date']); 27 //print_r($Articles->fileList[$i]['date']);
@@ -115,14 +115,16 @@ function legalVisitor()
115} 115}
116 116
117 117
118// page plus complexe que les autres 118
119// page complexe avec albums et articles
120// cas où on ne fait rien, même en en mode admin
119function discoVisitor() 121function discoVisitor()
120{ 122{
121 $page = "discographie"; 123 $page = $_GET['page'];
122 $title = "Discographie"; 124 $title = "Discographie";
123 125
124 // modèle 126 // modèle
125 $Albums = new Album($page); 127 $Albums = new Album($page, $page);
126 //var_dump($Albums->fileList); die(); 128 //var_dump($Albums->fileList); die();
127 129
128 // on récupère tout: JSON, HTML, noms et chemins des fichiers 130 // on récupère tout: JSON, HTML, noms et chemins des fichiers
@@ -148,7 +150,7 @@ function discoVisitor()
148 $avecLien[$i] = false; 150 $avecLien[$i] = false;
149 $linkDiscoChrono[$i] = 'noLinkChrono'; // pour le css 151 $linkDiscoChrono[$i] = 'noLinkChrono'; // pour le css
150 } 152 }
151 $lienBoutonModif[$i] = 'page=discographie&action=edition&file_code=' . $Albums->fileList[$i]['fileCode'] . '#' . $Albums->fileList[$i]['fileCode']; 153 $lienBoutonModif[$i] = 'page=album&action=edition&file_code=' . $Albums->fileList[$i]['fileCode'];
152 } 154 }
153 155
154 // variables $css, $js et $content 156 // variables $css, $js et $content
@@ -158,11 +160,11 @@ function discoVisitor()
158} 160}
159 161
160// page d'un album 162// page d'un album
161function album($fileCode) 163function albumVisitor($fileCode)
162{ 164{
163 $page = 'discographie'; // = nom du dossier où sont les données 165 $page = $_GET['page'];
166 $Albums = new Album($page, 'discographie');
164 167
165 $Albums = new Album($page);
166 $Albums->getAllJSON(); 168 $Albums->getAllJSON();
167 if(!empty($Albums->fileList)) 169 if(!empty($Albums->fileList))
168 { 170 {
@@ -174,6 +176,7 @@ function album($fileCode)
174 $title = $Albums->oneAlbum['titre']; 176 $title = $Albums->oneAlbum['titre'];
175 $album = $Albums->oneAlbum['HTMLcontent']; 177 $album = $Albums->oneAlbum['HTMLcontent'];
176 178
179 // création des liens: menu déroulant et section principale
177 for($i = 0; $i < $Albums->fileListCount; $i++) 180 for($i = 0; $i < $Albums->fileListCount; $i++)
178 { 181 {
179 if(file_exists('data/discographie/html/' . $Albums->fileList[$i]['fileCode'] . '.html')) 182 if(file_exists('data/discographie/html/' . $Albums->fileList[$i]['fileCode'] . '.html'))