[10.0.049] mise à jour gallery v2 dans v10 et non v9227

This commit is contained in:
fredtempez 2020-04-03 18:58:30 +02:00
parent 5b440c8700
commit c246020a79
1 changed files with 27 additions and 2 deletions

View File

@ -33,7 +33,7 @@ class common {
const TEMP_DIR = 'site/tmp/';
// Numéro de version
const ZWII_VERSION = '10.0.048';
const ZWII_VERSION = '10.0.049';
const ZWII_UPDATE_CHANNEL = "v10";
public static $actions = [];
@ -1108,7 +1108,7 @@ class common {
// Version 9.2.27
if($this->getData(['core', 'dataVersion']) < 9227) {
// Forcer la régénération du thème
if (file_exists(self::DATA_DIR.'theme.css') === false) {
if (file_exists(self::DATA_DIR.'theme.css')) {
unlink (self::DATA_DIR.'theme.css');
}
$this->setData(['core', 'dataVersion', 9227]);
@ -1116,6 +1116,31 @@ class common {
// Version 10.0.00
if($this->getData(['core', 'dataVersion']) < 10000) {
$this->setData(['config', 'faviconDark','faviconDark.ico']);
// Numérotation des galeries
$pageList = array();
foreach ($this->getHierarchy(null,null,null) as $parentKey=>$parentValue) {
$pageList [] = $parentKey;
foreach ($parentValue as $childKey) {
$pageList [] = $childKey;
}
}
// Parcourir toutes les pages
foreach ($pageList as $parentKey => $parent) {
//La page a une galerie
if ($this->getData(['page',$parent,'moduleId']) === 'gallery' ) {
// Parcourir les dossiers de la galerie
$tempData = $this->getData(['module', $parent]);
$i = 1;
foreach ($tempData as $galleryKey => $galleryItem) {
if ( $this->getdata(['module',$parent,$galleryKey,'config','sort']) === NULL) {
$this->setdata(['module',$parent,$galleryKey,'config','sort','SORT_ASC']);
}
if ( $this->getdata(['module',$parent,$galleryKey,'config','position']) === NULL) {
$this->setdata(['module',$parent,$galleryKey,'config','position',$i++]);
}
}
}
}
$this->setData(['core', 'dataVersion', 10000]);
}
}