summaryrefslogtreecommitdiff
path: root/controller/visitor.php
diff options
context:
space:
mode:
Diffstat (limited to 'controller/visitor.php')
-rw-r--r--controller/visitor.php33
1 files changed, 7 insertions, 26 deletions
diff --git a/controller/visitor.php b/controller/visitor.php
index aae15a7..ac19441 100644
--- a/controller/visitor.php
+++ b/controller/visitor.php
@@ -30,8 +30,6 @@ function menu()
30// toutes celles du menu sauf: menu et discographie 30// toutes celles du menu sauf: menu et discographie
31function pageArticlesSimplesVisitor(string $page, string $title, string $headerPaintedTitle) 31function pageArticlesSimplesVisitor(string $page, string $title, string $headerPaintedTitle)
32{ 32{
33 $headerImage = '<div class="photo" id="photo_' . $page . '" ></div>';
34
35 // infos sur les fichiers $Articles->fileList 33 // infos sur les fichiers $Articles->fileList
36 $Articles = new Article($page); 34 $Articles = new Article($page);
37 35
@@ -47,7 +45,7 @@ function pageArticlesSimplesVisitor(string $page, string $title, string $headerP
47 $Articles->fileList = array_reverse($Articles->fileList); 45 $Articles->fileList = array_reverse($Articles->fileList);
48 } 46 }
49 47
50 // variables $css, $js, $header et $content 48 // variables $css, $js, $header, $content et $headerImage
51 require('view/pageArticlesSimples.php'); 49 require('view/pageArticlesSimples.php');
52 // HTML 50 // HTML
53 require('view/template.php'); 51 require('view/template.php');
@@ -122,43 +120,22 @@ function discoVisitor()
122 } 120 }
123 //var_dump($Albums->fileList); die(); 121 //var_dump($Albums->fileList); die();
124 122
125
126 // tri des albums avec l'année dans le .json
127
128 // noms des fichiers JSON
129 //$albumNamesJSON = $Albums->fileList;
130
131 //$annees = [];
132 for($i = 0; $i < $Albums->fileListCount; $i++)
133 {}
134 //var_dump($annee); die();
135
136 // tri d'un tableau multidimensionnel
137 //array_multisort($annees, $albumsJSON);
138
139
140 // lien vers le HTML ou ancre?
141 /*$lienAlbum = [];
142 $avecLien = [];
143 $linkDiscoChrono = [];*/
144
145 // liens vers les albums 123 // liens vers les albums
146 for($i = 0; $i < $Albums->fileListCount; $i++) 124 for($i = 0; $i < $Albums->fileListCount; $i++)
147 { 125 {
148 if(file_exists('data/discographie/html/' . $Albums->fileList[$i]['fileCode'] . '.html')) 126 if(file_exists('data/discographie/html/' . $Albums->fileList[$i]['fileCode'] . '.html'))
149 { 127 {
150 /*$lienAlbum[$i] = 'page=album&album_name=' . $Albums->fileList[$i]['titre'] . '&file_code=' . $Albums->fileList[$i]['fileCode'];*/
151 $lienAlbum[$i] = 'page=album&file_code=' . $Albums->fileList[$i]['fileCode']; 128 $lienAlbum[$i] = 'page=album&file_code=' . $Albums->fileList[$i]['fileCode'];
152 $avecLien[$i] = true; 129 $avecLien[$i] = true;
153 $linkDiscoChrono[$i] = 'linkChrono'; // pour le css 130 $linkDiscoChrono[$i] = 'linkChrono'; // pour le css
154 } 131 }
155 else 132 else
156 { 133 {
157 $lienAlbum[$i] = 'page=discographie#' . $Albums->fileList[$i]['titre']; 134 $lienAlbum[$i] = 'page=discographie#' . $Albums->fileList[$i]['fileCode'];
158 $avecLien[$i] = false; 135 $avecLien[$i] = false;
159 $linkDiscoChrono[$i] = 'noLinkChrono'; // pour le css 136 $linkDiscoChrono[$i] = 'noLinkChrono'; // pour le css
160 } 137 }
161 $lienBoutonModif[$i] = 'page=discographie&action=edition&file_code=' . $Albums->fileList[$i]['fileCode']; 138 $lienBoutonModif[$i] = 'page=discographie&action=edition&file_code=' . $Albums->fileList[$i]['fileCode'] . '#' . $Albums->fileList[$i]['fileCode'];
162 } 139 }
163 140
164 // variables $css, $js et $content 141 // variables $css, $js et $content
@@ -174,6 +151,10 @@ function album($fileCode)
174 151
175 $Albums = new Album($page); 152 $Albums = new Album($page);
176 $Albums->getAllJSON(); 153 $Albums->getAllJSON();
154 if(!empty($Albums->fileList))
155 {
156 $Albums->fileList = array_reverse($Albums->fileList);
157 }
177 $Albums->fileCode = $fileCode; 158 $Albums->fileCode = $fileCode;
178 $Albums->readOne(); 159 $Albums->readOne();
179 160