From ef04457b2d2839cc07fac29844d676f72e0dcae5 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Tue, 18 Jun 2019 20:07:37 +0200 Subject: [PATCH 01/19] Vscodium --- .vscode/extensions.json | 13 +++++++++++++ .vscode/launch.json | 22 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/launch.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..fa68f7f9 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,13 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. + // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp + + // List of extensions which should be recommended for users of this workspace. + "recommendations": [ + + ], + // List of extensions recommended by VS Code that should not be recommended for users of this workspace. + "unwantedRecommendations": [ + + ] +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..2e67e845 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,22 @@ +{ + // Utilisez IntelliSense pour en savoir plus sur les attributs possibles. + // Pointez pour afficher la description des attributs existants. + // Pour plus d'informations, visitez : https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Listen for XDebug", + "type": "php", + "request": "launch", + "port": 9000 + }, + { + "name": "Launch currently open script", + "type": "php", + "request": "launch", + "program": "${file}", + "cwd": "${fileDirname}", + "port": 9000 + } + ] +} \ No newline at end of file From c164d819e98e7798e34e464b151588b08354309b Mon Sep 17 00:00:00 2001 From: fredtempez Date: Tue, 18 Jun 2019 20:08:04 +0200 Subject: [PATCH 02/19] [9.1.13.dev1] Nouveau footer WIP --- core/core.php | 8 ++- core/module/theme/theme.php | 9 ++- core/module/theme/view/footer/footer.js.php | 63 +++++++++++++++++++-- core/module/theme/view/footer/footer.php | 34 ++++++++--- 4 files changed, 98 insertions(+), 16 deletions(-) diff --git a/core/core.php b/core/core.php index 1236829b..d9bdebe4 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.12'; + const ZWII_VERSION = '9.1.13'; public static $actions = []; public static $coreModuleIds = [ @@ -919,6 +919,12 @@ class common { $this->setData(['core', 'dataVersion', 9100]); $this->SaveData(); } + // Version 9.1.13 + if($this->getData(['core', 'dataVersion']) < 9113) { + $this->setData(['theme','footer','template', 3 ]); + $this->setData(['core', 'dataVersion', 9113]); + $this->SaveData(); + } } } diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 495bd61b..9a664468 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -207,7 +207,11 @@ class theme extends common { 'auto auto' => 'Automatique', '100% 100%' => 'Image étirée' ]; - + public static $footerTemplate = [ + '1' => 'Pleine page (100%)', + '2' => 'Deux colonnes ( 1/2 - 1/2)', + '3' => 'Trois colonnes (1/3 - 1/3 - 1/3)' + ]; /** * Mode avancé @@ -304,7 +308,8 @@ class theme extends common { $this->addOutput([ 'title' => 'Personnalisation du pied de page', 'vendor' => [ - 'tinycolorpicker' + 'tinycolorpicker', + 'tinymce' ], 'view' => 'footer' ]); diff --git a/core/module/theme/view/footer/footer.js.php b/core/module/theme/view/footer/footer.js.php index 45b26937..d6f32aae 100755 --- a/core/module/theme/view/footer/footer.js.php +++ b/core/module/theme/view/footer/footer.js.php @@ -67,18 +67,18 @@ $("input, select").on("change", function() { // Bloc texte personnalisé $("#themeFooterForm").on("change",function() { switch($("#themeFooterTextPosition").val()) { - case 'hide': + case "hide": $("#footerText").hide(); break; - case 'left': + case "left": $("#footerText").show().appendTo("#footerbodyLeft"); $("#footerText").show().appendTo("#footersiteLeft"); break; - case 'center': + case "center": $("#footerText").show().appendTo("#footerbodyCenter"); $("#footerText").show().appendTo("#footersiteCenter"); break; - case 'right': + case "right": $("#footerText").show().appendTo("#footerbodyRight"); $("#footerText").show().appendTo("#footersiteRight"); break; @@ -120,6 +120,61 @@ $("#themeFooterForm").on("change",function() { }).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 $el = $(".themeFooterPosition"); + $el.empty(); + // Eléments des position de contenus + $.each(newOptions[$("#themeFooterTemplate").val()], function(key,value) { + $el.append($("") + .attr("value", key).text(value)); + }); + switch($("#themeFooterTemplate").val()) { + case "1": + $("#footersiteLeft").css("display", "none"); + $("#footersiteCenter").css("display", ""); + $("#footersiteRight").css("display", "none"); + // Dimension du bloc + $("#footersiteCenter").removeAttr('class');; + $("#footersiteCenter").addClass("col12"); + break; + case "2": + $("#footersiteLeft").css("display", ""); + $("#footersiteCenter").css("display", "none"); + $("#footersiteRight").css("display", ""); + // Dimension de blocs + $("#footersiteLeft").removeAttr('class'); + $("#footersiteRight").removeAttr('class'); + $("#footersiteLeft").addClass('col6'); + $("#footersiteRight").addClass('col6'); + break; + case "3": + $("#footersiteLeft").css("display", ""); + $("#footersiteCenter").css("display", ""); + $("#footersiteRight").css("display", ""); + // Dimensions des blocs + $("#footersiteLeft").removeAttr('class'); + $("#footersiteRight").removeAttr('class'); + $("#footersitecenter").removeAttr('class'); + $("#footersiteLeft").addClass('col4'); + $("#footersiteCenter").addClass('col4'); + $("#footersiteRight").addClass('col4'); + break; + } +}); + diff --git a/core/module/theme/view/footer/footer.php b/core/module/theme/view/footer/footer.php index 56cd37f3..80537e7c 100755 --- a/core/module/theme/view/footer/footer.php +++ b/core/module/theme/view/footer/footer.php @@ -15,7 +15,7 @@
-

Couleur

+

Couleurs

+
+
+
+

Mise en page

+ 'Nombre de colonnes', + 'selected' => $this->getData(['theme', 'footer', 'template']), + 'help' => 'Le changement de la mise en page entraîne la réinitalisation de la position des contenus.' + ]); ?> +
+
+

Contenu personnalisé

'Contenu (texte ou HTML)', - 'value' => $this->getData(['theme', 'footer', 'text']) + //'label' => 'Contenu (texte ou HTML)', + 'value' => $this->getData(['theme', 'footer', 'text']), + 'class' => 'editorWysiwyg' ]); ?>
@@ -110,7 +123,8 @@

Contenu personnalisé

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

Réseaux sociaux

+

Contenu réseaux sociaux

'Emplacement', - 'selected' => $this->getData(['theme', 'footer', 'socialsPosition']) + 'selected' => $this->getData(['theme', 'footer', 'socialsPosition']), + 'class' => 'themeFooterPosition' ]); ?> 'Alignement horizontal', @@ -136,12 +151,13 @@
-

Copyright

+

Contenu copyright

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

Afficher les éléments suivants :

+

Insérer les éléments suivants :

