forked from ZwiiCMS-Team/ZwiiCMS
Initialisation des champs galerie version inférieure
This commit is contained in:
parent
c9ba833698
commit
79940a7393
@ -1090,6 +1090,43 @@ class common {
|
||||
$this->setData(['core', 'dataVersion', 9223]);
|
||||
$this->saveData();
|
||||
}
|
||||
// Version 9.3.00
|
||||
if($this->getData(['core', 'dataVersion']) < 9300) {
|
||||
// Numérotation des galeries
|
||||
// Lire toutes les pages et trouver celle avec le module gallery
|
||||
// Parcourir les galeries du modules
|
||||
// Verifier la présence des champs : sort et postion
|
||||
|
||||
// Tableau avec les pages
|
||||
$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', 9300]);
|
||||
$this->saveData();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user