summaryrefslogtreecommitdiff
path: root/controller/visitor.php
diff options
context:
space:
mode:
Diffstat (limited to 'controller/visitor.php')
-rw-r--r--controller/visitor.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/controller/visitor.php b/controller/visitor.php
index a5bf538..0e79ee2 100644
--- a/controller/visitor.php
+++ b/controller/visitor.php
@@ -33,8 +33,9 @@ function melaineVisitor()
33 $title = "Mais qui est Melaine Favennec?"; 33 $title = "Mais qui est Melaine Favennec?";
34 34
35 // modèle 35 // modèle
36 $Articles = new AllArticles($page_actuelle); 36 $Articles = new Page($page_actuelle, 'html');
37 $Articles->makeFileList(); 37
38 // récupération de toute la page dans $articles
38 $articles = array_reverse($Articles->readAll()); // lourd 39 $articles = array_reverse($Articles->readAll()); // lourd
39 40
40 // variables $css, $js, $header et $content 41 // variables $css, $js, $header et $content
@@ -53,9 +54,9 @@ function discoVisitor()
53 $AllAlbums->makeFileList(); 54 $AllAlbums->makeFileList();
54 55
55 // contenu de tous les fichiers JSON (= tableau de chaines) 56 // contenu de tous les fichiers JSON (= tableau de chaines)
56 $albumsJSON = $AllAlbums->readAll(); 57 $albumsJSON = array_reverse($AllAlbums->readAll());
57 // noms des fichiers JSON 58 // noms des fichiers JSON
58 $albumNamesJSON = $AllAlbums->getFileList(); 59 $albumNamesJSON = $AllAlbums->fileList;
59 60
60 // changer les chaines JSON en tableaux: titre, année, pochette 61 // changer les chaines JSON en tableaux: titre, année, pochette
61 $i = 0; 62 $i = 0;
@@ -74,9 +75,9 @@ function discoVisitor()
74 array_multisort($annees, $albumsJSON); 75 array_multisort($annees, $albumsJSON);
75 76
76 // on passe maintenant au contenu HTML 77 // on passe maintenant au contenu HTML
77 $AllAlbums->setFormat('html'); 78 $AllAlbums->format = 'html';
78 $AllAlbums->makeFileList(); 79 $AllAlbums->makeFileList();
79 $albumNamesHTML = $AllAlbums->getFileList(); 80 $albumNamesHTML = $AllAlbums->fileList;
80 81
81 // lien vers le HTML ou ancre? 82 // lien vers le HTML ou ancre?
82 // pour chaque album, détecter le fichier html 83 // pour chaque album, détecter le fichier html
@@ -121,8 +122,7 @@ function album($albumCode, $albumName)
121 $page_actuelle = 'discographie'; 122 $page_actuelle = 'discographie';
122 $title = $albumName; 123 $title = $albumName;
123 124
124 //$Album = new OneArticle ($page_actuelle); 125 $album = Album::readOneAlbum($albumCode); // simple, efficace
125 $album = OneArticle::readOneAlbum($albumCode);
126 126
127 // variables $css, $header et $content 127 // variables $css, $header et $content
128 require('view/album.php'); 128 require('view/album.php');