From 2586da1d530b795d5b1141a50c5cc59f741eb1e7 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sat, 22 Jun 2019 08:23:09 +0200 Subject: [PATCH] [9.1.14] Corrections footer --- core/core.php | 8 +-- core/module/theme/theme.php | 69 ++++++++++++--------- core/module/theme/view/footer/footer.js.php | 12 ++-- 3 files changed, 50 insertions(+), 39 deletions(-) diff --git a/core/core.php b/core/core.php index 04a1bc76..6dff5d8c 100644 --- a/core/core.php +++ b/core/core.php @@ -32,7 +32,7 @@ class common { const TEMP_DIR = 'site/tmp/'; // Numéro de version - const ZWII_VERSION = '9.1.13'; + const ZWII_VERSION = '9.1.14.dev'; public static $actions = []; public static $coreModuleIds = [ @@ -1083,15 +1083,15 @@ class core extends common { // Pied de page $colors = helper::colorVariants($this->getData(['theme', 'footer', 'backgroundColor'])); if($this->getData(['theme', 'footer', 'margin'])) { - $css .= 'footer{margin:0 20px 20px;padding: 1px 20px;}'; + $css .= 'footer{margin:0 10px 10px;padding: 1px 10px;}'; } else { $css .= 'footer{margin:0;padding:0}'; } $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 > #footersiteLeft, #footersiteCenter, #footersiteRight {padding:' . $this->getData(['theme', 'footer', 'height']) . ' 0}'; - $css .= 'footer .container-large > #footersiteLeft, #footersiteCenter, #footersiteRight {padding:' . $this->getData(['theme', 'footer', 'height']) . ' 0}'; + //$css .= 'footer .container > div {padding:' . $this->getData(['theme', 'footer', 'height']) . ' 0}'; + $css .= '#footersiteLeft, #footersiteCenter, #footersiteRight {padding:' . $this->getData(['theme', 'footer', 'height']) . ' 0}'; $css .= '#footerSocials{text-align:' . $this->getData(['theme', 'footer', 'socialsAlign']) . '}'; $css .= '#footerText{text-align:' . $this->getData(['theme', 'footer', 'textAlign']) . '}'; $css .= '#footerCopyright{text-align:' . $this->getData(['theme', 'footer', 'copyrightAlign']) . '}'; diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 5e624cd5..f419ab83 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -284,35 +284,46 @@ class theme extends common { public function footer() { // Soumission du formulaire if($this->isPost()) { - $this->setData(['theme', 'footer', [ - 'backgroundColor' => $this->getInput('themeFooterBackgroundColor'), - 'copyrightAlign' => $this->getInput('themeFooterCopyrightAlign'), - 'height' => $this->getInput('themeFooterHeight'), - 'loginLink' => $this->getInput('themeFooterLoginLink'), - 'margin' => $this->getInput('themeFooterMargin', helper::FILTER_BOOLEAN), - 'position' => $this->getInput('themeFooterPosition'), - 'socialsAlign' => $this->getInput('themeFooterSocialsAlign'), - 'text' => $this->getInput('themeFooterText', null), - 'textAlign' => $this->getInput('themeFooterTextAlign'), - 'textColor' => $this->getInput('themeFooterTextColor'), - 'copyrightPosition' => $this->getInput('themeFooterCopyrightPosition'), - 'textPosition' => $this->getInput('themeFooterTextPosition'), - 'socialsPosition' => $this->getInput('themeFooterSocialsPosition'), - 'textTransform' => $this->getInput('themeFooterTextTransform'), - 'font' => $this->getInput('themeFooterFont'), - 'fontSize' => $this->getInput('themeFooterFontSize'), - 'fontWeight' => $this->getInput('themeFooterFontWeight'), - 'displayVersion' => $this->getInput('themefooterDisplayVersion', helper::FILTER_BOOLEAN), - 'displaySiteMap' => $this->getInput('themefooterDisplaySiteMap', helper::FILTER_BOOLEAN), - 'displayCopyright' => $this->getInput('themefooterDisplayCopyright', helper::FILTER_BOOLEAN), - 'template' => $this->getInput('themeFooterTemplate') - ]]); - // Valeurs en sortie - $this->addOutput([ - 'notification' => 'Modifications enregistrées', - 'redirect' => helper::baseUrl() . 'theme', - 'state' => true - ]); + if ( $this->getInput('themeFooterCopyrightPosition') === 'hide' && + $this->getInput('themeFooterSocialsPosition') === 'hide' && + $this->getInput('themeFooterTextPosition') === 'hide' ) { + // Valeurs en sortie + $this->addOutput([ + 'notification' => 'Sélectionnez au moment un contenu à afficher', + 'redirect' => helper::baseUrl() . 'theme/footer', + 'state' => false + ]); + } else { + $this->setData(['theme', 'footer', [ + 'backgroundColor' => $this->getInput('themeFooterBackgroundColor'), + 'copyrightAlign' => $this->getInput('themeFooterCopyrightAlign'), + 'height' => $this->getInput('themeFooterHeight'), + 'loginLink' => $this->getInput('themeFooterLoginLink'), + 'margin' => $this->getInput('themeFooterMargin', helper::FILTER_BOOLEAN), + 'position' => $this->getInput('themeFooterPosition'), + 'socialsAlign' => $this->getInput('themeFooterSocialsAlign'), + 'text' => $this->getInput('themeFooterText', null), + 'textAlign' => $this->getInput('themeFooterTextAlign'), + 'textColor' => $this->getInput('themeFooterTextColor'), + 'copyrightPosition' => $this->getInput('themeFooterCopyrightPosition'), + 'textPosition' => $this->getInput('themeFooterTextPosition'), + 'socialsPosition' => $this->getInput('themeFooterSocialsPosition'), + 'textTransform' => $this->getInput('themeFooterTextTransform'), + 'font' => $this->getInput('themeFooterFont'), + 'fontSize' => $this->getInput('themeFooterFontSize'), + 'fontWeight' => $this->getInput('themeFooterFontWeight'), + 'displayVersion' => $this->getInput('themefooterDisplayVersion', helper::FILTER_BOOLEAN), + 'displaySiteMap' => $this->getInput('themefooterDisplaySiteMap', helper::FILTER_BOOLEAN), + 'displayCopyright' => $this->getInput('themefooterDisplayCopyright', helper::FILTER_BOOLEAN), + 'template' => $this->getInput('themeFooterTemplate') + ]]); + // Valeurs en sortie + $this->addOutput([ + 'notification' => 'Modifications enregistrées', + 'redirect' => helper::baseUrl() . 'theme', + 'state' => true + ]); + } } // Valeurs en sortie $this->addOutput([ diff --git a/core/module/theme/view/footer/footer.js.php b/core/module/theme/view/footer/footer.js.php index 6b240d42..ae1f7707 100755 --- a/core/module/theme/view/footer/footer.js.php +++ b/core/module/theme/view/footer/footer.js.php @@ -25,9 +25,9 @@ $("input, select").on("change", function() { var css = "footer{background-color:" + colors.normal + ";color:" + textColor + "}"; css += "footer a{color:" + textColor + "}"; // Hauteur du pied de page - css += "footer .container > div{margin:" + $("#themeFooterHeight").val() + " 0}"; + css += "#footersiteLeft, #footersiteCenter, #footersiteRight {margin:" + $("#themeFooterHeight").val() + " 0}"; //css += "footer .container > div{padding:0}"; - css += "footer .container-large > div{margin:" + $("#themeFooterHeight").val() + " 0}"; + //css += "footer .container-large > div{margin:" + $("#themeFooterHeight").val() + " 0}"; //css += "footer .container-large > div{padding:0}"; // Alignement du contenu css += "#footerSocials{text-align:" + $("#themeFooterSocialsAlign").val() + "}"; @@ -37,7 +37,7 @@ $("input, select").on("change", function() { 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;padding: 1px 20px;}'; + css += 'footer{margin:0 10px 10px;padding: 1px 10px;}'; } else { css += 'footer{margin:0;padding:0}'; @@ -97,7 +97,7 @@ $(".themeFooterContent").on("change",function() { $("#footerSocials").show().appendTo("#footer" + position + "Right"); break; } - switch($("#themeFooterCopyrightPosition").val()) { + switch($("#themeFooterCopyrightPosition").val()) { case 'hide': $("#footerCopyright").hide(); break; @@ -112,6 +112,7 @@ $(".themeFooterContent").on("change",function() { break; } }).trigger("change"); + // Fin Position dans les blocs // Modification dynamique de la mise en page @@ -130,7 +131,7 @@ $("#themeFooterTemplate").on("change",function() { .attr("value", key).text(value)); }); var position = $("#themeFooterPosition").val(); - // Masquer le contenus + // Masquer les contenus $("#footerCopyright").hide(); $("#footerText").hide(); $("#footerSocials").hide(); @@ -184,7 +185,6 @@ $("#themeFooterSocialsPosition").on("change", function() { }).trigger("change"); $("#themeFooterTextPosition").on("change", function() { - if ($(this).prop('selectedIndex') >= 1 ) { if ( $("#themeFooterSocialsPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) { $("#themeFooterSocialsPosition").prop('selectedIndex',0);