[9.2.10] Modification des clés de galerie intégrée au core
This commit is contained in:
parent
b3d1f187c9
commit
ef481fc2de
@ -148,9 +148,6 @@ class common {
|
|||||||
if($this->data === []) {
|
if($this->data === []) {
|
||||||
$this->readData();
|
$this->readData();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mise à jour des données core
|
|
||||||
$this->update();
|
|
||||||
|
|
||||||
// Utilisateur connecté
|
// Utilisateur connecté
|
||||||
if($this->user === []) {
|
if($this->user === []) {
|
||||||
@ -219,6 +216,9 @@ class common {
|
|||||||
$this->url = $this->getData(['config', 'homePageId']);
|
$this->url = $this->getData(['config', 'homePageId']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mise à jour des données core
|
||||||
|
$this->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -960,8 +960,36 @@ class common {
|
|||||||
if($this->getData(['core', 'dataVersion']) < 9210) {
|
if($this->getData(['core', 'dataVersion']) < 9210) {
|
||||||
// Utile pour l'installation d'un backup sur un autre serveur
|
// Utile pour l'installation d'un backup sur un autre serveur
|
||||||
$this->setData(['core', 'baseUrl', str_replace('/','',helper::baseUrl(false,false)) ]);
|
$this->setData(['core', 'baseUrl', str_replace('/','',helper::baseUrl(false,false)) ]);
|
||||||
|
|
||||||
|
// Préparation des clés de légendes pour la v10
|
||||||
|
// Parcours des pages du site
|
||||||
|
foreach ($this->getHierarchy(null,null,null) as $parentKey => $parent) {
|
||||||
|
//La page a une galerie
|
||||||
|
if ($this->getData(['page',$parentKey,'moduleId']) === 'gallery' ) {
|
||||||
|
// Lire les données du module
|
||||||
|
$tempData = $this->getData(['module', $parentKey]);
|
||||||
|
// Parcourir les dossiers de la galerie
|
||||||
|
foreach ($tempData as $galleryKey => $galleryItem) {
|
||||||
|
foreach ($galleryItem as $legendKey => $legendValue) {
|
||||||
|
// Recherche la clé des légendes
|
||||||
|
if ($legendKey === 'legend') {
|
||||||
|
foreach ($legendValue as $itemKey=>$itemValue) {
|
||||||
|
// Ancien nom avec un point devant l'extension ?
|
||||||
|
if (strpos($itemKey,'.') > 0) {
|
||||||
|
// Créer une nouvelle clé
|
||||||
|
$this->setData(['module', $parentKey, $galleryKey, 'legend',str_replace('.','',$itemKey),$itemValue]);
|
||||||
|
// Supprimer la valeur
|
||||||
|
$this->deleteData(['module', $parentKey, $galleryKey, 'legend',$itemKey]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$this->setData(['core', 'dataVersion', 9210]);
|
$this->setData(['core', 'dataVersion', 9210]);
|
||||||
$this->saveData();
|
$this->saveData();
|
||||||
|
die();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -230,18 +230,6 @@ class gallery extends common {
|
|||||||
if(is_dir($directory)) {
|
if(is_dir($directory)) {
|
||||||
$iterator = new DirectoryIterator($directory);
|
$iterator = new DirectoryIterator($directory);
|
||||||
foreach($iterator as $fileInfos) {
|
foreach($iterator as $fileInfos) {
|
||||||
// Préparation des clés de légendes pour la v10
|
|
||||||
$data = $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'legend']);
|
|
||||||
foreach ($data as $itemKey=>$itemValue) {
|
|
||||||
// Ancien nom avec un point devant l'extension ?
|
|
||||||
if (strpos($itemKey,'.') > 0) {
|
|
||||||
// Créer une nouvelle clé
|
|
||||||
$this->setData(['module', $this->getUrl(0), $this->getUrl(1), 'legend',str_replace('.','',$itemKey),$itemValue]);
|
|
||||||
// Supprimer la valeur
|
|
||||||
$this->deleteData(['module', $this->getUrl(0), $this->getUrl(1), 'legend',$itemKey]);
|
|
||||||
}
|
|
||||||
$this->saveData();
|
|
||||||
}
|
|
||||||
if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) {
|
if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) {
|
||||||
self::$pictures[$directory . '/' . $fileInfos->getFilename()] = $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'legend', str_replace('.','',$fileInfos->getFilename())]);
|
self::$pictures[$directory . '/' . $fileInfos->getFilename()] = $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'legend', str_replace('.','',$fileInfos->getFilename())]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user