From 39e7dcd2f3d77aab46b3751348adb261901ff004 Mon Sep 17 00:00:00 2001 From: Deltacms Date: Mon, 26 Dec 2022 17:35:06 +0100 Subject: [PATCH] =?UTF-8?q?mise=20=C3=A0=20jour=20diverses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 1 + core/core.php | 46 ++++++++------ core/module/theme/lang/en/lex_theme.php | 12 ++-- core/module/theme/lang/fr/lex_theme.php | 12 ++-- core/module/theme/view/footer/footer.js.php | 68 +++++++++++++++------ 5 files changed, 91 insertions(+), 48 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 9b27808..7db88a9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ - Thème / bannière : nouvelle option : une bannière animée avec Swiper, - Configuration / connexion : nouvelle option permettant de dévoiler le mot de passe, - Corrections : + - Theme / footer : sélection du template sur une colonne et différents aperçus. ## Version 4.4.02 de Deltacms - Modifications : diff --git a/core/core.php b/core/core.php index b864bac..7c6e0cc 100644 --- a/core/core.php +++ b/core/core.php @@ -120,8 +120,7 @@ class common { 'tippy', 'zwiico', 'imagemap', - 'simplelightbox', - 'swiper' + 'simplelightbox' ], 'view' => '' ]; @@ -1419,21 +1418,26 @@ class common { * Affiche les blocs */ echo '
'; - if($this->getData(['theme', 'footer', 'textPosition']) === 'left') { $this->showFooterText(); } - if($this->getData(['theme', 'footer', 'socialsPosition']) === 'left') { $this->showSocials(); } - if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'left') {$this->showCopyright(); } + if($this->getData(['theme', 'footer', 'textPosition']) === 'left') { $this->showFooterText(true); } + if($this->getData(['theme', 'footer', 'socialsPosition']) === 'left') { $this->showSocials(true); } + if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'left') {$this->showCopyright(true); } echo '
'; echo '
'; - if($this->getData(['theme', 'footer', 'textPosition']) === 'center') { $this->showFooterText(); } - if($this->getData(['theme', 'footer', 'socialsPosition']) === 'center') { $this->showSocials(); } - if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'center') { $this->showCopyright(); } + if($this->getData(['theme', 'footer', 'textPosition']) === 'mcenter') { $this->showFooterText(true); } + if($this->getData(['theme', 'footer', 'socialsPosition']) === 'mcenter') { $this->showSocials(true); } + if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'mcenter') { $this->showCopyright(true); } echo '
'; echo '
'; - if($this->getData(['theme', 'footer', 'textPosition']) === 'right') { $this->showFooterText(); } - if($this->getData(['theme', 'footer', 'socialsPosition']) === 'right') { $this->showSocials(); } - if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'right') { $this->showCopyright(); } + if($this->getData(['theme', 'footer', 'textPosition']) === 'right') { $this->showFooterText(true); } + if($this->getData(['theme', 'footer', 'socialsPosition']) === 'right') { $this->showSocials(true); } + if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'right') { $this->showCopyright(true); } echo '
'; + + if($this->getData(['theme', 'footer', 'textPosition']) === 'hide') { $this->showFooterText(false); } + if($this->getData(['theme', 'footer', 'socialsPosition']) === 'hide') { $this->showSocials(false); } + if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'hide') { $this->showCopyright(false); } + // Fermeture du contenaire echo ''; echo ''; @@ -1442,18 +1446,22 @@ class common { /** * Affiche le texte du footer */ - private function showFooterText() { + private function showFooterText($visibility) { if($footerText = $this->getData(['theme', 'footer', 'text']) OR $this->getUrl(0) === 'theme') { - echo '
' . $footerText . '
'; + $style = ''; + if( $visibility === false ) $style = 'style="display: none;"'; + echo '
' . $footerText . '
'; } } /** * Affiche le copyright */ - private function showCopyright() { + private function showCopyright($visibility) { + $style = ''; + if( $visibility === false ) $style = 'style="display: none;"'; // Ouverture Bloc copyright - $items = '
'; + $items = '
'; $items .= ''; // Affichage de motorisé par $items .= 'getData(['config', 'social']) as $socialName => $socialId) { switch($socialName) { @@ -1574,7 +1582,9 @@ class common { } } if($socials !== '') { - echo '
' . $socials . '
'; + $style = ''; + if( $visibility === false ) $style = 'style="display: none;"'; + echo '
' . $socials . '
'; } } @@ -2146,6 +2156,8 @@ class common { echo ''; // Librairies $moduleId = $this->getData(['page', $this->getUrl(0), 'moduleId']); + // Ajout si bannière animée + if($this->getData(['theme', 'header', 'feature']) === 'swiper') $this->output['vendor'] = array_merge ( $this->output['vendor'] , array('swiper') ); foreach($this->output['vendor'] as $vendorName) { // Coeur if(file_exists('core/vendor/' . $vendorName . '/inc.json')) { diff --git a/core/module/theme/lang/en/lex_theme.php b/core/module/theme/lang/en/lex_theme.php index d5757f2..966551a 100644 --- a/core/module/theme/lang/en/lex_theme.php +++ b/core/module/theme/lang/en/lex_theme.php @@ -123,10 +123,10 @@ $text['core_theme_view']['footer'][43] = 'Alignment with content'; $text['core_theme_view']['footer'][44] = 'Fixed footer'; $text['core_theme_view']['footer'][45] = 'Customised content'; $text['core_theme_view']['footer'][46] = "{ - 4: {'hide' : 'Hidden', 'left' : 'Top', 'center' : 'Middle', 'right' : 'Bottom'} , - 3: {'hide': 'Hidden', 'left': 'Left', 'center': 'Center', 'right': 'Right'} , + 4: {'hide' : 'Hidden', 'left' : 'Top', 'mcenter' : 'Middle', 'right' : 'Bottom'} , + 3: {'hide': 'Hidden', 'left': 'Left', 'mcenter': 'Center', 'right': 'Right'} , 2: {'hide': 'Hidden', 'left': 'Left', 'right': 'Right'} , - 1: {'hide': 'Hidden', 'center': 'Display'} + 1: {'hide': 'Hidden', 'mcenter': 'Display'} }"; $text['core_theme_view']['header'][0] = 'Back'; $text['core_theme_view']['header'][1] = 'Help'; @@ -336,7 +336,7 @@ $containerWides = [ $footerblocks = [ 1 => [ 'hide' => 'Hidden', - 'center' => 'Center' ], + 'mcenter' => 'Center' ], 2 => [ 'hide' => 'Hidden', 'left' => 'Left', @@ -344,12 +344,12 @@ $footerblocks = [ 3 => [ 'hide' => 'Hidden', 'left' => 'Left', - 'center' => 'Center', + 'mcenter' => 'Center', 'right' => 'Right' ], 4 => [ 'hide' => 'Hidden', 'left' => 'Top', - 'center' => 'Middle', + 'mcenter' => 'Middle', 'right' => 'Bottom' ] ]; $fontWeights = [ diff --git a/core/module/theme/lang/fr/lex_theme.php b/core/module/theme/lang/fr/lex_theme.php index f581f46..8300cc0 100644 --- a/core/module/theme/lang/fr/lex_theme.php +++ b/core/module/theme/lang/fr/lex_theme.php @@ -123,10 +123,10 @@ $text['core_theme_view']['footer'][43] = 'Alignement avec le contenu'; $text['core_theme_view']['footer'][44] = 'Pied de page fixe'; $text['core_theme_view']['footer'][45] = 'Contenu personnalisé'; $text['core_theme_view']['footer'][46] = "{ - 4: {'hide' : 'Masqué', 'left' : 'En haut', 'center' : 'Au milieu', 'right' : 'En bas'} , - 3: {'hide': 'Masqué', 'left': 'A gauche', 'center': 'Au centre', 'right': 'A droite'} , + 4: {'hide' : 'Masqué', 'left' : 'En haut', 'mcenter' : 'Au milieu', 'right' : 'En bas'} , + 3: {'hide': 'Masqué', 'left': 'A gauche', 'mcenter': 'Au centre', 'right': 'A droite'} , 2: {'hide': 'Masqué', 'left': 'A gauche', 'right': 'A droite'} , - 1: {'hide': 'Masqué', 'center': 'Affiché'} + 1: {'hide': 'Masqué', 'mcenter': 'Affiché'} }"; $text['core_theme_view']['header'][0] = 'Retour'; $text['core_theme_view']['header'][1] = 'Aide'; @@ -335,7 +335,7 @@ $containerWides = [ $footerblocks = [ 1 => [ 'hide' => 'Masqué', - 'center' => 'Affiché' ], + 'mcenter' => 'Affiché' ], 2 => [ 'hide' => 'Masqué', 'left' => 'À gauche', @@ -343,12 +343,12 @@ $footerblocks = [ 3 => [ 'hide' => 'Masqué', 'left' => 'À gauche', - 'center' => 'Au centre', + 'mcenter' => 'Au centre', 'right' => 'À droite' ], 4 => [ 'hide' => 'Masqué', 'left' => 'En haut', - 'center' => 'Au milieu', + 'mcenter' => 'Au milieu', 'right' => 'En bas' ] ]; $fontWeights = [ diff --git a/core/module/theme/view/footer/footer.js.php b/core/module/theme/view/footer/footer.js.php index 87b4253..cd92927 100644 --- a/core/module/theme/view/footer/footer.js.php +++ b/core/module/theme/view/footer/footer.js.php @@ -14,6 +14,7 @@ * @copyright Copyright (C) 2018-2021, Frédéric Tempez */ + /** * Aperçu en direct */ @@ -75,7 +76,7 @@ $("input, select").on("change", function() { // Position dans les blocs // Bloc texte personnalisé -$(".themeFooterContent").on("change",function() { +$(".themeFooterContent, #themeFooterTextPosition, #themeFooterSocialsPosition, #themeFooterCopyrightPosition").on("change",function() { // Position site ou body var footerPosition = $("#themeFooterPosition").val(); switch($("#themeFooterTextPosition").val()) { @@ -85,7 +86,17 @@ $(".themeFooterContent").on("change",function() { default: // Choix de la position du bloc textPosition = $("#themeFooterTextPosition").val(); - textPosition = textPosition.substr(0,1).toUpperCase()+textPosition.substr(1); + switch( textPosition ){ + case "mcenter" : + textPosition = "Center"; + break; + case "left" : + textPosition = "Left"; + break; + case "right" : + textPosition = "Right"; + break; + } $("#footerText").show().appendTo("#footer" + footerPosition + textPosition); break; } @@ -96,7 +107,17 @@ $(".themeFooterContent").on("change",function() { default: // Choix de la position du bloc socialsPosition = $("#themeFooterSocialsPosition").val(); - socialsPosition = socialsPosition.substr(0,1).toUpperCase()+socialsPosition.substr(1); + switch( socialsPosition ){ + case "mcenter" : + socialsPosition = "Center"; + break; + case "left" : + socialsPosition = "Left"; + break; + case "right" : + socialsPosition = "Right"; + break; + } $("#footerSocials").show().appendTo("#footer" + footerPosition + socialsPosition); break; } @@ -107,14 +128,21 @@ $(".themeFooterContent").on("change",function() { default: // Choix de la position du bloc copyrightPosition = $("#themeFooterCopyrightPosition").val(); - copyrightPosition = copyrightPosition.substr(0,1).toUpperCase()+copyrightPosition.substr(1); + switch( copyrightPosition ){ + case "mcenter" : + copyrightPosition = "Center"; + break; + case "left" : + copyrightPosition = "Left"; + break; + case "right" : + copyrightPosition = "Right"; + break; + } $("#footerCopyright").show().appendTo("#footer" + footerPosition + copyrightPosition); break; } - - }).trigger("change"); - // Fin Position dans les blocs // Modification dynamique de la mise en page @@ -163,15 +191,16 @@ $("#themeFooterTemplate").on("change",function() { $("#themeFooterSocialsPosition").on("change", function() { if ($(this).prop('selectedIndex') >= 1 ) { if ( $("#themeFooterTextPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) { - $("#themeFooterTextPosition").prop('selectedIndex',0); + $("#themeFooterTextPosition").prop('selectedIndex',0); $("#footerText").hide(); } if ( $("#themeFooterCopyrightPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) { $("#themeFooterCopyrightPosition").prop('selectedIndex',0); $("#footerCopyright").hide(); } - } + } }).trigger("change"); + $("#themeFooterTextPosition").on("change", function() { if ($(this).prop('selectedIndex') >= 1 ) { if ( $("#themeFooterSocialsPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) { @@ -182,21 +211,22 @@ $("#themeFooterTextPosition").on("change", function() { $("#themeFooterCopyrightPosition").prop('selectedIndex',0); $("#footerCopyright").hide(); } - } + } }).trigger("change"); $("#themeFooterCopyrightPosition").on("change", function() { - if ($(this).prop('selectedIndex') >= 1 ) { - if ( $("#themeFooterTextPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) { - $("#themeFooterTextPosition").prop('selectedIndex',0); - $("#footerText").hide(); - } - if ( $("#themeFooterSocialsPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) { - $("#themeFooterSocialsPosition").prop('selectedIndex',0); - $("#footerSocials").hide(); - } + if ($(this).prop('selectedIndex') >= 1 ) { + if ( $("#themeFooterTextPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) { + $("#themeFooterTextPosition").prop('selectedIndex',0); + $("#footerText").hide(); } + if ( $("#themeFooterSocialsPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) { + $("#themeFooterSocialsPosition").prop('selectedIndex',0); + $("#footerSocials").hide(); + } + } }).trigger("change"); + // Affiche / Cache les options du footer fixe $("#themeFooterPosition").on("change", function() { if($(this).val() === 'body') {