diff --git a/module/gallery/gallery.php b/module/gallery/gallery.php index f66beb66..6f40ac7c 100644 --- a/module/gallery/gallery.php +++ b/module/gallery/gallery.php @@ -179,6 +179,11 @@ class gallery extends common { $versionData = $this->getData(['module',$this->getUrl(0),'config', 'versionData' ]); + // le module n'est pas initialisé + if ($versionData === NULL) { + $this->init(); + } + // Mise à jour 3.1 if (version_compare($versionData, '3.1', '<') ) { if (is_dir(self::DATADIRECTORY . 'pages/')) { @@ -313,9 +318,6 @@ class gallery extends common { // Mise à jour des données de module $this->update(); - // Initialisation d'un nouveau module - $this->init(); - //Affichage de la galerie triée $g = $this->getData(['module', $this->getUrl(0), 'content']); $p = helper::arrayCollumn(helper::arrayCollumn($g,'config'),'position'); @@ -599,9 +601,6 @@ class gallery extends common { // Mise à jour des données de module $this->update(); - // Initialisation d'un nouveau module - $this->init(); - // Images d'une galerie if($this->getUrl(1)) { // La galerie n'existe pas diff --git a/module/news/news.php b/module/news/news.php index 177e806d..5da4ed42 100755 --- a/module/news/news.php +++ b/module/news/news.php @@ -189,9 +189,6 @@ class news extends common { // Mise à jour des données de module $this->update(); - // Initialisation d'un nouveau module - $this->init(); - // Soumission du formulaire if($this->isPost()) { @@ -396,9 +393,6 @@ class news extends common { // Mise à jour des données de module $this->update(); - // Initialisation d'un nouveau module - $this->init(); - // Affichage d'un article if( $this->getUrl(1) @@ -502,19 +496,13 @@ class news extends common { */ private function update() { - // Créer la structure de configuration si absente - // Il n'existait aucun paramétrage dans les version précédentes - if ($this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) === NULL ) { - // Données config et theme absentes du précédent module - require_once('module/news/ressource/defaultdata.php'); - $this->setData(['module', $this->getUrl(0), 'config', init::$defaultData]); - // Données de thème - $this->setData(['module', $this->getUrl(0), 'theme', init::$defaultTheme]); - $this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . $this->getUrl(0) . '/theme.css' ]); - } - $versionData = $this->getData(['module',$this->getUrl(0),'config', 'versionData' ]); + // le module n'est pas initialisé + if ($versionData === NULL) { + $this->init(); + } + // Mise à jour 3.2 if (version_compare($versionData, '3.1', '<') ) { $this->setData(['module',$this->getUrl(0),'theme', 'itemsBlur', '0%' ]);