diff --git a/CHANGES.md b/CHANGES.md index eb47161e..721f8914 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,13 +1,15 @@ # Changelog ## version 10.1.000 -- Nouveauté : +- Nouveautés : - Thème des écrans d'administration modifiable (configuration, utilisateurs : etc.) + - Thème du site : couleur de l'encadrement et la bordure des blocs. + - Thème du menu : couleur du texte de la page active - Corrections : - Configuration SMTP : sur-cryptage du mot de passe. - Quelques corrections liées à l'hébergeur Free. - Modification : - - Optimisation des opérations de disque, mis en cache en lecture des données de pages. Aucun cache en écriture. + - Optimisation des opérations de disque, mise en cache en lecture des données de pages. Aucun cache en écriture. - Mise à jour : - TinyMCE 4.9.10 diff --git a/core/core.php b/core/core.php index d3834e71..644043c4 100755 --- a/core/core.php +++ b/core/core.php @@ -173,8 +173,8 @@ class common { $this->user = $this->getData(['user', $this->getInput('ZWII_USER_ID')]); } - // Mise ne cache des pages - $this->page = $this->readPageCache(); + // Mise en cache des pages + $this->page = $this->getPageCache(); // Construit la liste des pages parents/enfants if($this->hierarchy['all'] === []) { @@ -435,7 +435,7 @@ class common { * Lecture des fichiers de données de page et mise ne cache * @param @return string données des pages */ - public function readPageCache() { + public function getPageCache() { // Trois tentatives for($i = 0; $i < 3; $i++) { $data =json_decode(file_get_contents(self::DATA_DIR.'fr/page.json'), true); @@ -443,7 +443,7 @@ class common { return($data); } elseif($i === 2) { - exit('Unable to read data file.'); + exit('Erreur fatale : impossible d\'accéder aux pages'); } // Pause de 10 millisecondes usleep(10000); @@ -1409,7 +1409,7 @@ class core extends common { // Icône BacktoTop $css .= '#backToTop {background-color:' .$this->getData(['theme', 'body', 'toTopbackgroundColor']). ';color:'.$this->getData(['theme', 'body', 'toTopColor']).';}'; // Site - $colors = helper::colorVariants($this->getData(['theme', 'text', 'linkTextColor'])); + $colors = helper::colorVariants($this->getData(['theme', 'text', 'linkColor'])); $css .= 'a{color:' . $colors['normal'] . '}'; $css .= 'a:hover{color:' . $colors['darken'] . '}'; $css .= 'body,.row > div{font-size:' . $this->getData(['theme', 'text', 'fontSize']) . '}'; @@ -1433,6 +1433,9 @@ class core extends common { $css .= '.button:active,button[type=\'submit\']:active,.pagination a:active{background-color:' . $colors['veryDarken'] . '}'; $colors = helper::colorVariants($this->getData(['theme', 'title', 'textColor'])); $css .= 'h1,h2,h3,h4,h5,h6{color:' . $colors['normal'] . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'title', 'font'])) . '",sans-serif;font-weight:' . $this->getData(['theme', 'title', 'fontWeight']) . ';text-transform:' . $this->getData(['theme', 'title', 'textTransform']) . '}'; + // Les blocs + $colors = helper::colorVariants($this->getData(['theme', 'block', 'backgroundColor'])); + $css .= '.block {border: 1px solid ' . $this->getdata(['theme','block','borderColor']) . ';}.block h4 {background:'. $colors['normal'] . ';color:' . $colors['text'] .';}'; // Bannière $colors = helper::colorVariants($this->getData(['theme', 'header', 'backgroundColor'])); if($this->getData(['theme', 'header', 'margin'])) { diff --git a/core/layout/common.css b/core/layout/common.css index a14be0cc..8ec57525 100755 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -829,7 +829,7 @@ footer #footerSocials .zwiico-github:hover { /* Bloc */ .block { - border: 1px solid #D8DFE3; +/* border: 1px solid #D8DFE3;*/ padding: 20px 20px 10px; margin: 20px 0; word-wrap: break-word; @@ -844,7 +844,7 @@ footer #footerSocials .zwiico-github:hover { .block h4 { margin: -20px -20px 10px -20px; padding: 10px; - background: #ECEFF1; +/* background: #ECEFF1;*/ } /* Aides */ diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 75be736a..df8b3dcd 100755 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -144,11 +144,15 @@ class init extends common { 'shadow' => '0', 'width' => '960px' ], + 'block' => [ + 'backgroundBlockColor' => 'rgba(236, 239, 241, 1)', + 'borderColor' => 'rgba(236, 239, 241, 1)' + ], 'text' => [ 'font' => 'Open+Sans', 'fontSize' => '13px', 'textColor' => 'rgba(33, 34, 35, 1)', - 'linkTextColor' => 'rgba(74, 105, 189, 1)' + 'linkColor' => 'rgba(74, 105, 189, 1)' ], 'title' => [ 'font' => 'Oswald', @@ -174,7 +178,7 @@ class init extends common { 'backgroundColorButtonRed' => 'rgba(231, 76, 60, 1)', 'backgroundColorButtonGreen' => 'rgba(57, 112, 12, 1)', 'backgroundBlockColor' => 'rgba(236, 239, 241, 1)', - 'borderBlockColor' => 'rgba(236, 239, 241, 1)', + 'borderBlockColor' => 'rgba(236, 239, 241, 1)' ], ]; diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 32cd0607..2c924a55 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -568,18 +568,22 @@ class theme extends common { 'font' => $this->getInput('themeTextFont'), 'fontSize' => $this->getInput('themeTextFontSize'), 'textColor' => $this->getInput('themeTextTextColor'), - 'linkTextColor'=> $this->getInput('themeTextLinkTextColor') + 'linkColor'=> $this->getInput('themeTextLinkColor') ]]); $this->setData(['theme', 'site', [ 'backgroundColor' => $this->getInput('themeSiteBackgroundColor'), 'radius' => $this->getInput('themeSiteRadius'), 'shadow' => $this->getInput('themeSiteShadow'), 'width' => $this->getInput('themeSiteWidth'), - 'margin' => $this->getInput('themeSiteMargin',helper::FILTER_BOOLEAN), + 'margin' => $this->getInput('themeSiteMargin',helper::FILTER_BOOLEAN) ]]); $this->setData(['theme', 'button', [ - 'backgroundColor' => $this->getInput('themeButtonBackgroundColor'), - ]]); + 'backgroundColor' => $this->getInput('themeButtonBackgroundColor') + ]]); + $this->setData(['theme', 'block', [ + 'backgroundColor' => $this->getInput('themeBlockBackgroundColor'), + 'borderColor' => $this->getInput('themeBlockBorderColor') + ]]); // Valeurs en sortie $this->addOutput([ 'notification' => 'Modifications enregistrées', diff --git a/core/module/theme/view/admin/admin.php b/core/module/theme/view/admin/admin.php index 6bc7e5f0..2b085452 100755 --- a/core/module/theme/view/admin/admin.php +++ b/core/module/theme/view/admin/admin.php @@ -8,13 +8,7 @@ 'value' => 'Retour' ]); ?> -
- helper::baseUrl() , - 'value' => 'Accueil' - ]); ?> -
-
+
'buttonRed', 'href' => helper::baseUrl() . 'theme/resetAdmin', diff --git a/core/module/theme/view/menu/menu.js.php b/core/module/theme/view/menu/menu.js.php index 481858dd..ee7e843e 100755 --- a/core/module/theme/view/menu/menu.js.php +++ b/core/module/theme/view/menu/menu.js.php @@ -51,7 +51,6 @@ $("input, select").on("change", function() { } else { css += "nav a:hover{background-color:" + $("#themeMenuActiveColor").val() + ";color:" + $('#themeMenuActiveTextColor').val() + ";}"; } - console.log(css); // Taille, hauteur, épaisseur et capitalisation de caractères du menu css += "#toggle span,#menu a{padding:" + $("#themeMenuHeight").val() + ";font-family:'" + menuFont.replace(/\+/g, " ") + "',sans-serif;font-weight:" + $("#themeMenuFontWeight").val() + ";font-size:" + $("#themeMenuFontSize").val() + ";text-transform:" + $("#themeMenuTextTransform").val() + "}"; // Alignement du menu diff --git a/core/module/theme/view/menu/menu.php b/core/module/theme/view/menu/menu.php index e74df07e..150c06a1 100755 --- a/core/module/theme/view/menu/menu.php +++ b/core/module/theme/view/menu/menu.php @@ -15,9 +15,9 @@
-

Couleurs

+

Couleur

-
+
'colorPicker', 'help' => 'Le curseur horizontal règle le niveau de transparence.', @@ -25,36 +25,43 @@ 'value' => $this->getData(['theme', 'menu', 'textColor']) ]); ?>
-
+
'colorPicker', 'help' => 'Le curseur horizontal règle le niveau de transparence.', 'label' => 'Fond', 'value' => $this->getData(['theme', 'menu', 'backgroundColor']) ]); ?> -
-
- 'colorPicker', - 'help' => 'Le curseur horizontal règle le niveau de transparence.', - 'label' => 'Texte page active', - 'value' => $this->getData(['theme', 'menu', 'activeTextColor']) - ]); ?> -
-
- $this->getData(['theme', 'menu', 'activeColorAuto']), - 'help' => 'La couleur de fond de la page active peut être définie automatique ou selon une couleur définie, comme par exemple celle de fond des pages.' - ]); ?> -
+
-
-
+
+
+
+
+
+
+