$this->getData(['theme', 'footer','displayCopyright']) From b1aa2df3d74efc62decbf694b4793126e6a82d21 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Tue, 18 Jun 2019 23:29:42 +0200 Subject: [PATCH 03/19] =?UTF-8?q?[9.1.13]=20nouveau=20footer=20=C3=A0=20te?= =?UTF-8?q?ster?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 116 ++++++++-------- core/layout/common.css | 7 +- core/layout/main.php | 155 ++++++++------------- core/module/theme/theme.php | 3 +- core/module/theme/view/footer/footer.php | 168 ++++++++++++----------- 5 files changed, 207 insertions(+), 242 deletions(-) diff --git a/core/core.php b/core/core.php index d9bdebe4..f3f81b86 100644 --- a/core/core.php +++ b/core/core.php @@ -1922,6 +1922,15 @@ class layout extends common { } } + /** + * Affiche le texte du footer + */ + public function showFooterText() { + if($footerText = $this->getData(['theme', 'footer', 'text']) OR $this->getUrl(0) === 'theme') { + echo '
' . nl2br($footerText) . '
'; + } + } + /** * Affiche le copyright */ @@ -1963,7 +1972,57 @@ class layout extends common { // Fermeture du bloc copyright $items .= '
'; echo $items; - } + } + + + /** + * Affiche les réseaux sociaux + */ + public function showSocials() { + $socials = ''; + foreach($this->getData(['config', 'social']) as $socialName => $socialId) { + switch($socialName) { + case 'facebookId': + $socialUrl = 'https://www.facebook.com/'; + $title = 'Facebook'; + break; + case 'linkedinId': + $socialUrl = 'https://fr.linkedin.com/in/'; + $title = 'Linkedin'; + break; + case 'instagramId': + $socialUrl = 'https://www.instagram.com/'; + $title = 'Instagram'; + break; + case 'pinterestId': + $socialUrl = 'https://pinterest.com/'; + $title = 'Pinterest'; + break; + case 'twitterId': + $socialUrl = 'https://twitter.com/'; + $title = 'Twitter'; + break; + case 'youtubeId': + $socialUrl = 'https://www.youtube.com/channel/'; + $title = 'YouTube'; + break; + case 'githubId': + $socialUrl = 'https://www.github.com/'; + $title = 'Github'; + break; + default: + $socialUrl = ''; + } + if($socialId !== '') { + $socials .= '' . template::ico(substr($socialName, 0, -2)) . ''; + } + } + if($socials !== '') { + echo '
' . $socials . '
'; + } + } + + /** * Affiche le favicon @@ -1979,14 +2038,6 @@ class layout extends common { } } - /** - * Affiche le texte du footer - */ - public function showFooterText() { - if($footerText = $this->getData(['theme', 'footer', 'text']) OR $this->getUrl(0) === 'theme') { - echo '
' . nl2br($footerText) . '
'; - } - } /** * Affiche le menu @@ -2387,53 +2438,6 @@ class layout extends common { } } - /** - * Affiche les réseaux sociaux - */ - public function showSocials() { - $socials = ''; - foreach($this->getData(['config', 'social']) as $socialName => $socialId) { - switch($socialName) { - case 'facebookId': - $socialUrl = 'https://www.facebook.com/'; - $title = 'Facebook'; - break; - case 'linkedinId': - $socialUrl = 'https://fr.linkedin.com/in/'; - $title = 'Linkedin'; - break; - case 'instagramId': - $socialUrl = 'https://www.instagram.com/'; - $title = 'Instagram'; - break; - case 'pinterestId': - $socialUrl = 'https://pinterest.com/'; - $title = 'Pinterest'; - break; - case 'twitterId': - $socialUrl = 'https://twitter.com/'; - $title = 'Twitter'; - break; - case 'youtubeId': - $socialUrl = 'https://www.youtube.com/channel/'; - $title = 'YouTube'; - break; - case 'githubId': - $socialUrl = 'https://www.github.com/'; - $title = 'Github'; - break; - default: - $socialUrl = ''; - } - if($socialId !== '') { - $socials .= '' . template::ico(substr($socialName, 0, -2)) . ''; - } - } - if($socials !== '') { - echo '
' . $socials . '
'; - } - } - /** * Affiche l'import des librairies */ diff --git a/core/layout/common.css b/core/layout/common.css index 7d5bf275..dfe612e4 100755 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -565,14 +565,17 @@ section:after { } /* Pied de page */ +footer { + padding: 1px 20px; +} body > footer { margin: 0 -10px; } -footer { - padding: 1px 20px; +#footersiteLeft, #footersiteCenter, #footersiteRight { vertical-align: middle; } + #footerLoginLink, #footerDisplayCopyright, #footerDisplayVersion, diff --git a/core/layout/main.php b/core/layout/main.php index 8955d3b1..39c5cc4f 100755 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -196,117 +196,70 @@ ?> - getData(['theme', 'footer', 'position']) === 'site' // Affiche toujours le pied de page pour l'édition du thème OR ( $this->getData(['theme', 'footer', 'position']) === 'hide' AND $this->getUrl(0) === 'theme' ) - ): ?> - - -
getData(['theme', 'footer', 'position']) === 'hide'): ?>class="displayNone"> + ) { $position = 'site'; } else { + $position = 'body'; + echo '
'; + } + ?> + +
getData(['theme', 'footer', 'position']) === 'hide'): ?>class="displayNone"> +
-
-
- getData(['theme', 'footer', 'textPosition']) === 'left') { - $layout->showFooterText();} - ?> - getData(['theme', 'footer', 'socialsPosition']) === 'left') { - $layout->showSocials(); } - ?> - getData(['theme', 'footer', 'copyrightPosition']) === 'left') { - $layout->showCopyright(); } - ?> -
-
- getData(['theme', 'footer', 'textPosition']) === 'center') { - $layout->showFooterText(); } - ?> - getData(['theme', 'footer', 'socialsPosition']) === 'center') { - $layout->showSocials(); } - ?> - getData(['theme', 'footer', 'copyrightPosition']) === 'center') { - $layout->showCopyright(); } - ?> -
-
- getData(['theme', 'footer', 'textPosition']) === 'right') { - $layout->showFooterText(); } - ?> - getData(['theme', 'footer', 'socialsPosition']) === 'right') { - $layout->showSocials(); } - ?> - getData(['theme', 'footer', 'copyrightPosition']) === 'right') { - $layout->showCopyright(); } - ?> -
-
-
-
- -
-getData(['theme', 'footer', 'position']) === 'body'): ?> - -
-
-
-
- getData(['theme', 'footer', 'textPosition']) === 'left') { - $layout->showFooterText(); } - ?> - getData(['theme', 'footer', 'socialsPosition']) === 'left') { - $layout->showSocials(); } - ?> - getData(['theme', 'footer', 'copyrightPosition']) === 'left') { - $layout->showCopyright(); } - ?> -
-
- getData(['theme', 'footer', 'textPosition']) === 'center') { - $layout->showFooterText(); } - ?> - getData(['theme', 'footer', 'socialsPosition']) === 'center') { - $layout->showSocials(); } - ?> - getData(['theme', 'footer', 'copyrightPosition']) === 'center') { - $layout->showCopyright(); } - ?> -
-
- getData(['theme', 'footer', 'textPosition']) === 'right') { - $layout->showFooterText(); } - ?> - getData(['theme', 'footer', 'socialsPosition']) === 'right') { - $layout->showSocials(); } - ?> - getData(['theme', 'footer', 'copyrightPosition']) === 'right') { - $layout->showCopyright();} - ?> -
+ +
+ + + getData(['theme', 'footer', 'template'])) { + case '1' : + $class['left'] = "displayNone"; + $class['center'] = "col12"; + $class['right'] = "displayNone"; + break; + case '2' : + $class['left'] = "col6"; + $class['center'] = "displayNone"; + $class['right'] = "col6"; + break; + case '3' : + $class['left'] = "col4"; + $class['center'] = "col4"; + $class['right'] = "col4"; + break; + }?> +
+
+ getData(['theme', 'footer', 'textPosition']) === 'left') { $layout->showFooterText(); } + if($this->getData(['theme', 'footer', 'socialsPosition']) === 'left') { $layout->showSocials(); } + if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'left') {$layout->showCopyright(); } + ?>
+
+ getData(['theme', 'footer', 'textPosition']) === 'center') { $layout->showFooterText(); } + if($this->getData(['theme', 'footer', 'socialsPosition']) === 'center') { $layout->showSocials(); } + if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'center') { $layout->showCopyright(); } + ?> +
+
+ getData(['theme', 'footer', 'textPosition']) === 'right') { $layout->showFooterText(); } + if($this->getData(['theme', 'footer', 'socialsPosition']) === 'right') { $layout->showSocials(); } + if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'right') { $layout->showCopyright(); } + ?> +
- +
showScript();?> diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 9a664468..6675cc65 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -295,7 +295,8 @@ class theme extends common { '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) + 'displayCopyright' => $this->getInput('themefooterDisplayCopyright', helper::FILTER_BOOLEAN), + 'template' => $this->getInput('themeFooterTemplate',helper::FILTER_INT) ]]); // Valeurs en sortie $this->addOutput([ diff --git a/core/module/theme/view/footer/footer.php b/core/module/theme/view/footer/footer.php index 80537e7c..7738d774 100755 --- a/core/module/theme/view/footer/footer.php +++ b/core/module/theme/view/footer/footer.php @@ -64,7 +64,7 @@

Mise en forme du texte

-
+
'Police', 'selected' => $this->getData(['theme', 'footer', 'font']) @@ -97,100 +97,104 @@

Mise en page

- 'Nombre de colonnes', - 'selected' => $this->getData(['theme', 'footer', 'template']), - 'help' => 'Le changement de la mise en page entraîne la réinitalisation de la position des contenus.' - ]); ?> +
+
+ 'Nombre de colonnes', + 'selected' => $this->getData(['theme', 'footer', 'template']), + 'help' => 'Le changement de la mise en page entraîne la réinitalisation de la position des contenus.' + ]); ?> +
+
+
+
+

Contenu personnalisé texte ou HTML :

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

Réseaux sociaux :

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

Info et copyright :

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

Contenu personnalisé

+

Contenu des blocs

'Contenu (texte ou HTML)', + 'label' => 'Texte ou HTML personnalisé :', 'value' => $this->getData(['theme', 'footer', 'text']), 'class' => 'editorWysiwyg' ]); ?> -
-
-
-
-
-
-

Contenu personnalisé

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

Contenu réseaux sociaux

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

Contenu copyright

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

Insérer les éléments suivants :

+
+
+
+

Contenu du bloc "Info et copyright" :

- $this->getData(['theme', 'footer','displayCopyright']) - ]); ?> -
-
- $this->getData(['theme', 'footer','displayVersion']) - ]); ?> +
+
+ $this->getData(['theme', 'footer','displayCopyright']) + ]); ?> +
+
+ $this->getData(['theme', 'footer','displayVersion']) + ]); ?> +
+
+
+
+ $this->getData(['theme', 'footer', 'displaySiteMap']), + 'help' => 'Un plan du site permet un meilleur référencement.' + ]); ?> +
+
+ $this->getData(['theme', 'footer', 'loginLink']) + ]); ?> +
+
- $this->getData(['theme', 'footer', 'displaySiteMap']), - 'help' => 'Un plan du site permet un meilleur référencement.' - ]); ?> +
+

