diff options
Diffstat (limited to 'controller/visitor.php')
-rw-r--r-- | controller/visitor.php | 100 |
1 files changed, 69 insertions, 31 deletions
diff --git a/controller/visitor.php b/controller/visitor.php index f0dc877..aae15a7 100644 --- a/controller/visitor.php +++ b/controller/visitor.php | |||
@@ -7,7 +7,7 @@ | |||
7 | function accueil() | 7 | function accueil() |
8 | { | 8 | { |
9 | $title = "Bienvenue sur le site de Melaine Favennec"; | 9 | $title = "Bienvenue sur le site de Melaine Favennec"; |
10 | $page_actuelle = "accueil"; | 10 | $page = "accueil"; |
11 | $content = ''; | 11 | $content = ''; |
12 | 12 | ||
13 | // variables $js et $header | 13 | // variables $js et $header |
@@ -19,7 +19,7 @@ function accueil() | |||
19 | function menu() | 19 | function menu() |
20 | { | 20 | { |
21 | $title = "Melaine Favennec - menu BD"; | 21 | $title = "Melaine Favennec - menu BD"; |
22 | $page_actuelle = "menu"; | 22 | $page = "menu"; |
23 | 23 | ||
24 | // variables $css, $js, $header et $content | 24 | // variables $css, $js, $header et $content |
25 | require('view/menu.php'); | 25 | require('view/menu.php'); |
@@ -27,38 +27,91 @@ function menu() | |||
27 | require('view/template.php'); | 27 | require('view/template.php'); |
28 | } | 28 | } |
29 | 29 | ||
30 | function melaineVisitor() | 30 | // toutes celles du menu sauf: menu et discographie |
31 | function pageArticlesSimplesVisitor(string $page, string $title, string $headerPaintedTitle) | ||
31 | { | 32 | { |
32 | $page_actuelle = "melaine"; | 33 | $headerImage = '<div class="photo" id="photo_' . $page . '" ></div>'; |
33 | $title = "Mais qui est Melaine Favennec?"; | ||
34 | 34 | ||
35 | // infos sur les fichiers | 35 | // infos sur les fichiers $Articles->fileList |
36 | $Articles = new Article($page_actuelle); | 36 | $Articles = new Article($page); |
37 | 37 | ||
38 | // données des dates | 38 | // données des dates |
39 | //print_r($Articles->fileList[$i]['date']); | 39 | //print_r($Articles->fileList[$i]['date']); |
40 | //getdate($Albums->fileList[$i]['fileCode']); | 40 | //getdate($Albums->fileList[$i]['fileCode']); |
41 | 41 | ||
42 | // ajout des données dans $Articles->fileList['content'] | 42 | // si la page n'est pas vide |
43 | if(!empty($Articles->fileList)) | 43 | if(!empty($Articles->fileList)) |
44 | { | 44 | { |
45 | // données dans $Articles->fileList['content'] | ||
45 | $Articles->readAll(); | 46 | $Articles->readAll(); |
46 | $Articles->fileList = array_reverse($Articles->fileList); | 47 | $Articles->fileList = array_reverse($Articles->fileList); |
47 | } | 48 | } |
48 | 49 | ||
49 | // variables $css, $js, $header et $content | 50 | // variables $css, $js, $header et $content |
50 | require('view/melaine.php'); | 51 | require('view/pageArticlesSimples.php'); |
51 | // HTML | 52 | // HTML |
52 | require('view/template.php'); | 53 | require('view/template.php'); |
53 | } | 54 | } |
54 | 55 | ||
56 | function melaineVisitor() | ||
57 | { | ||
58 | $page = "melaine"; | ||
59 | $title = "Mais qui est Melaine Favennec?"; | ||
60 | $headerPaintedTitle = 'Melaine Favennec'; | ||
61 | pageArticlesSimplesVisitor($page, $title, $headerPaintedTitle); | ||
62 | } | ||
63 | function concertsVisitor() | ||
64 | { | ||
65 | $page = "concerts"; | ||
66 | $title = "Concerts"; | ||
67 | $headerPaintedTitle = 'Concerts'; | ||
68 | pageArticlesSimplesVisitor($page, $title, $headerPaintedTitle); | ||
69 | } | ||
70 | function presseVisitor() | ||
71 | { | ||
72 | $page = "presse"; | ||
73 | $title = "La presse"; | ||
74 | $headerPaintedTitle = 'La Presse'; | ||
75 | pageArticlesSimplesVisitor($page, $title, $headerPaintedTitle); | ||
76 | } | ||
77 | function ateliersVisitor() | ||
78 | { | ||
79 | $page = "ateliers"; | ||
80 | $title = "Ateliers"; | ||
81 | $headerPaintedTitle = 'Les ateliers de Melaine'; | ||
82 | pageArticlesSimplesVisitor($page, $title, $headerPaintedTitle); | ||
83 | } | ||
84 | function liensVisitor() | ||
85 | { | ||
86 | $page = "liens"; | ||
87 | $title = "Liens"; | ||
88 | $headerPaintedTitle = 'Liens'; | ||
89 | pageArticlesSimplesVisitor($page, $title, $headerPaintedTitle); | ||
90 | } | ||
91 | function peintureVisitor() | ||
92 | { | ||
93 | $page = "peinture"; | ||
94 | $title = "peinture"; | ||
95 | $headerPaintedTitle = 'Celtic Boats'; | ||
96 | pageArticlesSimplesVisitor($page, $title, $headerPaintedTitle); | ||
97 | } | ||
98 | function archivesVisitor() | ||
99 | { | ||
100 | $page = "archives"; | ||
101 | $title = "Archives"; | ||
102 | $headerPaintedTitle = 'Archives'; | ||
103 | pageArticlesSimplesVisitor($page, $title, $headerPaintedTitle); | ||
104 | } | ||
105 | |||
106 | |||
107 | // page plus complexe que les autres | ||
55 | function discoVisitor() | 108 | function discoVisitor() |
56 | { | 109 | { |
57 | $page_actuelle = "discographie"; | 110 | $page = "discographie"; |
58 | $title = "Discographie"; | 111 | $title = "Discographie"; |
59 | 112 | ||
60 | // modèle | 113 | // modèle |
61 | $Albums = new Album($page_actuelle); | 114 | $Albums = new Album($page); |
62 | //var_dump($Albums->fileList); die(); | 115 | //var_dump($Albums->fileList); die(); |
63 | 116 | ||
64 | // on récupère tout: JSON, HTML, noms et chemins des fichiers | 117 | // on récupère tout: JSON, HTML, noms et chemins des fichiers |
@@ -117,27 +170,27 @@ function discoVisitor() | |||
117 | // page d'un album | 170 | // page d'un album |
118 | function album($fileCode) | 171 | function album($fileCode) |
119 | { | 172 | { |
120 | $page_actuelle = 'discographie'; // ??? | 173 | $page = 'discographie'; // = nom du dossier où sont les données |
121 | 174 | ||
122 | $Albums = new Album($page_actuelle); | 175 | $Albums = new Album($page); |
123 | $Albums->getAllJSON(); | 176 | $Albums->getAllJSON(); |
124 | $Albums->fileCode = $fileCode; | 177 | $Albums->fileCode = $fileCode; |
125 | $Albums->readOne(); | 178 | $Albums->readOne(); |
126 | 179 | ||
127 | //var_dump($Albums); die(); | 180 | $title = $Albums->oneAlbum['titre']; |
128 | |||
129 | $album = $Albums->oneAlbum['HTMLcontent']; | 181 | $album = $Albums->oneAlbum['HTMLcontent']; |
130 | //$album = Album::readOneHTML($fileCode); | ||
131 | 182 | ||
132 | for($i = 0; $i < $Albums->fileListCount; $i++) | 183 | for($i = 0; $i < $Albums->fileListCount; $i++) |
133 | { | 184 | { |
134 | if(file_exists('data/discographie/html/' . $Albums->fileList[$i]['fileCode'] . '.html')) | 185 | if(file_exists('data/discographie/html/' . $Albums->fileList[$i]['fileCode'] . '.html')) |
135 | { | 186 | { |
136 | $lienAlbum[$i] = 'page=album&file_code=' . $Albums->fileList[$i]['fileCode']; | 187 | $lienAlbum[$i] = 'page=album&file_code=' . $Albums->fileList[$i]['fileCode']; |
188 | $linkDiscoChrono[$i] = 'linkChrono'; // pour le css | ||
137 | } | 189 | } |
138 | else | 190 | else |
139 | { | 191 | { |
140 | $lienAlbum[$i] = 'page=discographie#' . $Albums->fileList[$i]['titre']; | 192 | $lienAlbum[$i] = 'page=discographie#' . $Albums->fileList[$i]['titre']; |
193 | $linkDiscoChrono[$i] = 'noLinkChrono'; // pour le css | ||
141 | } | 194 | } |
142 | } | 195 | } |
143 | 196 | ||
@@ -146,18 +199,3 @@ function album($fileCode) | |||
146 | // HTML | 199 | // HTML |
147 | require('view/template.php'); | 200 | require('view/template.php'); |
148 | } | 201 | } |
149 | |||
150 | function presse() | ||
151 | {} | ||
152 | |||
153 | function ateliers() | ||
154 | {} | ||
155 | |||
156 | function liens() | ||
157 | {} | ||
158 | |||
159 | function peinture() | ||
160 | {} | ||
161 | |||
162 | function archives() | ||
163 | {} \ No newline at end of file | ||