From 29df6f1362745eabf4fbcaedf309eb63795152fa Mon Sep 17 00:00:00 2001 From: polo Date: Mon, 29 Nov 2021 03:25:19 +0100 Subject: discographie --- model/Page.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'model/Page.php') diff --git a/model/Page.php b/model/Page.php index e03efe1..63730d8 100644 --- a/model/Page.php +++ b/model/Page.php @@ -13,10 +13,9 @@ class Page // classe "objet" public $fileName = ''; // correspond à $_SESSION['nomFichier'] protected $time; // timestamp pour noms des fichiers créés - public function __construct($page, $format) + public function __construct($page) { $this->page = $page; - $this->format = $format; $this->time = time(); $this->makeFileList(); } @@ -39,6 +38,14 @@ class Page // classe "objet" } } + public function setFileName() + { + if(file_exists('data/' . $this->page . '/' . $this->format . '/' . $this->albumCode . '.' . $this->format)) + { + $this->fileName = 'data/' . $this->page . '/' . $this->format . '/' . $this->albumCode . '.' . $this->format; + } + } + // GET // SET @@ -48,7 +55,7 @@ class Page // classe "objet" // create public function create($content) { - $format = 'html'; + //$format = 'html'; // nommer les fichiers avec le timestamp pour: // - les trier par ordre chronologique @@ -65,7 +72,7 @@ class Page // classe "objet" public function readAll() { $i = 0; - $articles = array(); + $articles = []; foreach ($this->fileList as $oneFile) { $articles[$i] = file_get_contents($oneFile); -- cgit v1.2.3