La personnalisation des réseaux sociaux s'effectue dans la configuration du site.

+
-
- $this->getData(['theme', 'footer', 'loginLink']) - ]); ?> -
-
-
-
+
+
-
+
From 19368fc6800496dcf09dad599dda5056e0165082 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 19 Jun 2019 03:28:52 +0200 Subject: [PATCH 04/19] [9.1.13] pb alignement horizontal --- core/layout/common.css | 12 +++++++----- core/layout/main.php | 8 ++++---- core/module/install/ressource/defaultdata.php | 5 +++-- core/module/theme/theme.php | 10 +++++----- core/module/theme/view/footer/footer.js.php | 4 ++-- core/module/theme/view/footer/footer.php | 14 ++++++-------- 6 files changed, 27 insertions(+), 26 deletions(-) diff --git a/core/layout/common.css b/core/layout/common.css index dfe612e4..b63809e3 100755 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -565,14 +565,16 @@ section:after { } /* Pied de page */ -footer { - padding: 1px 20px; -} body > footer { margin: 0 -10px; } -#footersiteLeft, #footersiteCenter, #footersiteRight { - vertical-align: middle; +footer { + padding: 1px 20px; + position: relative; +} + +footer > .container { + align-items: center; } diff --git a/core/layout/main.php b/core/layout/main.php index 39c5cc4f..fd861806 100755 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -238,20 +238,20 @@ $class['right'] = "col4"; break; }?> -
-
+
+
getData(['theme', 'footer', 'textPosition']) === 'left') { $layout->showFooterText(); } if($this->getData(['theme', 'footer', 'socialsPosition']) === 'left') { $layout->showSocials(); } if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'left') {$layout->showCopyright(); } ?>
-
+
getData(['theme', 'footer', 'textPosition']) === 'center') { $layout->showFooterText(); } if($this->getData(['theme', 'footer', 'socialsPosition']) === 'center') { $layout->showSocials(); } if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'center') { $layout->showCopyright(); } ?>
-
+
getData(['theme', 'footer', 'textPosition']) === 'right') { $layout->showFooterText(); } if($this->getData(['theme', 'footer', 'socialsPosition']) === 'right') { $layout->showSocials(); } if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'right') { $layout->showCopyright(); } diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 0237f341..87ad8ff2 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -433,7 +433,7 @@ class install extends common { 'font' => 'Open+Sans', 'fontSize' => '.8em', 'fontWeight' => 'normal', - 'height' => '10px', + 'height' => '0', 'loginLink' => true, 'margin' => false, 'position' => 'site', @@ -449,7 +449,8 @@ class install extends common { 'displayVersion' => true, 'displayVersion' => true, 'displaySiteMap' => true, - 'displayCopyright' => true + 'displayCopyright' => true, + 'template' => 3 ], 'header' => [ 'backgroundColor' => 'rgba(255, 255, 255, 1)', diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 6675cc65..14ece0d3 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -78,11 +78,11 @@ class theme extends common { 'bold' => 'Gras' ]; public static $footerHeights = [ - '-5px' => 'Réduite', - '0px' => 'Très petite', - '5px' => 'Petite', - '10px' => 'Grande', - '15px' => 'Très grande' + '0' => 'Nulles', + '10px' => 'Très petites', + '15px' => 'Petites', + '20px' => 'Grandes', + '30px' => 'Très grandes' ]; public static $footerPositions = [ 'hide' => 'Caché', diff --git a/core/module/theme/view/footer/footer.js.php b/core/module/theme/view/footer/footer.js.php index d6f32aae..f1277fd0 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 += "footer .container > #footersiteLeft, #footersiteCenter, #footersiteRight {padding:" + $("#themeFooterHeight").val() + " 0}"; //css += "footer .container > div{padding:0}"; - css += "footer .container-large > div{margin:" + $("#themeFooterHeight").val() + " 0}"; + css += "footer .container-large > #footersiteLeft, #footersiteCenter, #footersiteRight {padding:" + $("#themeFooterHeight").val() + " 0}"; //css += "footer .container-large > div{padding:0}"; // Alignement du contenu css += "#footerSocials{text-align:" + $("#themeFooterSocialsAlign").val() + "}"; diff --git a/core/module/theme/view/footer/footer.php b/core/module/theme/view/footer/footer.php index 7738d774..378ef34a 100755 --- a/core/module/theme/view/footer/footer.php +++ b/core/module/theme/view/footer/footer.php @@ -46,8 +46,9 @@
'Hauteur', - 'selected' => $this->getData(['theme', 'footer', 'height']) + 'label' => 'Marges verticales', + 'selected' => $this->getData(['theme', 'footer', 'height']), + 'help' => 'La hauteur du pied de page est dynmamique selon le contenu.Ces marges sont ajoutées au-dessus et en-dessous.' ]); ?>
@@ -111,8 +112,7 @@

Contenu personnalisé texte ou HTML :

'Emplacement', - 'selected' => $this->getData(['theme', 'footer', 'textPosition']), - 'class' => 'themeFooterPosition' + 'selected' => $this->getData(['theme', 'footer', 'textPosition']) ]); ?> 'Alignement', @@ -123,8 +123,7 @@

Réseaux sociaux :

'Emplacement', - 'selected' => $this->getData(['theme', 'footer', 'socialsPosition']), - 'class' => 'themeFooterPosition' + 'selected' => $this->getData(['theme', 'footer', 'socialsPosition']) ]); ?> 'Alignement', @@ -135,8 +134,7 @@

Info et copyright :

