From 0432eb65b611bbfecc791a7117011c22679d911e Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Thu, 1 Apr 2021 14:48:51 +0200 Subject: [PATCH] Inversion du test de version WIP --- module/blog/blog.php | 2 +- module/download/download.php | 2 +- module/news/news.php | 14 +++++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/module/blog/blog.php b/module/blog/blog.php index 7ab6c779..a8cf494d 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($this->getData(['module', $this->getUrl(0), 'config', 'version']), '5.0', '<') ) { + if (version_compare('5.0', $this->getData(['module', $this->getUrl(0), 'config', 'version']), '<') ) { $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 d0f7b133..b611e7c9 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($this->getData(['module', $this->getUrl(0), 'config', 'version']), '1.1', '<') ) { + if (version_compare('1.2', $this->getData(['module', $this->getUrl(0), 'config', 'version']), '<') ) { $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 9fed8b52..98209547 100755 --- a/module/news/news.php +++ b/module/news/news.php @@ -66,15 +66,19 @@ class news extends common { * Appelée par les fonctions index et config */ private function update() { - // Insitialisation de la version + // Initialisation 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($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']); + 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' + ]]); } }