From cde0e525282929b323d619790796f05a3a6e7417 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sun, 11 Apr 2021 19:53:41 +0200 Subject: [PATCH] Gallery sample defalutdata --- core/module/install/ressource/defaultdata.php | 6 ++++-- module/gallery/gallery.php | 12 +++--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 9c0245c7..493744e5 100755 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -774,7 +774,7 @@ class init extends common { ] ], ], - 'config' => [ + 'theme' => [ 'thumbAlign' => 'center', 'thumbWidth' => '18em', 'thumbHeight' => '15em', @@ -789,9 +789,11 @@ class init extends common { 'legendAlign' => 'center', 'legendTextColor' => 'rgba(255, 255, 255, 1)', 'legendBgColor' => 'rgba(0, 0, 0, .6)', - 'versionData' => '3.0', 'style' => 'site/data/modules/gallery/galeries.css' ], + 'config' => [ + 'versionData' => '3.0' + ], ], 'site-de-zwii' => [ 'url' => 'https://zwiicms.fr/', diff --git a/module/gallery/gallery.php b/module/gallery/gallery.php index 2346ba3c..69f55f5b 100755 --- a/module/gallery/gallery.php +++ b/module/gallery/gallery.php @@ -149,6 +149,7 @@ class gallery extends common { */ private function update() { + // Mise à jour d'une version inférieure, la gallery existe mais pas content if ($this->getData(['module', $this->getUrl(0)]) && $this->getData(['module', $this->getUrl(0), 'content']) === NULL ) { @@ -172,9 +173,6 @@ class gallery extends common { $this->setData(['module', $this->getUrl(0), 'theme', $data]); // Nom de la feuille de style $this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . $moduleId . '.css']); - } else { - // Theme par défaut - $this->init($this->geturl(0)); } // Nouvelle version $this->setData(['module', $this->getUrl(0), 'config', 'versionData', '3.0']); @@ -301,9 +299,7 @@ class gallery extends common { $this->update(); // Initialisation d'un nouveau module - if ($this->getData(['module', $this->getUrl(0)]) === null) { - $this->init($this->getUrl(0)); - } + $this->init($this->getUrl(0)); //Affichage de la galerie triée $g = $this->getData(['module', $this->getUrl(0), 'content']); @@ -589,9 +585,7 @@ class gallery extends common { $this->update(); // Initialisation d'un nouveau module - if ($this->getData(['module', $this->getUrl(0)]) === null) { - $this->init($this->getUrl(0)); - } + $this->init($this->getUrl(0)); // Images d'une galerie if($this->getUrl(1)) {