Page active

+
+
+ 'colorPicker', + 'help' => 'Le curseur horizontal règle le niveau de transparence.', + 'label' => 'Texte', + 'value' => $this->getData(['theme', 'menu', 'activeTextColor']) + ]); ?> +
+
+ $this->getData(['theme', 'menu', 'activeColorAuto']), + 'help' => 'La couleur de fond de la page active peut être définie automatique ou selon une couleur définie, comme par exemple celle de fond des pages.' + ]); ?> +
+
'colorPicker', 'help' => 'Couleur de fond de la page sélectionnée dans le menu.
Le curseur horizontal règle le niveau de transparence.', - 'label' => 'Fond active', + 'label' => 'Fond', 'value' => $this->getData(['theme', 'menu', 'activeColor']) ]); ?>
diff --git a/core/module/theme/view/site/site.js.php b/core/module/theme/view/site/site.js.php index 04945db6..4ad25d3e 100755 --- a/core/module/theme/view/site/site.js.php +++ b/core/module/theme/view/site/site.js.php @@ -14,13 +14,6 @@ * Chargement de l'aperçu */ $( document).ready(function() { - updateDOM(); -}); - -/** - * Aperçu en direct - */ -$("input, select").on("change",function() { /** * Option de marge si la taille n'est pas fluide */ @@ -30,77 +23,94 @@ $("input, select").on("change",function() { } else { $("#themeSiteMargin").addClass("enabled"); } - updateDOM(); + var backgroundImage = getData(['theme','body','image'])); ?>; + var backgroundcolor = getdata(['theme','body','backgroundColor'])); ?>; + css = "div.bodybackground{background-color:" + backgroundcolor + "; background-image: url(" + backgroundImage + ");background-size:cover;}"; + css += "div.bgPreview{padding: 5px;background-color:" + $("#themeSiteBackgroundColor").val() + ";}"; + $("#themePreview").remove(); + $("