diff --git a/core/class/layout.class.php b/core/class/layout.class.php index aff4259..0df3179 100644 --- a/core/class/layout.class.php +++ b/core/class/layout.class.php @@ -915,6 +915,10 @@ class layout extends common 'href' => helper::baseUrl() . 'course', 'help' => 'Cours' ]) . ''; + $leftItems .= '
  • ' . template::ico('brush', [ + 'help' => 'Thème', + 'href' => helper::baseUrl() . 'theme' + ]) . '
  • '; } // Liste des pages if ($this->getUser('group') >= self::GROUP_EDITOR) { @@ -1043,10 +1047,6 @@ class layout extends common ]) . ''; } if ($this->getUser('group') >= self::GROUP_ADMIN) { - $rightItems .= '
  • ' . template::ico('brush', [ - 'help' => 'Thème', - 'href' => helper::baseUrl() . 'theme' - ]) . '
  • '; $rightItems .= '
  • ' . template::ico('puzzle', [ 'help' => 'Modules', 'href' => helper::baseUrl() . 'plugin' diff --git a/core/class/router.class.php b/core/class/router.class.php index d8e1609..c724fe9 100644 --- a/core/class/router.class.php +++ b/core/class/router.class.php @@ -65,9 +65,9 @@ class core extends common chmod(self::DATA_DIR . 'custom.css', 0755); } // Crée le fichier de personnalisation - if (file_exists(self::DATA_DIR . 'theme.css') === false) { - file_put_contents(self::DATA_DIR . 'theme.css', ''); - chmod(self::DATA_DIR . 'theme.css', 0755); + if (file_exists(self::DATA_DIR . self::$siteContent . '/theme.css') === false) { + file_put_contents(self::DATA_DIR . self::$siteContent . '/theme.css', ''); + chmod(self::DATA_DIR . self::$siteContent . '/theme.css', 0755); } // Crée le fichier de personnalisation de l'administration if (file_exists(self::DATA_DIR . 'admin.css') === false) { @@ -76,7 +76,7 @@ class core extends common } // Check la version rafraichissement du theme - $cssVersion = preg_split('/\*+/', file_get_contents(self::DATA_DIR . 'theme.css')); + $cssVersion = preg_split('/\*+/', file_get_contents(self::DATA_DIR . self::$siteContent . '/theme.css')); if (empty($cssVersion[1]) or $cssVersion[1] !== md5(json_encode($this->getData(['theme'])))) { // Version $css = '/*' . md5(json_encode($this->getData(['theme']))) . '*/'; @@ -318,7 +318,7 @@ class core extends common file_put_contents(self::DATA_DIR . 'font/font.html', $fontFile); // Enregistre la personnalisation - file_put_contents(self::DATA_DIR . 'theme.css', $css); + file_put_contents(self::DATA_DIR . self::$siteContent . '/theme.css', $css); // Effacer le cache pour tenir compte de la couleur de fond TinyMCE header("Expires: Tue, 01 Jan 2000 00:00:00 GMT"); diff --git a/core/core.php b/core/core.php index f6b1f25..3e72ef5 100644 --- a/core/core.php +++ b/core/core.php @@ -220,7 +220,6 @@ class common 'course' => '', 'core' => '', 'font' => '', - 'theme' => '', 'user' => '', 'language' => '', 'profil' => '', @@ -231,6 +230,7 @@ class common private $contentFiles = [ 'page' => '', 'module' => '', + 'theme' => '', ]; public static $fontsWebSafe = [ diff --git a/core/layout/blank.php b/core/layout/blank.php index d93bfcd..faff2b1 100644 --- a/core/layout/blank.php +++ b/core/layout/blank.php @@ -14,7 +14,7 @@ showFonts(); ?> - + diff --git a/core/layout/light.php b/core/layout/light.php index f24879a..66d29cf 100644 --- a/core/layout/light.php +++ b/core/layout/light.php @@ -14,7 +14,7 @@ showFonts(); ?> - + diff --git a/core/layout/main.php b/core/layout/main.php index ca4be35..7a8d435 100644 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -14,7 +14,7 @@ showVendor(); ?> showFonts(); ?> - + getData(['page', $this->getUrl(0), 'moduleId']) === 'blog' diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 24802d2..95fc695 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -175,116 +175,6 @@ class init extends common ] ], 'user' => [], - 'theme' => [ - 'body' => [ - 'backgroundColor' => 'rgba(236, 239, 241, 1)', - 'image' => '', - 'imageAttachment' => 'scroll', - 'imageRepeat' => 'no-repeat', - 'imagePosition' => 'top center', - 'imageSize' => 'auto', - 'toTopbackgroundColor' => 'rgba(33, 34, 35, .8)', - 'toTopColor' => 'rgba(255, 255, 255, 1)' - ], - 'footer' => [ - 'backgroundColor' => 'rgba(255, 255, 255, 1)', - 'font' => 'georgia', - 'fontSize' => '.8em', - 'fontWeight' => 'normal', - 'height' => '5px', - 'loginLink' => true, - 'margin' => true, - 'position' => 'site', - 'textColor' => 'rgba(33, 34, 35, 1)', - 'copyrightPosition' => 'right', - 'copyrightAlign' => 'right', - 'text' => '

    Pied de page personnalisé

    ', - 'textPosition' => 'left', - 'textAlign' => 'left', - 'textTransform' => 'none', - 'socialsPosition' => 'center', - 'socialsAlign' => 'center', - 'displayVersion' => true, - 'displaySiteMap' => true, - 'displayCopyright' => false, - 'displayCookie' => false, - 'displayLegal' => false, - 'displaySearch' => false, - 'memberBar' => true, - 'template' => '3' - ], - 'header' => [ - 'backgroundColor' => 'rgba(32, 59, 82, 1)', - 'font' => 'arial', - 'fontSize' => '2em', - 'fontWeight' => 'normal', - 'height' => '150px', - 'image' => 'banniere960.jpg', - 'imagePosition' => 'center center', - 'imageRepeat' => 'no-repeat', - 'margin' => false, - 'position' => 'site', - 'textAlign' => 'center', - 'textColor' => 'rgba(255, 255, 255, 1)', - 'textHide' => false, - 'textTransform' => 'none', - 'linkHomePage' => true, - 'imageContainer' => 'auto', - 'tinyHidden' => true, - 'feature' => 'wallpaper', - 'featureContent' => '

    Bannière vide

    ', - 'width' => 'container' - ], - 'menu' => [ - 'backgroundColor' => 'rgba(32, 59, 82, 1)', - 'backgroundColorSub' => 'rgba(32, 59, 82, 1)', - 'font' => 'arial', - 'fontSize' => '1em', - 'fontWeight' => 'normal', - 'height' => '15px 10px', - 'loginLink' => false, - 'margin' => false, - 'position' => 'site-second', - 'textAlign' => 'left', - 'textColor' => 'rgba(255, 255, 255, 1)', - 'textTransform' => 'none', - 'fixed' => false, - 'activeColorAuto' => true, - 'activeColor' => 'rgba(255, 255, 255, 1)', - 'activeTextColor' => 'rgba(255, 255, 255, 1)', - 'radius' => '0px', - 'memberBar' => false, - 'burgerLogo' => '', - 'burgerContent' => 'title', - 'width' => 'container' - ], - 'site' => [ - 'backgroundColor' => 'rgba(255, 255, 255, 1)', - 'radius' => '0px', - 'shadow' => '0px 0px 0px', - 'width' => '960px' - ], - 'block' => [ - 'backgroundColor' => 'rgba(236, 239, 241, 1)', - 'borderColor' => 'rgba(236, 239, 241, 1)' - ], - 'text' => [ - 'font' => 'georgia', - 'fontSize' => '13px', - 'textColor' => 'rgba(33, 34, 35, 1)', - 'linkColor' => 'rgba(74, 105, 189, 1)' - ], - 'title' => [ - 'font' => 'arial', - 'fontWeight' => 'normal', - 'textColor' => 'rgba(74, 105, 189, 1)', - 'textTransform' => 'none' - ], - 'button' => [ - 'backgroundColor' => 'rgba(32, 59, 82, 1)' - ], - 'version' => 0 - ], 'admin' => [ 'backgroundColor' => 'rgba(255, 255, 255, 1)', 'fontText' => 'georgia', @@ -865,6 +755,116 @@ class init extends common 'js' => '' ] ], + 'theme' => [ + 'body' => [ + 'backgroundColor' => 'rgba(236, 239, 241, 1)', + 'image' => '', + 'imageAttachment' => 'scroll', + 'imageRepeat' => 'no-repeat', + 'imagePosition' => 'top center', + 'imageSize' => 'auto', + 'toTopbackgroundColor' => 'rgba(33, 34, 35, .8)', + 'toTopColor' => 'rgba(255, 255, 255, 1)' + ], + 'footer' => [ + 'backgroundColor' => 'rgba(255, 255, 255, 1)', + 'font' => 'georgia', + 'fontSize' => '.8em', + 'fontWeight' => 'normal', + 'height' => '5px', + 'loginLink' => true, + 'margin' => true, + 'position' => 'site', + 'textColor' => 'rgba(33, 34, 35, 1)', + 'copyrightPosition' => 'right', + 'copyrightAlign' => 'right', + 'text' => '

    Pied de page personnalisé

    ', + 'textPosition' => 'left', + 'textAlign' => 'left', + 'textTransform' => 'none', + 'socialsPosition' => 'center', + 'socialsAlign' => 'center', + 'displayVersion' => true, + 'displaySiteMap' => true, + 'displayCopyright' => false, + 'displayCookie' => false, + 'displayLegal' => false, + 'displaySearch' => false, + 'memberBar' => true, + 'template' => '3' + ], + 'header' => [ + 'backgroundColor' => 'rgba(32, 59, 82, 1)', + 'font' => 'arial', + 'fontSize' => '2em', + 'fontWeight' => 'normal', + 'height' => '150px', + 'image' => 'banniere960.jpg', + 'imagePosition' => 'center center', + 'imageRepeat' => 'no-repeat', + 'margin' => false, + 'position' => 'site', + 'textAlign' => 'center', + 'textColor' => 'rgba(255, 255, 255, 1)', + 'textHide' => false, + 'textTransform' => 'none', + 'linkHomePage' => true, + 'imageContainer' => 'auto', + 'tinyHidden' => true, + 'feature' => 'wallpaper', + 'featureContent' => '

    Bannière vide

    ', + 'width' => 'container' + ], + 'menu' => [ + 'backgroundColor' => 'rgba(32, 59, 82, 1)', + 'backgroundColorSub' => 'rgba(32, 59, 82, 1)', + 'font' => 'arial', + 'fontSize' => '1em', + 'fontWeight' => 'normal', + 'height' => '15px 10px', + 'loginLink' => false, + 'margin' => false, + 'position' => 'site-second', + 'textAlign' => 'left', + 'textColor' => 'rgba(255, 255, 255, 1)', + 'textTransform' => 'none', + 'fixed' => false, + 'activeColorAuto' => true, + 'activeColor' => 'rgba(255, 255, 255, 1)', + 'activeTextColor' => 'rgba(255, 255, 255, 1)', + 'radius' => '0px', + 'memberBar' => false, + 'burgerLogo' => '', + 'burgerContent' => 'title', + 'width' => 'container' + ], + 'site' => [ + 'backgroundColor' => 'rgba(255, 255, 255, 1)', + 'radius' => '0px', + 'shadow' => '0px 0px 0px', + 'width' => '960px' + ], + 'block' => [ + 'backgroundColor' => 'rgba(236, 239, 241, 1)', + 'borderColor' => 'rgba(236, 239, 241, 1)' + ], + 'text' => [ + 'font' => 'georgia', + 'fontSize' => '13px', + 'textColor' => 'rgba(33, 34, 35, 1)', + 'linkColor' => 'rgba(74, 105, 189, 1)' + ], + 'title' => [ + 'font' => 'arial', + 'fontWeight' => 'normal', + 'textColor' => 'rgba(74, 105, 189, 1)', + 'textTransform' => 'none' + ], + 'button' => [ + 'backgroundColor' => 'rgba(32, 59, 82, 1)' + ], + 'version' => 0 + ], 'module' => [ 'contact' => [ 'config' => [ @@ -1009,7 +1009,118 @@ class init extends common 'js' => '' ], ], - 'module' => [] + 'theme' => [ + 'body' => [ + 'backgroundColor' => 'rgba(236, 239, 241, 1)', + 'image' => '', + 'imageAttachment' => 'scroll', + 'imageRepeat' => 'no-repeat', + 'imagePosition' => 'top center', + 'imageSize' => 'auto', + 'toTopbackgroundColor' => 'rgba(33, 34, 35, .8)', + 'toTopColor' => 'rgba(255, 255, 255, 1)' + ], + 'footer' => [ + 'backgroundColor' => 'rgba(255, 255, 255, 1)', + 'font' => 'georgia', + 'fontSize' => '.8em', + 'fontWeight' => 'normal', + 'height' => '5px', + 'loginLink' => true, + 'margin' => true, + 'position' => 'site', + 'textColor' => 'rgba(33, 34, 35, 1)', + 'copyrightPosition' => 'right', + 'copyrightAlign' => 'right', + 'text' => '

    Pied de page personnalisé

    ', + 'textPosition' => 'left', + 'textAlign' => 'left', + 'textTransform' => 'none', + 'socialsPosition' => 'center', + 'socialsAlign' => 'center', + 'displayVersion' => true, + 'displaySiteMap' => true, + 'displayCopyright' => false, + 'displayCookie' => false, + 'displayLegal' => false, + 'displaySearch' => false, + 'memberBar' => true, + 'template' => '3' + ], + 'header' => [ + 'backgroundColor' => 'rgba(32, 59, 82, 1)', + 'font' => 'arial', + 'fontSize' => '2em', + 'fontWeight' => 'normal', + 'height' => '150px', + 'image' => 'banniere960.jpg', + 'imagePosition' => 'center center', + 'imageRepeat' => 'no-repeat', + 'margin' => false, + 'position' => 'site', + 'textAlign' => 'center', + 'textColor' => 'rgba(255, 255, 255, 1)', + 'textHide' => false, + 'textTransform' => 'none', + 'linkHomePage' => true, + 'imageContainer' => 'auto', + 'tinyHidden' => true, + 'feature' => 'wallpaper', + 'featureContent' => '

    Bannière vide

    ', + 'width' => 'container' + ], + 'menu' => [ + 'backgroundColor' => 'rgba(32, 59, 82, 1)', + 'backgroundColorSub' => 'rgba(32, 59, 82, 1)', + 'font' => 'arial', + 'fontSize' => '1em', + 'fontWeight' => 'normal', + 'height' => '15px 10px', + 'loginLink' => false, + 'margin' => false, + 'position' => 'site-second', + 'textAlign' => 'left', + 'textColor' => 'rgba(255, 255, 255, 1)', + 'textTransform' => 'none', + 'fixed' => false, + 'activeColorAuto' => true, + 'activeColor' => 'rgba(255, 255, 255, 1)', + 'activeTextColor' => 'rgba(255, 255, 255, 1)', + 'radius' => '0px', + 'memberBar' => false, + 'burgerLogo' => '', + 'burgerContent' => 'title', + 'width' => 'container' + ], + 'site' => [ + 'backgroundColor' => 'rgba(255, 255, 255, 1)', + 'radius' => '0px', + 'shadow' => '0px 0px 0px', + 'width' => '960px' + ], + 'block' => [ + 'backgroundColor' => 'rgba(236, 239, 241, 1)', + 'borderColor' => 'rgba(236, 239, 241, 1)' + ], + 'text' => [ + 'font' => 'georgia', + 'fontSize' => '13px', + 'textColor' => 'rgba(33, 34, 35, 1)', + 'linkColor' => 'rgba(74, 105, 189, 1)' + ], + 'title' => [ + 'font' => 'arial', + 'fontWeight' => 'normal', + 'textColor' => 'rgba(74, 105, 189, 1)', + 'textTransform' => 'none' + ], + 'button' => [ + 'backgroundColor' => 'rgba(32, 59, 82, 1)' + ], + 'version' => 0 + ], + 'module' => [ + ], ]; public static $courseContent = [ diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index fa0b537..b348ed4 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -1043,8 +1043,8 @@ class theme extends common // Archive de thème ? if ( file_exists(self::TEMP_DIR . $tempFolder . '/site/data/custom.css') - and file_exists(self::TEMP_DIR . $tempFolder . '/site/data/theme.css') - and file_exists(self::TEMP_DIR . $tempFolder . '/site/data/theme.json') + and file_exists(self::TEMP_DIR . $tempFolder . '/site/data/' . self::$siteContent . '/theme.css') + and file_exists(self::TEMP_DIR . $tempFolder . '/site/data/' . self::$siteContent . '/theme.json') ) { $modele = 'theme'; } @@ -1064,9 +1064,9 @@ class theme extends common // Un remplacement nécessite la régénération de la feuille de style if ( $c > 0 - and file_exists(self::DATA_DIR . 'theme.css') + and file_exists(self::DATA_DIR . self::$siteContent . 'theme.css') ) { - unlink(self::DATA_DIR . 'theme.css'); + unlink(self::DATA_DIR . self::$siteContent . 'theme.css'); } } if ($modele = 'admin') { @@ -1192,7 +1192,7 @@ class theme extends common break; case 'theme': $zip->addFile(self::DATA_DIR . 'theme.json', self::DATA_DIR . 'theme.json'); - $zip->addFile(self::DATA_DIR . 'theme.css', self::DATA_DIR . 'theme.css'); + $zip->addFile(self::DATA_DIR . self::$siteContent . 'theme.css', self::DATA_DIR . self::$siteContent . 'theme.css'); $zip->addFile(self::DATA_DIR . 'custom.css', self::DATA_DIR . 'custom.css'); // Traite l'image dans le body if ($this->getData(['theme', 'body', 'image']) !== '') { diff --git a/core/vendor/tinymce/init.js b/core/vendor/tinymce/init.js index ee74aeb..561268d 100644 --- a/core/vendor/tinymce/init.js +++ b/core/vendor/tinymce/init.js @@ -94,8 +94,8 @@ tinymce.init({ content_css: [ baseUrl + "core/layout/common.css", baseUrl + "core/vendor/tinymce/content.css", - baseUrl + "site/data/theme.css", - baseUrl + "site/data/custom.css" + baseUrl + "site/data/home/theme.css", + baseUrl + "site/data/home/custom.css" ], // Classe à ajouter à la balise body dans l'iframe body_class: "editorWysiwyg", @@ -277,7 +277,7 @@ tinymce.init({ content_css: [ baseUrl + "core/layout/common.css", baseUrl + "core/vendor/tinymce/content.css", - baseUrl + "site/data/theme.css", + baseUrl + "site/data/home/theme.css", baseUrl + "site/data/custom.css" ], // Classe à ajouter à la balise body dans l'iframe