Revert "Inversion du test de version WIP"

This reverts commit 0432eb65b6.
This commit is contained in:
Fred Tempez 2021-04-01 16:22:02 +02:00
parent 0432eb65b6
commit ba5cdb3deb
3 changed files with 7 additions and 11 deletions

View File

@ -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']);
}

View File

@ -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']);
}

View File

@ -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']);
}
}