From 760857159839a16f009f09fe50ef6aa758f6cb7a Mon Sep 17 00:00:00 2001 From: fredtempez Date: Tue, 19 Mar 2019 06:59:28 +0100 Subject: [PATCH] [9.0.08] footer font select --- .gitignore | 1 + core/core.php | 38 ++++++++++++++------- core/layout/common.css | 15 +------- core/module/theme/resource/custom.css | 12 +++---- core/module/theme/theme.php | 18 ++++++++-- core/module/theme/view/footer/footer.js.php | 5 +++ core/module/theme/view/footer/footer.php | 36 +++++++++++++++++-- core/module/theme/view/header/header.js.php | 1 - 8 files changed, 85 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index c0d959b4..0b6207dd 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ core/vendor/tinymce/link_list.json core/vendor/tinymce/link_list.json site/tmp/.htaccess core/vendor/tinymce/link_list.json +site/tmp/.htaccess diff --git a/core/core.php b/core/core.php index a1224583..1d53f85a 100644 --- a/core/core.php +++ b/core/core.php @@ -26,10 +26,10 @@ class common { const GROUP_MEMBER = 1; const GROUP_MODERATOR = 2; const GROUP_ADMIN = 3; - // Numéro de version de développement : + // Numéro de version de développement, ajouter dev: // Désactive l'update auto // Numéro de version stable - const ZWII_VERSION = '9.0.08.dev'; + const ZWII_VERSION = '9.0.08'; public static $actions = []; @@ -386,18 +386,22 @@ class common { ], 'footer' => [ 'backgroundColor' => 'rgba(255, 255, 255, 1)', + 'font' => 'Open+Sans', + 'fontSize' => '0.8em', + 'fontWeight' => 'normal', 'height' => '10px', 'loginLink' => true, 'margin' => false, 'position' => 'site', 'textColor' => 'rgba(33, 34, 35, 1)', - 'copyrightPosition' => 'center', - 'copyrightAlign' => 'center', + 'copyrightPosition' => 'right', + 'copyrightAlign' => 'right', 'text' => 'Pied de page personnalisé', 'textPosition' => 'left', - 'textAlign' => 'left', - 'socialsPosition' => 'right', - 'socialsAlign' => 'right' + 'textAlign' => 'left', + 'textTransform' => 'none', + 'socialsPosition' => 'center', + 'socialsAlign' => 'center' ], 'header' => [ 'backgroundColor' => 'rgba(255, 255, 255, 1)', @@ -1168,8 +1172,16 @@ class common { $this->deleteData(['config', 'social', 'googleplusId']); $this->setData(['core', 'dataVersion', 9001]); $this->SaveData(); - } - + } + // Version 9.0.08 + if($this->getData(['core', 'dataVersion']) < 9008) { + $this->setData(['theme', 'footer', 'textTransform','none']); + $this->setData(['theme', 'footer', 'fontWeight','normal']); + $this->setData(['theme', 'footer', 'fontSize','0.8em']); + $this->setData(['theme', 'footer', 'font','Open+Sans']); + $this->setData(['core', 'dataVersion', 9008]); + $this->SaveData(); + } } } @@ -1308,6 +1320,7 @@ class core extends common { if($this->getData(['theme', 'footer', 'margin'])) { $css .= 'footer{margin:0 20px 20px}'; } + $css .= 'footer span{color:' . $this->getData(['theme', 'footer', 'textColor']) . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'footer', 'font'])) . '",sans-serif;font-weight:' . $this->getData(['theme', 'footer', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'footer', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'footer', 'textTransform']) . '}'; $css .= 'footer{background-color:' . $colors['normal'] . ';color:' . $this->getData(['theme', 'footer', 'textColor']) . '}'; $css .= 'footer a{color:' . $this->getData(['theme', 'footer', 'textColor']) . '}'; $css .= 'footer .container > div{margin:' . $this->getData(['theme', 'footer', 'height']) . ' 0}'; @@ -1319,7 +1332,6 @@ class core extends common { file_put_contents('site/data/theme.css', $css); } } - /** * Auto-chargement des classes * @param string $className Nom de la classe à charger @@ -2105,8 +2117,8 @@ class layout extends common { */ public function showCopyright() { $items = '
'; - $items .= 'Motorisé par Zwii'; - $items .= ' | Plan du site'; + $items .= 'Motorisé par Zwii'; + $items .= ' | Plan du site'; if( ( $this->getData(['theme', 'footer', 'loginLink']) @@ -2134,7 +2146,7 @@ class layout extends common { */ public function showFooterText() { if($footerText = $this->getData(['theme', 'footer', 'text']) OR $this->getUrl(0) === 'theme') { - echo '
' . nl2br($footerText) . '
'; + echo '
' . nl2br($footerText) . '
'; } } diff --git a/core/layout/common.css b/core/layout/common.css index 4baa0b9b..b64c25bd 100755 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -473,27 +473,14 @@ body > footer { } footer { text-align: center; - font-size: .8em; padding: 10px 20px; - vertical-align:middle; + vertical-align:middle; } footer .col4 { vertical-align: middle; } -footer #footerSocials { - font-size: 1.0em; -} - -footer #footerSocials { - font-size: 1.0em; -} - -footer #footerCopyright, #footerText { - font-size: 0.8em; -} - footer #footerSocials span { color: #FFF; padding: 9px; diff --git a/core/module/theme/resource/custom.css b/core/module/theme/resource/custom.css index 4f292980..e9ab5288 100755 --- a/core/module/theme/resource/custom.css +++ b/core/module/theme/resource/custom.css @@ -8,7 +8,10 @@ */ -/* Grille du site */ +/* +* Grille du site +* Barres et page +*/ #contentleft { } #contentright { @@ -63,13 +66,6 @@ footer #footersiteCenter, #footerbodyCenter { footer #footersiteRight, #footerbodyRight { } -/* footer bloc de chaque élément */ -#footerText { -} -#footerSocials { -} -#footerCopyright { -} /** diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index a76a3168..94738aa2 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -89,6 +89,14 @@ class theme extends common { 'site' => 'Dans le site', 'body' => 'En dessous du site' ]; + public static $footerFontSizes = [ + '.8em' => 'Très petite', + '.9em' => 'Petite', + '1em' => 'Normale', + '1.1em' => 'Moyenne', + '1.2em' => 'Grande', + '1.3em' => 'Très grande' + ]; public static $headerFontSizes = [ '1.6em' => 'Très petite', '1.8em' => 'Petite', @@ -273,7 +281,11 @@ class theme extends common { 'textColor' => $this->getInput('themeFooterTextColor'), 'copyrightPosition' => $this->getInput('themeFooterCopyrightPosition'), 'textPosition' => $this->getInput('themeFooterTextPosition'), - 'socialsPosition' => $this->getInput('themeFooterSocialsPosition') + 'socialsPosition' => $this->getInput('themeFooterSocialsPosition'), + 'textTransform' => $this->getInput('themeFootererTextTransform'), + 'font' => $this->getInput('themeFooterFont'), + 'fontSize' => $this->getInput('themeFooterFontSize'), + 'fontWeight' => $this->getInput('themeFooterFontWeight') ]]); // Valeurs en sortie $this->addOutput([ @@ -301,6 +313,7 @@ class theme extends common { // Si une image est positionnée, l'arrière en transparent. $this->setData(['theme', 'header', [ 'backgroundColor' => $this->getInput('themeHeaderBackgroundColor'), + 'textTransform' => $this->getInput('themeHeaderTextTransform'), 'font' => $this->getInput('themeHeaderFont'), 'fontSize' => $this->getInput('themeHeaderFontSize'), 'fontWeight' => $this->getInput('themeHeaderFontWeight'), @@ -312,8 +325,7 @@ class theme extends common { 'position' => $this->getInput('themeHeaderPosition'), 'textAlign' => $this->getInput('themeHeaderTextAlign'), 'textColor' => $this->getInput('themeHeaderTextColor'), - 'textHide' => $this->getInput('themeHeaderTextHide', helper::FILTER_BOOLEAN), - 'textTransform' => $this->getInput('themeHeaderTextTransform'), + 'textHide' => $this->getInput('themeHeaderTextHide', helper::FILTER_BOOLEAN), 'linkHome' => $this->getInput('themeHeaderlinkHome',helper::FILTER_BOOLEAN), 'imageContainer' => $this->getInput('themeHeaderImageContainer') ]]); diff --git a/core/module/theme/view/footer/footer.js.php b/core/module/theme/view/footer/footer.js.php index 4b837cbf..93dfefec 100755 --- a/core/module/theme/view/footer/footer.js.php +++ b/core/module/theme/view/footer/footer.js.php @@ -15,6 +15,9 @@ * Aperçu en direct */ $("input, select").on("change", function() { + // Import des polices de caractères + var footerFont = $("#themeFooterFont").val(); + var css = "@import url('https://fonts.googleapis.com/css?family=" + footerFont + "');"; // Couleurs du pied de page var colors = core.colorVariants($("#themeFooterBackgroundColor").val()); var textColor = $("#themeFooterTextColor").val(); @@ -29,6 +32,8 @@ $("input, select").on("change", function() { css += "#footerSocials{text-align:" + $("#themeFooterSocialsAlign").val() + "}"; css += "#footerText{text-align:" + $("#themeFooterTextAlign").val() + "}"; css += "#footerCopyright{text-align:" + $("#themeFooterCopyrightAlign").val() + "}"; + // Taille, couleur, épaisseur et capitalisation du titre de la bannière + css += "footer span{color:" + $("#themeFooterTextColor").val() + ";font-family:'" + footerFont.replace(/\+/g, " ") + "',sans-serif;font-weight:" + $("#themeFooterFontWeight").val() + ";font-size:" + $("#themeFooterFontSize").val() + ";text-transform:" + $("#themeFooterTextTransform").val() + "}"; // Marge if($("#themeFooterMargin").is(":checked")) { css += 'footer{margin:0 20px 20px}'; diff --git a/core/module/theme/view/footer/footer.php b/core/module/theme/view/footer/footer.php index f072a0ff..1128d190 100755 --- a/core/module/theme/view/footer/footer.php +++ b/core/module/theme/view/footer/footer.php @@ -59,7 +59,40 @@
- +
+
+
+

Mise en forme du texte

+
+
+ 'Caractères', + 'selected' => $this->getData(['theme', 'footer', 'textTransform']) + ]); ?> +
+
+ 'Style', + 'selected' => $this->getData(['theme', 'footer', 'fontWeight']) + ]); ?> +
+
+ 'Taille', + 'selected' => $this->getData(['theme', 'footer', 'fontSize']) + ]); ?> +
+
+ 'Police', + 'selected' => $this->getData(['theme', 'footer', 'font']) + ]); ?> +
+ +
+
+
+
@@ -75,7 +108,6 @@
-
diff --git a/core/module/theme/view/header/header.js.php b/core/module/theme/view/header/header.js.php index a63a1c68..c5e40cdb 100755 --- a/core/module/theme/view/header/header.js.php +++ b/core/module/theme/view/header/header.js.php @@ -16,7 +16,6 @@ $("input, select").on("change", function() { // Import des polices de caractères var headerFont = $("#themeHeaderFont").val(); - var css = "@import url('https://fonts.googleapis.com/css?family=" + headerFont + "');"; // Adaptation aux média css += "@media (max-width: 767px) {header{height:" + $("#themeHeaderHeight").val() + "/2;line-height:" + $("#themeHeaderHeight").val() + "/2;}}";