'Emplacement', - 'selected' => $this->getData(['theme', 'footer', 'copyrightPosition']), - 'class' => 'themeFooterPosition' + 'selected' => $this->getData(['theme', 'footer', 'copyrightPosition']) ]); ?> 'Alignement', From afc8655e22b3e7d11c327837bb336d6716105957 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 19 Jun 2019 03:41:11 +0200 Subject: [PATCH 05/19] [9.1.13] erreur css --- core/core.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/core.php b/core/core.php index f3f81b86..6d83e652 100644 --- a/core/core.php +++ b/core/core.php @@ -1013,7 +1013,7 @@ class core extends common { $css .= '.container{max-width:' . $this->getData(['theme', 'site', 'width']) . '}'; $css .= $this->getData(['theme', 'site', 'width']) === '100%' ? '#site{margin:0 auto !important;} body{margin:0 auto !important;} #bar{margin:0 auto !important;} body > header{margin:0 auto !important;} body > nav {margin: 0 auto !important;} body > footer {margin:0 auto !important;}': ''; $css .= $this->getData(['theme', 'site', 'width']) === '750px' ? '.button, button{font-size:0.8em;}' : ''; - $css .= '#site{background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';border-radius:' . $this->getData(['theme', 'site', 'radius']) . ';box-shadow:' . $this->getData(['theme', 'site', 'shadow']) . ' #212223}'; + $css .= '#site{background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';border-radius:' . $this->getData(['theme', 'site', 'radius']) . ';box-shadow:' . $this->getData(['theme', 'site', 'shadow']) . ' #212223;}'; $colors = helper::colorVariants($this->getData(['theme', 'button', 'backgroundColor'])); $css .= '.speechBubble,.button,.button:hover,button[type=\'submit\'],.pagination a,.pagination a:hover,input[type=\'checkbox\']:checked + label:before,input[type=\'radio\']:checked + label:before,.helpContent{background-color:' . $colors['normal'] . ';color:' . $colors['text'] . '}'; $css .= '.helpButton span{color:' . $colors['normal'] . '}'; @@ -1086,8 +1086,8 @@ class core extends common { $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}'; - $css .= 'footer .container-large > div{margin:' . $this->getData(['theme', 'footer', 'height']) . ' 0}'; + $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 .= '#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']) . '}'; From 130ad549dd9dd80781e1ef184e28e0a4d641366f Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 19 Jun 2019 09:35:19 +0200 Subject: [PATCH 06/19] [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', From 5688d78bb4614fa0ab36d3709e7db1cc48fba966 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 19 Jun 2019 21:37:16 +0200 Subject: [PATCH 07/19] =?UTF-8?q?[9.1.13]=20jquery=20du=20footer=20en=20co?= =?UTF-8?q?urs=20de=20r=C3=A9=C3=A9criture?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/theme/view/footer/footer.js.php | 146 +++++++------------- core/module/theme/view/footer/footer.php | 7 +- 2 files changed, 51 insertions(+), 102 deletions(-) diff --git a/core/module/theme/view/footer/footer.js.php b/core/module/theme/view/footer/footer.js.php index 1046ba0f..4fa4357d 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 > #footersiteLeft, #footersiteCenter, #footersiteRight {padding:" + $("#themeFooterHeight").val() + " 0}"; + css += "footer .container > div{margin:" + $("#themeFooterHeight").val() + " 0}"; //css += "footer .container > div{padding:0}"; - css += "footer .container-large > #footersiteLeft, #footersiteCenter, #footersiteRight {padding:" + $("#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() + "}"; @@ -63,24 +63,24 @@ $("input, select").on("change", function() { } }); + + // Position dans les blocs // Bloc texte personnalisé -$("#themeFooterForm").on("change",function() { +$(".themeFooterContent").on("change",function() { + var position = $(".themeFooterContent").val(); switch($("#themeFooterTextPosition").val()) { case "hide": $("#footerText").hide(); break; case "left": - $("#footerText").show().appendTo("#footerbodyLeft"); - $("#footerText").show().appendTo("#footersiteLeft"); + $("#footerText").show().appendTo("#footer" + position + "Left"); break; case "center": - $("#footerText").show().appendTo("#footerbodyCenter"); - $("#footerText").show().appendTo("#footersiteCenter"); + $("#footerText").show().appendTo("#footer" + position + "Center"); break; case "right": - $("#footerText").show().appendTo("#footerbodyRight"); - $("#footerText").show().appendTo("#footersiteRight"); + $("#footerText").show().appendTo("#footer" + position + "Right"); break; } switch($("#themeFooterSocialsPosition").val()) { @@ -88,16 +88,13 @@ $("#themeFooterForm").on("change",function() { $("#footerSocials").hide(); break; case 'left': - $("#footerSocials").show().appendTo("#footerbodyLeft"); - $("#footerSocials").show().appendTo("#footersiteLeft"); + $("#footerSocials").show().appendTo("#footer" + position + "Left"); break; case 'center': - $("#footerSocials").show().appendTo("#footerbodyCenter"); - $("#footerSocials").show().appendTo("#footersiteCenter"); + $("#footerSocials").show().appendTo("#footer" + position + "Center"); break; case 'right': - $("#footerSocials").show().appendTo("#footerbodyRight"); - $("#footerSocials").show().appendTo("#footersiteRight"); + $("#footerSocials").show().appendTo("#footer" + position + "Right"); break; } switch($("#themeFooterCopyrightPosition").val()) { @@ -105,23 +102,19 @@ $("#themeFooterForm").on("change",function() { $("#footerCopyright").hide(); break; case 'left': - $("#footerCopyright").show().appendTo("#footerbodyLeft"); - $("#footerCopyright").show().appendTo("#footersiteLeft"); + $("#footerCopyright").show().appendTo("#footer" + position + "Left"); break; case 'center': - $("#footerCopyright").show().appendTo("#footerbodyCenter"); - $("#footerCopyright").show().appendTo("#footersiteCenter"); + $("#footerCopyright").show().appendTo("#footer" + position + "Center"); break; case 'right': - $("#footerCopyright").show().appendTo("#footerbodyRight"); - $("#footerCopyright").show().appendTo("#footersiteRight"); + $("#footerCopyright").show().appendTo("#footer" + position + "Right"); break; } }).trigger("change"); +// Fin Position dans les blocs - - -// Modification de la mise en page +// Modification dynamique de la mise en page $("#themeFooterTemplate").on("change",function() { // Nettoyage des sélecteurs des contenus var newOptions = { @@ -129,96 +122,53 @@ $("#themeFooterTemplate").on("change",function() { 2: {'hide': 'Masqué', 'left': 'Bloc Gauche', 'right': 'Bloc Droite'} , 1: {'hide': 'Masqué', 'center': 'Affiché'} }; - var $el = $(".themeFooterPosition"); + var $el = $(".themeFooterContent"); $el.empty(); // Eléments des position de contenus $.each(newOptions[$("#themeFooterTemplate").val()], function(key,value) { $el.append($("") .attr("value", key).text(value)); }); + var position = $("#themeFooterPosition").val(); + // Masquer le contenus + $("#footerCopyright").hide(); + $("#footerText").hide(); + $("#footerSocials").hide(); + console.log(position); switch($("#themeFooterTemplate").val()) { case "1": - console.log("1"); - $("#footersiteLeft").css("display", "none"); - $("#footersiteCenter").css("display", ""); - $("#footersiteRight").css("display", "none"); + $("#footer" + position + "Left").css("display","none"); + $("#footer" + position + "Center").css("display",""); + $("#footer" + position + "Right").css("display","none"); // Dimension du bloc - $("#footersiteCenter").removeAttr('class');; - $("#footersiteCenter").addClass("col12"); + $("#footer" + position + "Center").removeAttr('class'); + $("#footer" + position + "Center").addClass("col12"); break; - case "2": - console.log("2"); - $("#footersiteLeft").css("display", ""); - $("#footersiteCenter").css("display", "none"); - $("#footersiteRight").css("display", ""); + case "2": + $("#footer" + position + "Left").css("display",""); + $("#footer" + position + "Center").css("display","none"); + $("#footer" + position + "Right").css("display",""); // Dimension de blocs - $("#footersiteLeft").removeAttr('class'); - $("#footersiteRight").removeAttr('class'); - $("#footersiteLeft").addClass('col6'); - $("#footersiteRight").addClass('col6'); + $("#footer" + position + "Left").removeAttr('class'); + $("#footer" + position + "Right").removeAttr('class'); + $("#footer" + position + "Left").addClass('col6'); + $("#footer" + position + "Right").addClass('col6'); break; - case "3": - console.log("3"); - $("#footersiteLeft").css("display", ""); - $("#footersiteCenter").css("display", ""); - $("#footersiteRight").css("display", ""); - // Dimensions des blocs - $("#footersiteLeft").removeAttr('class'); - $("#footersiteRight").removeAttr('class'); - $("#footersitecenter").removeAttr('class'); - $("#footersiteLeft").addClass('col4'); - $("#footersiteCenter").addClass('col4'); - $("#footersiteRight").addClass('col4'); + case "3": + $("#footer" + position + "Left").css("display",""); + $("#footer" + position + "Center").css("display",""); + $("#footer" + position + "Right").css("display",""); + // Dimension de blocs + $("#footer" + position + "Left").removeAttr('class'); + $("#footer" + position + "Right").removeAttr('class'); + $("#footer" + position + "center").removeAttr('class'); + $("#footer" + position + "Left").addClass('col4'); + $("#footer" + position + "Center").addClass('col4'); + $("#footer" + position + "Right").addClass('col4'); break; } }); -// 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); - } - } -}); - - // Lien de connexion $("#themeFooterLoginLink").on("change", function() { diff --git a/core/module/theme/view/footer/footer.php b/core/module/theme/view/footer/footer.php index a68eef10..878bce59 100755 --- a/core/module/theme/view/footer/footer.php +++ b/core/module/theme/view/footer/footer.php @@ -112,12 +112,11 @@
-

Contenu personnalisé texte ou HTML :

'Emplacement', 'selected' => $this->getData(['theme', 'footer', 'textPosition']), - 'class' => 'themeFooterPosition' + 'class' => 'themeFooterContent' ]); ?> 'Alignement', @@ -129,7 +128,7 @@ 'Emplacement', 'selected' => $this->getData(['theme', 'footer', 'socialsPosition']), - 'class' => 'themeFooterPosition' + 'class' => 'themeFooterContent' ]); ?> 'Alignement', @@ -141,7 +140,7 @@ 'Emplacement', 'selected' => $this->getData(['theme', 'footer', 'copyrightPosition']), - 'class' => 'themeFooterPosition' + 'class' => 'themeFooterContent' ]); ?> 'Alignement', From c5825f7c0afd76a21862b681838213ed3298e4cb Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 19 Jun 2019 21:42:10 +0200 Subject: [PATCH 08/19] [9.1.13] footer.js stable --- core/module/theme/view/footer/footer.js.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/module/theme/view/footer/footer.js.php b/core/module/theme/view/footer/footer.js.php index 4fa4357d..6e195336 100755 --- a/core/module/theme/view/footer/footer.js.php +++ b/core/module/theme/view/footer/footer.js.php @@ -68,7 +68,7 @@ $("input, select").on("change", function() { // Position dans les blocs // Bloc texte personnalisé $(".themeFooterContent").on("change",function() { - var position = $(".themeFooterContent").val(); + var position = $("#themeFooterPosition").val(); switch($("#themeFooterTextPosition").val()) { case "hide": $("#footerText").hide(); @@ -134,7 +134,6 @@ $("#themeFooterTemplate").on("change",function() { $("#footerCopyright").hide(); $("#footerText").hide(); $("#footerSocials").hide(); - console.log(position); switch($("#themeFooterTemplate").val()) { case "1": $("#footer" + position + "Left").css("display","none"); From f8668168ddc2680263a77bc0bab0188d6ec23fca Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 19 Jun 2019 21:49:21 +0200 Subject: [PATCH 09/19] [9.1.13] footer.js ok --- core/module/theme/view/footer/footer.js.php | 47 +++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/core/module/theme/view/footer/footer.js.php b/core/module/theme/view/footer/footer.js.php index 6e195336..78ee523f 100755 --- a/core/module/theme/view/footer/footer.js.php +++ b/core/module/theme/view/footer/footer.js.php @@ -169,6 +169,53 @@ $("#themeFooterTemplate").on("change",function() { }); +// Désactivation des sélections multiples +$("#themeFooterSocialsPosition").on("change", function() { + if ($(this).prop('selectedIndex') >= 1 ) { + if ( $("#themeFooterTextPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) { + $("#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') ) { + $("#themeFooterSocialsPosition").prop('selectedIndex',0); + $("#footerSocials").hide(); + } + if ( $("#themeFooterCopyrightPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) { + $("#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(); + } + } + +}).trigger("change"); + + + + // Lien de connexion $("#themeFooterLoginLink").on("change", function() { if($(this).is(":checked")) { From c7fdb3e997e24c31fa80517b6f7abe0697bfd4d9 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 20 Jun 2019 07:51:56 +0200 Subject: [PATCH 10/19] [9.1.13] footer avec marges ok --- core/core.php | 4 +++- core/layout/common.css | 4 ++++ core/module/theme/theme.php | 9 +++------ core/module/theme/view/footer/footer.js.php | 4 ++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/core/core.php b/core/core.php index 6d83e652..d4761f31 100644 --- a/core/core.php +++ b/core/core.php @@ -1081,7 +1081,9 @@ 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}'; + $css .= 'footer{margin:0 20px 20px;padding: 1px 20px;}'; + } 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']) . '}'; diff --git a/core/layout/common.css b/core/layout/common.css index 3bdbd0a2..e532455f 100755 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -576,6 +576,10 @@ footer { vertical-align: middle; } +#footersite { + margin: 0; +} + #footerLoginLink, #footerDisplayCopyright, #footerDisplayVersion, diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index d23cf572..5e624cd5 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -80,19 +80,16 @@ class theme extends common { 'left' => 'Bloc Gauche', 'center' => 'Bloc Central', 'right' => 'Bloc Droite' - ] - + ] ]; - public static $fontWeights = [ 'normal' => 'Maigre', 'bold' => 'Gras' ]; public static $footerHeights = [ - '0' => 'Nulles', - '10px' => 'Très petites', - '15px' => 'Petites', + '0' => 'Très petites', + '10px' => 'Petites', '20px' => 'Grandes', '30px' => 'Très grandes' ]; diff --git a/core/module/theme/view/footer/footer.js.php b/core/module/theme/view/footer/footer.js.php index 78ee523f..6b240d42 100755 --- a/core/module/theme/view/footer/footer.js.php +++ b/core/module/theme/view/footer/footer.js.php @@ -37,10 +37,10 @@ $("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}'; + css += 'footer{margin:0 20px 20px;padding: 1px 20px;}'; } else { - css += 'footer{margin:0}'; + css += 'footer{margin:0;padding:0}'; } // Ajout du css au DOM $("#themePreview").remove(); From 7251101625e6dd9994b34f221a9d1fffd6c24fbf Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 20 Jun 2019 15:19:21 +0200 Subject: [PATCH 11/19] [9.1.13] Module de recherche --- core/core.php | 3 +- core/module/search/search.php | 152 ++++++++++++++++++++++ core/module/search/view/index/index.php | 28 ++++ core/module/search/view/result/result.php | 21 +++ 4 files changed, 203 insertions(+), 1 deletion(-) create mode 100644 core/module/search/search.php create mode 100644 core/module/search/view/index/index.php create mode 100644 core/module/search/view/result/result.php diff --git a/core/core.php b/core/core.php index d4761f31..4b39e73c 100644 --- a/core/core.php +++ b/core/core.php @@ -42,7 +42,8 @@ class common { 'page', 'sitemap', 'theme', - 'user' + 'user', + 'search' ]; private $data = []; private $hierarchy = [ diff --git a/core/module/search/search.php b/core/module/search/search.php new file mode 100644 index 00000000..d970d71e --- /dev/null +++ b/core/module/search/search.php @@ -0,0 +1,152 @@ + self::GROUP_VISITOR, + ]; + +// Liste de fonctions correspondant aux vues + + public function index() { + if($this->isPost()) { + // Récupération de l'ensemble des données d'un site ZWII + // Lire le fichier core.json si il existe + // Traitement du formulaire + $success = true; + $result = ''; + if(file_exists ('./site/data/core.json')) { + $json_source = file_get_contents('./site/data/core.json'); + + // Décoder le JSON en un array + $array = json_decode($json_source,true); + + // Récupération du mot clef passé par le formulaire de ...view/index.php, avec caractères accentués + $motclef=$this->getInput('searchMotphraseclef'); + + $result = '

Recherche avec le mot clef : '.$motclef.'

'; + if ($motclef !== "" && strlen($motclef) > 2) { + $dejavu = ''; + $nboccutotal = 0; + foreach ($array as $key1 => $value1) { + // Déterminer le chemin de tous les contenus (content) dans page ou module + if (($key1 ==='page' || $key1 ==='module') && is_array($value1) ) + { + foreach ($value1 as $key2 => $value2) + { + if (is_array($value2)) + { + foreach ($value2 as $key3 => $value3) { + if ($key3 === "content" && is_string($value3)) { + // compte le nombre d'occurrences dans la page + $nboccu=0; + // le contenu à explorer est dans $value3, le nom de la page est $key2 + //Nettoyage de $value3 : on enlève tout ce qui est inclus entre < et > + $value3=$this->nettoyer_html($value3); + //accentuation + $value3=html_entity_decode($value3); + // Recherche et affichage des occurrences + do { + $occu = stristr($value3,$motclef); + if ($occu !== '') { + if ($key2!=$dejavu) { + $result .= '


Mot clef trouvé dans la page : '.$key2.'

'; + } + $dejavu=$key2; + $nboccu++; + //Affichage d'un extrait de $value3 + $result .= '

'.$nboccu.' - "...'.substr($occu,0,200).'..."

'; + //pour recherche d'une autre occurence dans le même contenu + $value3=substr($occu,100); + } + } while($occu != ''); + $dejavu = ''; + $nboccutotal = $nboccutotal + $nboccu; + $nboccu = 0; + } elseif ($key1 == "module" && is_array($value3)) { + foreach ($value3 as $key4 => $value4) { + if ($key4 == "content" && is_string($value4) ) { + $nboccu = 0; + // le contenu à explorer est dans $value4, le nom du module/page est $key2/$key3 + //Nettoyage de $value4 : on enlève tout ce qui est inclus entre < et > + $value4 = $this->nettoyer_html($value4); + //accentuation + $value4 = html_entity_decode($value4); + // Recherche et affichage des occurrences + do { + $occu = stristr($value4,$motclef); + if ($occu != '') { + if ($key3 != $dejavu) { + $result .= '


Mot clef trouvé dans la page : '.$key2.'/'.$key3.'

'; + } + $dejavu = $key3; + $nboccu++; + $result .= '

'.$nboccu.' - "...'.substr($occu,0,200).'..."

'; + } + //pour recherche d'une autre occurrence dans le même contenu + $value4 = substr($occu,100); + } while($occu != ''); + $dejavu = ''; + $nboccutotal = $nboccutotal + $nboccu; + $nboccu = 0; + } + } + } + } + } + } + } + } + if ($nboccutotal==0) { + $notification = '


Mot clef non trouvé, avez-vous pensé aux accents ?

'; + $success = false; + } else { + $result .= '


Nombre total d\'occurrences : '.$nboccutotal.'

'; + $notification = 'Nombre total d\'occurrences : '.$nboccutotal; + $success = true; + } + } else { + $notification = 'Trop court ! minimum 3 caractères'; + $result = '


Trop court ! minimum 3 caractères

'; + $success = false; + } + + } else { + $notification = 'Fichier core.json introuvable'; + $success = false; + } + $_POST['result'] = $result; + $_POST['occurence'] = $nboccutotal; + // Valeurs en sortie, affichage du résultat + $this->addOutput([ + 'title' => 'Rechercher dans le site', + 'view' => 'result', + 'notification' => $notification, + 'state' => $success + ]); + } else { + // Valeurs en sortie, affichage du formulaire + $this->addOutput([ + 'title' => 'Rechercher dans le site', + 'view' => 'index' + ]); + } + } + + /* Déclaration de la fonction nettoyer(string $contenu) : string + * Supprime de $contenu les caractères placés entre < et >, donc les balises html comme


etc... + * Retourne $contenu nettoyée, le résultat est sensiblement différent de celui obtenu avec la fonction strip_tags() + */ + private function nettoyer_html($contenu){ + do { + $pos1=strpos($contenu,chr(60)); + if($pos1!==false) { + $pos2=strpos($contenu,chr(62)); + if($pos2!==false) $contenu=substr_replace($contenu," ",$pos1,($pos2 - $pos1 + 1)); + } + } while($pos1!==false); + return $contenu; + } + +} +?> \ No newline at end of file diff --git a/core/module/search/view/index/index.php b/core/module/search/view/index/index.php new file mode 100644 index 00000000..d197609e --- /dev/null +++ b/core/module/search/view/index/index.php @@ -0,0 +1,28 @@ + +

