From 90b3efeeb9d939303ff80b180725e06e2e57af79 Mon Sep 17 00:00:00 2001 From: polo Date: Thu, 13 Apr 2023 03:02:57 +0200 Subject: =?UTF-8?q?=C3=A9diteur=20page=20album?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/visitor.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'controller/visitor.php') 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() function pageArticlesSimplesVisitor(string $page, string $title, string $headerPaintedTitle) { // infos sur les fichiers $Articles->fileList - $Articles = new Article($page); + $Articles = new Article($page, $page); // données des dates //print_r($Articles->fileList[$i]['date']); @@ -115,14 +115,16 @@ function legalVisitor() } -// page plus complexe que les autres + +// page complexe avec albums et articles +// cas où on ne fait rien, même en en mode admin function discoVisitor() { - $page = "discographie"; + $page = $_GET['page']; $title = "Discographie"; // modèle - $Albums = new Album($page); + $Albums = new Album($page, $page); //var_dump($Albums->fileList); die(); // on récupère tout: JSON, HTML, noms et chemins des fichiers @@ -148,7 +150,7 @@ function discoVisitor() $avecLien[$i] = false; $linkDiscoChrono[$i] = 'noLinkChrono'; // pour le css } - $lienBoutonModif[$i] = 'page=discographie&action=edition&file_code=' . $Albums->fileList[$i]['fileCode'] . '#' . $Albums->fileList[$i]['fileCode']; + $lienBoutonModif[$i] = 'page=album&action=edition&file_code=' . $Albums->fileList[$i]['fileCode']; } // variables $css, $js et $content @@ -158,11 +160,11 @@ function discoVisitor() } // page d'un album -function album($fileCode) +function albumVisitor($fileCode) { - $page = 'discographie'; // = nom du dossier où sont les données + $page = $_GET['page']; + $Albums = new Album($page, 'discographie'); - $Albums = new Album($page); $Albums->getAllJSON(); if(!empty($Albums->fileList)) { @@ -174,6 +176,7 @@ function album($fileCode) $title = $Albums->oneAlbum['titre']; $album = $Albums->oneAlbum['HTMLcontent']; + // création des liens: menu déroulant et section principale for($i = 0; $i < $Albums->fileListCount; $i++) { if(file_exists('data/discographie/html/' . $Albums->fileList[$i]['fileCode'] . '.html')) -- cgit v1.2.3