From bd233245019849484e66be032c6bba1ccc9005bb Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 9 Nov 2021 18:38:37 +0100 Subject: [PATCH] feautre Banner css + show and hide options --- core/core.php | 3 ++ core/layout/main.php | 7 ++--- core/module/theme/theme.php | 2 +- core/module/theme/view/header/header.js.php | 14 ++++++++++ core/module/theme/view/header/header.php | 31 +++++++++++++-------- 5 files changed, 40 insertions(+), 17 deletions(-) diff --git a/core/core.php b/core/core.php index 1fbe9adb..33e76636 100644 --- a/core/core.php +++ b/core/core.php @@ -2256,6 +2256,9 @@ class core extends common { $colors = helper::colorVariants($this->getData(['theme', 'header', 'textColor'])); $css .= 'header span{color:' . $colors['normal'] . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'header', 'font'])) . '",sans-serif;font-weight:' . $this->getData(['theme', 'header', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'header', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'header', 'textTransform']) . '}'; } + if ($this->getData(['theme','header','feature']) === 'feature' ) { + $css .= 'header{height:' . $this->getData(['theme', 'header', 'height']) . ';}'; ; + } // Menu $colors = helper::colorVariants($this->getData(['theme', 'menu', 'backgroundColor'])); $css .= 'nav,nav.navMain a{background-color:' . $colors['normal'] . '}'; diff --git a/core/layout/main.php b/core/layout/main.php index 519f20b1..4c6207af 100644 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -74,7 +74,7 @@   - getData(['theme','header','content']);?> + getData(['theme','header','featureContent']);?> @@ -115,8 +115,7 @@ ): ?> getData(['theme','header','linkHomePage']) && $this->getData(['theme','header','feature']) === 'wallpaper' ) ? '' : ''; ?> -
+
getData(['theme','header','feature']) === 'wallpaper' ): ?>   - getData(['theme','header','content']);?> + getData(['theme','header','featureContent']);?>
diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index bc199963..c92a5aab 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -139,7 +139,7 @@ class theme extends common { ]; public static $headerFeatures = [ 'wallpaper' => 'Couleur unie ou papier-peint', - 'content' => 'Contenu personnalisé' + 'feature' => 'Contenu personnalisé' ]; public static $imagePositions = [ 'top left' => 'En haut à gauche', diff --git a/core/module/theme/view/header/header.js.php b/core/module/theme/view/header/header.js.php index 9dbcd2cc..c8f5991f 100644 --- a/core/module/theme/view/header/header.js.php +++ b/core/module/theme/view/header/header.js.php @@ -103,6 +103,7 @@ $("input, select").on("change", function() { else { css += 'header{margin:0}'; } + // Position de la bannière var positionNav = getData(['theme', 'menu', 'position'])); ?>; var positionHeader = $("#themeHeaderPosition").val(); @@ -222,3 +223,16 @@ $("#themeHeaderPosition").on("change", function() { $("#themeHeaderSmallDisplay").slideDown(); } }).trigger("change"); + +// Affiche les blocs selon le type bannière +$("#themeHeaderFeature").on("change", function() { + if($(this).val() === 'wallpaper') { + $(".wallpaperContainer").show(); + $(".featureContainer").hide(); + } + if($(this).val() === 'feature') { + $(".featureContainer").show(); + $(".wallpaperContainer").hide(); + + } +}).trigger("change"); diff --git a/core/module/theme/view/header/header.php b/core/module/theme/view/header/header.php index 896b0d2a..c2e584ab 100644 --- a/core/module/theme/view/header/header.php +++ b/core/module/theme/view/header/header.php @@ -17,20 +17,33 @@

Paramètres

-
+
'Nature de contenu', 'selected' => $this->getData(['theme', 'header', 'feature']) ]); ?>
-
+
'Position', 'selected' => $this->getData(['theme', 'header', 'position']) ]); ?>
+
+ 'Hauteur maximale', + 'selected' => $this->getData(['theme', 'header', 'height']), + 'help' => 'La hauteur maximale est de 600 pixels, même si les dimensions de l\'image sélectionnée sont supérieures.
Lorsque l\'adaptation est positionnée sur Responsive, la hauteur diminue proportionnellement à la largeur.' + ]); ?> +
+
+ 'Largeur', + 'selected' => $this->getData(['theme', 'header', 'container']) + ]); ?> +
-
- 'Largeur', - 'selected' => $this->getData(['theme', 'header', 'container']) - ]); ?> -
-
+

Couleurs

@@ -80,7 +87,7 @@
-
+

Mise en forme du titre

@@ -115,7 +122,7 @@
-
+

Papier peint

@@ -170,7 +177,7 @@
-
+

Contenu personnalisé