+
+ getUrl(2); ?> + getData(['page', $this->getUrl(2), 'moduleId']) === 'redirection' || 'code')$href = helper::baseUrl(); ?> + 'buttonGrey', + 'href' => $href, + 'ico' => 'left', + 'value' => 'Retour' + ]); ?> +
+
+ +
+
+
+
+

Zone de saisie :

+ 'Mot ou phrase clef', + 'value' => '', + 'help' => 'Saisir un mot ou une phrase clef pour votre recherche, n\'oubliez pas les accents.' + ]); ?> +
+
+
+ diff --git a/core/module/search/view/result/result.php b/core/module/search/view/result/result.php new file mode 100644 index 00000000..e98abb36 --- /dev/null +++ b/core/module/search/view/result/result.php @@ -0,0 +1,21 @@ + +
+
+ getUrl(2); ?> + getData(['page', $this->getUrl(2), 'moduleId']) === 'redirection' || 'code')$href = helper::baseUrl(); ?> + 'buttonGrey', + 'href' => $href . 'search', + 'ico' => 'left', + 'value' => 'Retour' + ]); ?> +
+
+
+
+

Résulats

+ +
+
+
+ \ No newline at end of file From 05ac12b01169a6f58a289a2bf1787565980af891 Mon Sep 17 00:00:00 2001 From: Fred <23246457+fredtempez@users.noreply.github.com> Date: Fri, 21 Jun 2019 10:29:27 +0200 Subject: [PATCH 12/19] Update search.php --- core/module/search/search.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/module/search/search.php b/core/module/search/search.php index d970d71e..ce10798d 100644 --- a/core/module/search/search.php +++ b/core/module/search/search.php @@ -48,7 +48,7 @@ class search extends common { // Recherche et affichage des occurrences do { $occu = stristr($value3,$motclef); - if ($occu !== '') { + if ($occu != '') { if ($key2!=$dejavu) { $result .= '


Mot clef trouvé dans la page : '.$key2.'

'; } @@ -149,4 +149,4 @@ class search extends common { } } -?> \ No newline at end of file +?> From f9abf2f5daf10784c2f221bc951921795ccaecb8 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 21 Jun 2019 21:10:38 +0200 Subject: [PATCH 13/19] [9.1.14] retrait module search --- core/core.php | 3 +- core/module/search/search.php | 152 ---------------------- core/module/search/view/index/index.php | 28 ---- core/module/search/view/result/result.php | 21 --- 4 files changed, 1 insertion(+), 203 deletions(-) delete mode 100644 core/module/search/search.php delete mode 100644 core/module/search/view/index/index.php delete mode 100644 core/module/search/view/result/result.php diff --git a/core/core.php b/core/core.php index 7951a614..04a1bc76 100644 --- a/core/core.php +++ b/core/core.php @@ -42,8 +42,7 @@ class common { 'page', 'sitemap', 'theme', - 'user', - 'search' + 'user' ]; private $data = []; private $hierarchy = [ diff --git a/core/module/search/search.php b/core/module/search/search.php deleted file mode 100644 index d970d71e..00000000 --- a/core/module/search/search.php +++ /dev/null @@ -1,152 +0,0 @@ - self::GROUP_VISITOR, - ]; - -// Liste de fonctions correspondant aux vues - - public function index() { - if($this->isPost()) { - // Récupération de l'ensemble des données d'un site ZWII - // Lire le fichier core.json si il existe - // Traitement du formulaire - $success = true; - $result = ''; - if(file_exists ('./site/data/core.json')) { - $json_source = file_get_contents('./site/data/core.json'); - - // Décoder le JSON en un array - $array = json_decode($json_source,true); - - // Récupération du mot clef passé par le formulaire de ...view/index.php, avec caractères accentués - $motclef=$this->getInput('searchMotphraseclef'); - - $result = '

Recherche avec le mot clef : '.$motclef.'

'; - if ($motclef !== "" && strlen($motclef) > 2) { - $dejavu = ''; - $nboccutotal = 0; - foreach ($array as $key1 => $value1) { - // Déterminer le chemin de tous les contenus (content) dans page ou module - if (($key1 ==='page' || $key1 ==='module') && is_array($value1) ) - { - foreach ($value1 as $key2 => $value2) - { - if (is_array($value2)) - { - foreach ($value2 as $key3 => $value3) { - if ($key3 === "content" && is_string($value3)) { - // compte le nombre d'occurrences dans la page - $nboccu=0; - // le contenu à explorer est dans $value3, le nom de la page est $key2 - //Nettoyage de $value3 : on enlève tout ce qui est inclus entre < et > - $value3=$this->nettoyer_html($value3); - //accentuation - $value3=html_entity_decode($value3); - // Recherche et affichage des occurrences - do { - $occu = stristr($value3,$motclef); - if ($occu !== '') { - if ($key2!=$dejavu) { - $result .= '


Mot clef trouvé dans la page : '.$key2.'

'; - } - $dejavu=$key2; - $nboccu++; - //Affichage d'un extrait de $value3 - $result .= '

'.$nboccu.' - "...'.substr($occu,0,200).'..."

'; - //pour recherche d'une autre occurence dans le même contenu - $value3=substr($occu,100); - } - } while($occu != ''); - $dejavu = ''; - $nboccutotal = $nboccutotal + $nboccu; - $nboccu = 0; - } elseif ($key1 == "module" && is_array($value3)) { - foreach ($value3 as $key4 => $value4) { - if ($key4 == "content" && is_string($value4) ) { - $nboccu = 0; - // le contenu à explorer est dans $value4, le nom du module/page est $key2/$key3 - //Nettoyage de $value4 : on enlève tout ce qui est inclus entre < et > - $value4 = $this->nettoyer_html($value4); - //accentuation - $value4 = html_entity_decode($value4); - // Recherche et affichage des occurrences - do { - $occu = stristr($value4,$motclef); - if ($occu != '') { - if ($key3 != $dejavu) { - $result .= '


Mot clef trouvé dans la page : '.$key2.'/'.$key3.'

'; - } - $dejavu = $key3; - $nboccu++; - $result .= '

'.$nboccu.' - "...'.substr($occu,0,200).'..."

'; - } - //pour recherche d'une autre occurrence dans le même contenu - $value4 = substr($occu,100); - } while($occu != ''); - $dejavu = ''; - $nboccutotal = $nboccutotal + $nboccu; - $nboccu = 0; - } - } - } - } - } - } - } - } - if ($nboccutotal==0) { - $notification = '


Mot clef non trouvé, avez-vous pensé aux accents ?

'; - $success = false; - } else { - $result .= '


Nombre total d\'occurrences : '.$nboccutotal.'

'; - $notification = 'Nombre total d\'occurrences : '.$nboccutotal; - $success = true; - } - } else { - $notification = 'Trop court ! minimum 3 caractères'; - $result = '


Trop court ! minimum 3 caractères

'; - $success = false; - } - - } else { - $notification = 'Fichier core.json introuvable'; - $success = false; - } - $_POST['result'] = $result; - $_POST['occurence'] = $nboccutotal; - // Valeurs en sortie, affichage du résultat - $this->addOutput([ - 'title' => 'Rechercher dans le site', - 'view' => 'result', - 'notification' => $notification, - 'state' => $success - ]); - } else { - // Valeurs en sortie, affichage du formulaire - $this->addOutput([ - 'title' => 'Rechercher dans le site', - 'view' => 'index' - ]); - } - } - - /* Déclaration de la fonction nettoyer(string $contenu) : string - * Supprime de $contenu les caractères placés entre < et >, donc les balises html comme


etc... - * Retourne $contenu nettoyée, le résultat est sensiblement différent de celui obtenu avec la fonction strip_tags() - */ - private function nettoyer_html($contenu){ - do { - $pos1=strpos($contenu,chr(60)); - if($pos1!==false) { - $pos2=strpos($contenu,chr(62)); - if($pos2!==false) $contenu=substr_replace($contenu," ",$pos1,($pos2 - $pos1 + 1)); - } - } while($pos1!==false); - return $contenu; - } - -} -?> \ No newline at end of file diff --git a/core/module/search/view/index/index.php b/core/module/search/view/index/index.php deleted file mode 100644 index d197609e..00000000 --- a/core/module/search/view/index/index.php +++ /dev/null @@ -1,28 +0,0 @@ - -

