From ba5cdb3debe95868447c7229a482aa4bab048ad1 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Thu, 1 Apr 2021 16:22:02 +0200 Subject: [PATCH] Revert "Inversion du test de version WIP" This reverts commit 0432eb65b611bbfecc791a7117011c22679d911e. --- module/blog/blog.php | 2 +- module/download/download.php | 2 +- module/news/news.php | 14 +++++--------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/module/blog/blog.php b/module/blog/blog.php index a8cf494d..7ab6c779 100755 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -115,7 +115,7 @@ class blog extends common { $this->setData(['module', $this->getUrl(0), 'config', 'version','4.5']); } // Version 5.0 - if (version_compare('5.0', $this->getData(['module', $this->getUrl(0), 'config', 'version']), '<') ) { + if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'version']), '5.0', '<') ) { $this->setData(['module', $this->getUrl(0), 'config', 'itemsperPage', 6]); $this->setData(['module', $this->getUrl(0), 'config', 'version','5.0']); } diff --git a/module/download/download.php b/module/download/download.php index b611e7c9..d0f7b133 100644 --- a/module/download/download.php +++ b/module/download/download.php @@ -128,7 +128,7 @@ class download extends common { $this->setData(['module', $this->getUrl(0), 'config', 'version','0.0']); } // Version 5.0 - if (version_compare('1.2', $this->getData(['module', $this->getUrl(0), 'config', 'version']), '<') ) { + if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'version']), '1.1', '<') ) { $this->setData(['module', $this->getUrl(0), 'config', 'itemsperPage', 6]); $this->setData(['module', $this->getUrl(0), 'config', 'version','1.2']); } diff --git a/module/news/news.php b/module/news/news.php index 98209547..9fed8b52 100755 --- a/module/news/news.php +++ b/module/news/news.php @@ -66,19 +66,15 @@ class news extends common { * Appelée par les fonctions index et config */ private function update() { - // Initialisation de la version + // Insitialisation de la version if ($this->getData(['module', $this->getUrl(0), 'config', 'version']) === NULL) { $this->setData(['module', $this->getUrl(0), 'config', 'version','0.0']); } // Version 3.0 - if (version_compare('3.0',$this->getData(['module', $this->getUrl(0), 'config', 'version']), '<') ) { - $this->setData(['module', $this->getUrl(0),'config', [ - 'itemsperPage' => 16, - 'itemsperCol'=> 6, - 'feeds' => $this->getData(['module', $this->getUrl(0), 'config','feeds']), - 'feedsLabel' => $this->getData(['module', $this->getUrl(0), 'config','feedsLabel']), - 'version' => '3.0' - ]]); + if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'version']), self::VERSION, '<') ) { + $this->setData(['module', $this->getUrl(0), 'config', 'itemsperPage', 16]); + $this->setData(['module', $this->getUrl(0), 'config', 'itemsperCol', 6]); + $this->setData(['module', $this->getUrl(0), 'config', 'version','3.0']); } }