forked from ZwiiCMS-Team/ZwiiCMS
initCss variable d'instance
This commit is contained in:
parent
e3744bf7d8
commit
3247e14a83
@ -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]);
|
||||
|
||||
|
@ -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 );
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user