-
- getUrl(2); ?> - getData(['page', $this->getUrl(2), 'moduleId']) === 'redirection' || 'code')$href = helper::baseUrl(); ?> - 'buttonGrey', - 'href' => $href, - 'ico' => 'left', - 'value' => 'Retour' - ]); ?> -
-
- -
-
-
-
-

Zone de saisie :

- 'Mot ou phrase clef', - 'value' => '', - 'help' => 'Saisir un mot ou une phrase clef pour votre recherche, n\'oubliez pas les accents.' - ]); ?> -
-
-
- diff --git a/core/module/search/view/result/result.php b/core/module/search/view/result/result.php deleted file mode 100644 index e98abb36..00000000 --- a/core/module/search/view/result/result.php +++ /dev/null @@ -1,21 +0,0 @@ - -
-
- getUrl(2); ?> - getData(['page', $this->getUrl(2), 'moduleId']) === 'redirection' || 'code')$href = helper::baseUrl(); ?> - 'buttonGrey', - 'href' => $href . 'search', - 'ico' => 'left', - 'value' => 'Retour' - ]); ?> -
-
-
-
-

Résulats

- -
-
-
- \ No newline at end of file From b5edd4ead99e6282e68e4ed70de702d5a114f143 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 21 Jun 2019 21:31:36 +0200 Subject: [PATCH 14/19] [9.1.14] nettoyage search --- core/module/search/search.php | 152 ---------------------------------- 1 file changed, 152 deletions(-) delete mode 100644 core/module/search/search.php diff --git a/core/module/search/search.php b/core/module/search/search.php deleted file mode 100644 index ce10798d..00000000 --- a/core/module/search/search.php +++ /dev/null @@ -1,152 +0,0 @@ - self::GROUP_VISITOR, - ]; - -// Liste de fonctions correspondant aux vues - - public function index() { - if($this->isPost()) { - // Récupération de l'ensemble des données d'un site ZWII - // Lire le fichier core.json si il existe - // Traitement du formulaire - $success = true; - $result = ''; - if(file_exists ('./site/data/core.json')) { - $json_source = file_get_contents('./site/data/core.json'); - - // Décoder le JSON en un array - $array = json_decode($json_source,true); - - // Récupération du mot clef passé par le formulaire de ...view/index.php, avec caractères accentués - $motclef=$this->getInput('searchMotphraseclef'); - - $result = '

