From 130ad549dd9dd80781e1ef184e28e0a4d641366f Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 19 Jun 2019 09:35:19 +0200 Subject: [PATCH] [9.1.13] en cours --- core/layout/common.css | 6 +- core/module/install/ressource/defaultdata.php | 2 +- core/module/theme/theme.php | 22 +++++-- core/module/theme/view/footer/footer.js.php | 64 +++++++++++++++---- core/module/theme/view/footer/footer.php | 19 ++++-- 5 files changed, 86 insertions(+), 27 deletions(-) diff --git a/core/layout/common.css b/core/layout/common.css index b63809e3..3bdbd0a2 100755 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -570,14 +570,12 @@ body > footer { } footer { padding: 1px 20px; - position: relative; } -footer > .container { - align-items: center; +#footersiteRight, #footersiteLeft, #footersiteCenter { + vertical-align: middle; } - #footerLoginLink, #footerDisplayCopyright, #footerDisplayVersion, diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 87ad8ff2..5b8e5a71 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -450,7 +450,7 @@ class install extends common { 'displayVersion' => true, 'displaySiteMap' => true, 'displayCopyright' => true, - 'template' => 3 + 'template' => '3' ], 'header' => [ 'backgroundColor' => 'rgba(255, 255, 255, 1)', diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 14ece0d3..d23cf572 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -68,11 +68,23 @@ class theme extends common { 'Vollkorn' => 'Vollkorn' ]; public static $footerblocks = [ - 'hide' => 'Masqué', - 'left' => 'Bloc Gauche', - 'center' => 'Bloc Central', - 'right' => 'Bloc Droite' + 1 => [ + 'hide' => 'Masqué', + 'center' => 'Affiché' + ] , 2 => [ + 'hide' => 'Masqué', + 'left' => 'Bloc Gauche', + 'right' => 'Bloc Droite' + ] , 3 => [ + 'hide' => 'Masqué', + 'left' => 'Bloc Gauche', + 'center' => 'Bloc Central', + 'right' => 'Bloc Droite' + ] + ]; + + public static $fontWeights = [ 'normal' => 'Maigre', 'bold' => 'Gras' @@ -296,7 +308,7 @@ class theme extends common { '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',helper::FILTER_INT) + 'template' => $this->getInput('themeFooterTemplate') ]]); // 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 f1277fd0..1046ba0f 100755 --- a/core/module/theme/view/footer/footer.js.php +++ b/core/module/theme/view/footer/footer.js.php @@ -118,22 +118,17 @@ $("#themeFooterForm").on("change",function() { break; } }).trigger("change"); -// Fin Position dans les blocs -// Liste de position dans les blocs - -//3 colonnes -var newOptions = { - 3: {'hide': 'Masqué', 'left': 'Bloc Gauche', 'center': 'Bloc Central', 'right': 'Bloc Droite'} , - 2: {'hide': 'Masqué', 'left': 'Bloc Gauche', 'right': 'Bloc Droite'} , - 1: {'hide': 'Masqué', 'center': 'Affiché'} -}; // Modification de la mise en page $("#themeFooterTemplate").on("change",function() { // Nettoyage des sélecteurs des contenus - + var newOptions = { + 3: {'hide': 'Masqué', 'left': 'Bloc Gauche', 'center': 'Bloc Central', 'right': 'Bloc Droite'} , + 2: {'hide': 'Masqué', 'left': 'Bloc Gauche', 'right': 'Bloc Droite'} , + 1: {'hide': 'Masqué', 'center': 'Affiché'} + }; var $el = $(".themeFooterPosition"); $el.empty(); // Eléments des position de contenus @@ -143,6 +138,7 @@ $("#themeFooterTemplate").on("change",function() { }); switch($("#themeFooterTemplate").val()) { case "1": + console.log("1"); $("#footersiteLeft").css("display", "none"); $("#footersiteCenter").css("display", ""); $("#footersiteRight").css("display", "none"); @@ -151,6 +147,7 @@ $("#themeFooterTemplate").on("change",function() { $("#footersiteCenter").addClass("col12"); break; case "2": + console.log("2"); $("#footersiteLeft").css("display", ""); $("#footersiteCenter").css("display", "none"); $("#footersiteRight").css("display", ""); @@ -160,7 +157,8 @@ $("#themeFooterTemplate").on("change",function() { $("#footersiteLeft").addClass('col6'); $("#footersiteRight").addClass('col6'); break; - case "3": + case "3": + console.log("3"); $("#footersiteLeft").css("display", ""); $("#footersiteCenter").css("display", ""); $("#footersiteRight").css("display", ""); @@ -175,6 +173,50 @@ $("#themeFooterTemplate").on("change",function() { } }); +// Affichage des options possibles +// $('#baba').prop('selectedIndex',0); +$("#themeFooterSocialsPosition").on("change", function() { + if ($("#themeFooterTemplate").val() === "1") { + if ($(this).prop('selectedIndex') === 1) { + $("#themeFooterTextPosition").prop('selectedIndex',0); + $("#themeFooterCopyrightPosition").prop('selectedIndex',0); + } + } + if ($("#themeFooterTemplate").val() === "2") { + if ($(this).prop('selectedIndex') === $(this)) { + $("#themeFooterTextPosition").prop('selectedIndex',0); + $("#themeFooterCopyrightPosition").prop('selectedIndex',0); + } + } +}); +$("#themeFooterTextPosition").on("change", function() { + if ($("#themeFooterTemplate").val() === "1") { + if ($(this).prop('selectedIndex') === 1) { + $("#themeFooterSocialsPosition").prop('selectedIndex',0); + $("#themeFooterCopyrightPosition").prop('selectedIndex',0); + } + } + if ($("#themeFooterTemplate").val() === "2") { + if ($(this).prop('selectedIndex') === $(this)) { + $("#themeFooterSocialsPosition").prop('selectedIndex',0); + $("#themeFooterCopyrightPosition").prop('selectedIndex',0); + } + } +}); +$("#themeFooterCopyrightPosition").on("change", function() { + if ($("#themeFooterTemplate").val() === "1") { + if ($(this).prop('selectedIndex') === 1) { + $("#themeFooterSocialsPosition").prop('selectedIndex',0); + $("#themeFooterTextPosition").prop('selectedIndex',0); + } + } + if ($("#themeFooterTemplate").val() === "2") { + if ($(this).prop('selectedIndex') === $(this)) { + $("#themeFooterSocialsPosition").prop('selectedIndex',0); + $("#themeFooterTextPosition").prop('selectedIndex',0); + } + } +}); diff --git a/core/module/theme/view/footer/footer.php b/core/module/theme/view/footer/footer.php index 378ef34a..a68eef10 100755 --- a/core/module/theme/view/footer/footer.php +++ b/core/module/theme/view/footer/footer.php @@ -100,6 +100,9 @@

Mise en page

+ getData(['theme', 'footer', 'template'])]; + ?> 'Nombre de colonnes', 'selected' => $this->getData(['theme', 'footer', 'template']), @@ -109,10 +112,12 @@
+

Contenu personnalisé texte ou HTML :

- 'Emplacement', - 'selected' => $this->getData(['theme', 'footer', 'textPosition']) + 'selected' => $this->getData(['theme', 'footer', 'textPosition']), + 'class' => 'themeFooterPosition' ]); ?> 'Alignement', @@ -121,9 +126,10 @@

Réseaux sociaux :

- 'Emplacement', - 'selected' => $this->getData(['theme', 'footer', 'socialsPosition']) + 'selected' => $this->getData(['theme', 'footer', 'socialsPosition']), + 'class' => 'themeFooterPosition' ]); ?> 'Alignement', @@ -132,9 +138,10 @@

Info et copyright :

- 'Emplacement', - 'selected' => $this->getData(['theme', 'footer', 'copyrightPosition']) + 'selected' => $this->getData(['theme', 'footer', 'copyrightPosition']), + 'class' => 'themeFooterPosition' ]); ?> 'Alignement',