From 3247e14a83c65ca0e9464ff6f38d6b350f2a7e0b Mon Sep 17 00:00:00 2001 From: F Tempez Date: Wed, 7 Apr 2021 14:06:07 +0200 Subject: [PATCH] initCss variable d'instance --- module/gallery/gallery.php | 6 +++--- module/search/search.php | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/module/gallery/gallery.php b/module/gallery/gallery.php index e9138cdb..4bce7c20 100755 --- a/module/gallery/gallery.php +++ b/module/gallery/gallery.php @@ -175,7 +175,9 @@ class gallery extends common { * Initialisation du thème d'un nouveau module */ private function initCSS($moduleId) { + // Variable commune $fileCSS = self::DATADIRECTORY . $moduleId . '.css' ; + // Check la présence de la config if ( $this->getData(['module', $moduleId, 'config']) === null ) { require_once('module/gallery/ressource/defaultdata.php'); $this->setData(['module', $moduleId, 'config', [ @@ -197,14 +199,12 @@ class gallery extends common { 'versionData' => theme::$defaultData['versionData'] ]]); } + // Check la présence de la feuille de style if ( !file_exists(self::DATADIRECTORY . $moduleId . '.css')) { - // Variables génériques - // Dossier de l'instance if (!is_dir(self::DATADIRECTORY )) { mkdir (self::DATADIRECTORY, 0777, true); } - // Nom de la feuille de style $this->setData(['module', $moduleId, 'config', 'style', $fileCSS]); diff --git a/module/search/search.php b/module/search/search.php index ebaf52de..ae57e49c 100755 --- a/module/search/search.php +++ b/module/search/search.php @@ -85,7 +85,7 @@ class search extends common { // Sauver les données par défaut init::$defaultData['style'] = self::DATADIRECTORY . $moduleId . '.css'; - $this->setData(['module', $this->getUrl(0), 'config', init::$defaultData]); + $this->setData(['module', $moduleId, 'config', init::$defaultData]); $style = '.searchItem {background:' . $this->getData(['module', $moduleId, 'config', 'keywordColor']). ';}'; @@ -94,8 +94,6 @@ class search extends common { mkdir (self::DATADIRECTORY , 0777, true); } $success = file_put_contents(self::DATADIRECTORY . $moduleId . '.css' , $style ); - - } }