Recherche avec le mot clef : '.$motclef.'

'; - if ($motclef !== "" && strlen($motclef) > 2) { - $dejavu = ''; - $nboccutotal = 0; - foreach ($array as $key1 => $value1) { - // Déterminer le chemin de tous les contenus (content) dans page ou module - if (($key1 ==='page' || $key1 ==='module') && is_array($value1) ) - { - foreach ($value1 as $key2 => $value2) - { - if (is_array($value2)) - { - foreach ($value2 as $key3 => $value3) { - if ($key3 === "content" && is_string($value3)) { - // compte le nombre d'occurrences dans la page - $nboccu=0; - // le contenu à explorer est dans $value3, le nom de la page est $key2 - //Nettoyage de $value3 : on enlève tout ce qui est inclus entre < et > - $value3=$this->nettoyer_html($value3); - //accentuation - $value3=html_entity_decode($value3); - // Recherche et affichage des occurrences - do { - $occu = stristr($value3,$motclef); - if ($occu != '') { - if ($key2!=$dejavu) { - $result .= '


Mot clef trouvé dans la page : '.$key2.'

'; - } - $dejavu=$key2; - $nboccu++; - //Affichage d'un extrait de $value3 - $result .= '

'.$nboccu.' - "...'.substr($occu,0,200).'..."

