From b97a68343ec5c4ff1fae25ff5dc41f1a2ce6a17f Mon Sep 17 00:00:00 2001 From: polo Date: Fri, 26 Nov 2021 04:29:10 +0100 Subject: =?UTF-8?q?disco=20modif/suppr=20d=C3=A9sordre?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/visitor.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'controller/visitor.php') 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() $title = "Mais qui est Melaine Favennec?"; // modèle - $Articles = new AllArticles($page_actuelle); - $Articles->makeFileList(); + $Articles = new Page($page_actuelle, 'html'); + + // récupération de toute la page dans $articles $articles = array_reverse($Articles->readAll()); // lourd // variables $css, $js, $header et $content @@ -53,9 +54,9 @@ function discoVisitor() $AllAlbums->makeFileList(); // contenu de tous les fichiers JSON (= tableau de chaines) - $albumsJSON = $AllAlbums->readAll(); + $albumsJSON = array_reverse($AllAlbums->readAll()); // noms des fichiers JSON - $albumNamesJSON = $AllAlbums->getFileList(); + $albumNamesJSON = $AllAlbums->fileList; // changer les chaines JSON en tableaux: titre, année, pochette $i = 0; @@ -74,9 +75,9 @@ function discoVisitor() array_multisort($annees, $albumsJSON); // on passe maintenant au contenu HTML - $AllAlbums->setFormat('html'); + $AllAlbums->format = 'html'; $AllAlbums->makeFileList(); - $albumNamesHTML = $AllAlbums->getFileList(); + $albumNamesHTML = $AllAlbums->fileList; // lien vers le HTML ou ancre? // pour chaque album, détecter le fichier html @@ -121,8 +122,7 @@ function album($albumCode, $albumName) $page_actuelle = 'discographie'; $title = $albumName; - //$Album = new OneArticle ($page_actuelle); - $album = OneArticle::readOneAlbum($albumCode); + $album = Album::readOneAlbum($albumCode); // simple, efficace // variables $css, $header et $content require('view/album.php'); -- cgit v1.2.3