Inversion du test de version WIP

This commit is contained in:
Fred Tempez 2021-04-01 14:48:51 +02:00
parent c8b16f2f25
commit 0432eb65b6
3 changed files with 11 additions and 7 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($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']);
}

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

View File

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