'; - //pour recherche d'une autre occurence dans le même contenu - $value3=substr($occu,100); - } - } while($occu != ''); - $dejavu = ''; - $nboccutotal = $nboccutotal + $nboccu; - $nboccu = 0; - } elseif ($key1 == "module" && is_array($value3)) { - foreach ($value3 as $key4 => $value4) { - if ($key4 == "content" && is_string($value4) ) { - $nboccu = 0; - // le contenu à explorer est dans $value4, le nom du module/page est $key2/$key3 - //Nettoyage de $value4 : on enlève tout ce qui est inclus entre < et > - $value4 = $this->nettoyer_html($value4); - //accentuation - $value4 = html_entity_decode($value4); - // Recherche et affichage des occurrences - do { - $occu = stristr($value4,$motclef); - if ($occu != '') { - if ($key3 != $dejavu) { - $result .= '


Mot clef trouvé dans la page : '.$key2.'/'.$key3.'

'; - } - $dejavu = $key3; - $nboccu++; - $result .= '

'.$nboccu.' - "...'.substr($occu,0,200).'..."

'; - } - //pour recherche d'une autre occurrence dans le même contenu - $value4 = substr($occu,100); - } while($occu != ''); - $dejavu = ''; - $nboccutotal = $nboccutotal + $nboccu; - $nboccu = 0; - } - } - } - } - } - } - } - } - if ($nboccutotal==0) { - $notification = '


Mot clef non trouvé, avez-vous pensé aux accents ?

'; - $success = false; - } else { - $result .= '


Nombre total d\'occurrences : '.$nboccutotal.'

'; - $notification = 'Nombre total d\'occurrences : '.$nboccutotal; - $success = true; - } - } else { - $notification = 'Trop court ! minimum 3 caractères'; - $result = '


Trop court ! minimum 3 caractères

'; - $success = false; - } - - } else { - $notification = 'Fichier core.json introuvable'; - $success = false; - } - $_POST['result'] = $result; - $_POST['occurence'] = $nboccutotal; - // Valeurs en sortie, affichage du résultat - $this->addOutput([ - 'title' => 'Rechercher dans le site', - 'view' => 'result', - 'notification' => $notification, - 'state' => $success - ]); - } else { - // Valeurs en sortie, affichage du formulaire - $this->addOutput([ - 'title' => 'Rechercher dans le site', - 'view' => 'index' - ]); - } - } - - /* Déclaration de la fonction nettoyer(string $contenu) : string - * Supprime de $contenu les caractères placés entre < et >, donc les balises html comme


etc... - * Retourne $contenu nettoyée, le résultat est sensiblement différent de celui obtenu avec la fonction strip_tags() - */ - private function nettoyer_html($contenu){ - do { - $pos1=strpos($contenu,chr(60)); - if($pos1!==false) { - $pos2=strpos($contenu,chr(62)); - if($pos2!==false) $contenu=substr_replace($contenu," ",$pos1,($pos2 - $pos1 + 1)); - } - } while($pos1!==false); - return $contenu; - } - -} -?> From 2586da1d530b795d5b1141a50c5cc59f741eb1e7 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sat, 22 Jun 2019 08:23:09 +0200 Subject: [PATCH 15/19] [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); From a3e17dfb83b2990b627349d87bba664ab170cf1b Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sat, 22 Jun 2019 17:27:49 +0200 Subject: [PATCH 16/19] =?UTF-8?q?[9.1.14]=20Page=20des=20mentions=20l?= =?UTF-8?q?=C3=A9gales=20dans=20le=20footer=20(reste=20=C3=A0=20ins=C3=A9r?= =?UTF-8?q?er=20dans=20le=20pied=20de=20page)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/theme/theme.php | 8 +++++++- core/module/theme/view/footer/footer.js.php | 13 ++++++++++--- core/module/theme/view/footer/footer.php | 20 ++++++++++++++++---- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index f419ab83..c37e7423 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -294,6 +294,11 @@ class theme extends common { 'state' => false ]); } else { + if ($this->getInput('themeFooterLegalCheck', helper::FILTER_BOOLEAN) === true ) { + $legalPageId = $this->getInput('themeFooterLegalPageId', helper::FILTER_ID); + } else { + $legalPageId = ''; + } $this->setData(['theme', 'footer', [ 'backgroundColor' => $this->getInput('themeFooterBackgroundColor'), 'copyrightAlign' => $this->getInput('themeFooterCopyrightAlign'), @@ -315,7 +320,8 @@ 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') + 'template' => $this->getInput('themeFooterTemplate'), + 'legalPageId' => $legalPageId ]]); // 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 ae1f7707..bb71f190 100755 --- a/core/module/theme/view/footer/footer.js.php +++ b/core/module/theme/view/footer/footer.js.php @@ -214,7 +214,14 @@ $("#themeFooterCopyrightPosition").on("change", function() { }).trigger("change"); - +// Mention Légales activation de la liste de choix +$("#themeFooterLegalCheck").on("change",function() { + if($(this).is(":checked")) { + $("#themeFooterLegalPageId").show(); + } else { + $("#themeFooterLegalPageId").hide(); + } +}); // Lien de connexion $("#themeFooterLoginLink").on("change", function() { @@ -229,10 +236,10 @@ $("#themeFooterLoginLink").on("change", function() { // Numéro de version $("#themefooterDisplayVersion").on("change", function() { if($(this).is(":checked")) { - $("#footerDisplayVersion").show(); + $("#footerDisplayVersion").slideDown(); } else { - $("#footerDisplayVersion").hide(); + $("#footerDisplayVersion").slideUp(); } }).trigger("change"); diff --git a/core/module/theme/view/footer/footer.php b/core/module/theme/view/footer/footer.php index 878bce59..ac1667d7 100755 --- a/core/module/theme/view/footer/footer.php +++ b/core/module/theme/view/footer/footer.php @@ -190,14 +190,26 @@ ]); ?>

-
-
-
-

La personnalisation des réseaux sociaux s'effectue dans la configuration du site.

+
+
+ $this->getData(['theme', 'footer', 'legalPageId']) === '' ? false : true + ]); ?> +

+
+
+
+
+ getData(['page']), 'title', 'SORT_ASC'), [ + 'class' => $this->getData(['theme', 'footer', 'legalPageId']) === '' ? 'displayNone' : '', + 'selected' => $this->getData(['theme', 'footer', 'legalPageId']) + ]); ?> +
+
From 69ed7060edade4f53fbbc56c0b9ec5e4f280d149 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sat, 22 Jun 2019 19:43:33 +0200 Subject: [PATCH 17/19] =?UTF-8?q?[9.1.14]=20installation=20par=20d=C3=A9fa?= =?UTF-8?q?ut=20mentions=20l=C3=A9gales?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/install/ressource/defaultdata.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 5b8e5a71..8e95d508 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -435,7 +435,7 @@ class install extends common { 'fontWeight' => 'normal', 'height' => '0', 'loginLink' => true, - 'margin' => false, + 'margin' => true, 'position' => 'site', 'textColor' => 'rgba(33, 34, 35, 1)', 'copyrightPosition' => 'right', @@ -450,7 +450,8 @@ class install extends common { 'displayVersion' => true, 'displaySiteMap' => true, 'displayCopyright' => true, - 'template' => '3' + 'template' => '3', + 'legalPageId' => '' ], 'header' => [ 'backgroundColor' => 'rgba(255, 255, 255, 1)', From f63178c29b85ad3b53243407eb535b8bba954cfd Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sat, 22 Jun 2019 19:43:52 +0200 Subject: [PATCH 18/19] =?UTF-8?q?[9.1.14]=20mentions=20l=C3=A9gales=20dans?= =?UTF-8?q?=20le=20core?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/core.php b/core/core.php index 6dff5d8c..018a783c 100644 --- a/core/core.php +++ b/core/core.php @@ -1955,12 +1955,20 @@ class layout extends common { $items .= $this->getData(['theme','footer','displayVersion']) === false ? 'class="displayNone"' : ''; $items .= '> '. common::ZWII_VERSION ; $items .= ''; - // Affichage du lien de connexion + // Affichage du sitemap $items .= 'getData(['theme','footer','displaySiteMap']) === false? ' class="displayNone"' : ''; $items .= '> | Plan du site'; $items .= ''; - if( + // Affichage des mentions légales + $items .= 'getData(['theme','footer','legalPageId']) === '' ? ' class="displayNone" >' : '>'; + if ($this->getData(['theme','footer','legalPageId']) !== '') { + $items .= ' | Mentions légales'; + } + $items .= ''; + // Affichage du lien de connexion + if( ( $this->getData(['theme', 'footer', 'loginLink']) AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') From d4fb3bf48db3650b67164cddce3f3365aff2ca16 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sat, 22 Jun 2019 19:44:13 +0200 Subject: [PATCH 19/19] [9.1.14] footer sur 3 rangs --- core/layout/common.css | 1 + core/module/theme/theme.php | 23 ++++++++----- core/module/theme/view/footer/footer.js.php | 38 ++++++++++++--------- core/module/theme/view/footer/footer.php | 2 +- 4 files changed, 38 insertions(+), 26 deletions(-) diff --git a/core/layout/common.css b/core/layout/common.css index e532455f..a42eca8c 100755 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -584,6 +584,7 @@ footer { #footerDisplayCopyright, #footerDisplayVersion, #footerDisplaySiteMap, +#footerDisplayLegal, #footerZwiiCMS { font-size: inherit; } diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index c37e7423..b64f07be 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -70,17 +70,21 @@ class theme extends common { public static $footerblocks = [ 1 => [ 'hide' => 'Masqué', - 'center' => 'Affiché' - ] , 2 => [ + 'center' => 'Affiché' ], + 2 => [ 'hide' => 'Masqué', 'left' => 'Bloc Gauche', - 'right' => 'Bloc Droite' - ] , 3 => [ + 'right' => 'Bloc Droite' ], + 3 => [ 'hide' => 'Masqué', 'left' => 'Bloc Gauche', 'center' => 'Bloc Central', - 'right' => 'Bloc Droite' - ] + 'right' => 'Bloc Droite' ], + 4 => [ + 'hide' => 'Masqué', + 'top' => 'Bloc haut', + 'middle' => 'Bloc au milieu', + 'bottom' => 'Bloc inférieur' ] ]; public static $fontWeights = [ @@ -217,9 +221,10 @@ class theme extends common { '100% 100%' => 'Image étirée' ]; public static $footerTemplate = [ - '1' => 'Pleine page (100%)', - '2' => 'Deux colonnes ( 1/2 - 1/2)', - '3' => 'Trois colonnes (1/3 - 1/3 - 1/3)' + '1' => 'Colonne unique', + '2' => 'Colonnes, 2 bloc 50% - 50%', + '3' => 'Colonnes, 3 blocs 33% - 33% - 33%', + '4' => 'Trois lignes en pleine largeur' ]; /** diff --git a/core/module/theme/view/footer/footer.js.php b/core/module/theme/view/footer/footer.js.php index bb71f190..9e859d5d 100755 --- a/core/module/theme/view/footer/footer.js.php +++ b/core/module/theme/view/footer/footer.js.php @@ -119,6 +119,7 @@ $(".themeFooterContent").on("change",function() { $("#themeFooterTemplate").on("change",function() { // Nettoyage des sélecteurs des contenus var newOptions = { + 4: {'hide' : 'Masqué', 'top' : 'Bloc en haut', 'middle' : 'Bloc au milieu', 'bottom' : 'Bloc inférieur'} , 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é'} @@ -166,6 +167,23 @@ $("#themeFooterTemplate").on("change",function() { $("#footer" + position + "Center").addClass('col4'); $("#footer" + position + "Right").addClass('col4'); break; + case "4": + $("#footer" + position + "Left").css("display",""); + $("#footer" + position + "Left").removeAttr('class'); + $("#footer" + position + "Left").addClass('col12'); + //$("#footer" + position + "Left").css("footersite > " + "#footer" + position + "Left","order: " + $("#footer" + position + "Left").val() ); + + $("#footer" + position + "Center").css("display",""); + $("#footer" + position + "center").removeAttr('class'); + $("#footer" + position + "Center").addClass('col12'); + //$("#footer" + position + "Center").css("footersite > " + "#footer" + position + "Center","order: " + $("#footer" + position + "Left").val() ); + + $("#footer" + position + "Right").css("display",""); + $("#footer" + position + "Right").removeAttr('class'); + $("#footer" + position + "Right").addClass('col12'); + //$("#footer" + position + "Right").css("footersite > "+ "#footer" + position + "Right","order: " + $("#footer" + position + "Left").val() ); + break; + } }); @@ -183,7 +201,6 @@ $("#themeFooterSocialsPosition").on("change", function() { } } }).trigger("change"); - $("#themeFooterTextPosition").on("change", function() { if ($(this).prop('selectedIndex') >= 1 ) { if ( $("#themeFooterSocialsPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) { @@ -195,11 +212,9 @@ $("#themeFooterTextPosition").on("change", function() { $("#footerCopyright").hide(); } } - }).trigger("change"); $("#themeFooterCopyrightPosition").on("change", function() { - if ($(this).prop('selectedIndex') >= 1 ) { if ( $("#themeFooterTextPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) { $("#themeFooterTextPosition").prop('selectedIndex',0); @@ -210,7 +225,6 @@ $("#themeFooterCopyrightPosition").on("change", function() { $("#footerSocials").hide(); } } - }).trigger("change"); @@ -218,8 +232,10 @@ $("#themeFooterCopyrightPosition").on("change", function() { $("#themeFooterLegalCheck").on("change",function() { if($(this).is(":checked")) { $("#themeFooterLegalPageId").show(); + $("#footerDisplayLegal").show(); } else { $("#themeFooterLegalPageId").hide(); + $("#footerDisplayLegal").hide(); } }); @@ -236,10 +252,10 @@ $("#themeFooterLoginLink").on("change", function() { // Numéro de version $("#themefooterDisplayVersion").on("change", function() { if($(this).is(":checked")) { - $("#footerDisplayVersion").slideDown(); + $("#footerDisplayVersion").show(); } else { - $("#footerDisplayVersion").slideUp(); + $("#footerDisplayVersion").hide(); } }).trigger("change"); @@ -265,16 +281,6 @@ $("#themefooterDisplaySiteMap").on("change", function() { -// Numéro de version -$("#themefooterDisplayVersion").on("change", function() { - if($(this).is(":checked")) { - $("#footerDisplayVersion").show(); - } - else { - $("#footerDisplayVersion").hide(); - } -}).trigger("change"); - // Aperçu du texte $("#themeFooterText").on("change keydown keyup", function() { diff --git a/core/module/theme/view/footer/footer.php b/core/module/theme/view/footer/footer.php index ac1667d7..07463888 100755 --- a/core/module/theme/view/footer/footer.php +++ b/core/module/theme/view/footer/footer.php @@ -104,7 +104,7 @@ $footerBlockPosition = $module::$footerblocks [$this->getData(['theme', 'footer', 'template'])]; ?> 'Nombre de colonnes', + 'label' => 'Gabarits de mise en page', 'selected' => $this->getData(['theme', 'footer', 'template']), 'help' => 'Le changement de la mise en page entraîne la réinitalisation de la position des contenus.' ]); ?>