From 5ca13a9b0d76c681ba10dd6e0b8461e1e7b96dab Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sat, 11 May 2019 22:23:55 +0200 Subject: [PATCH 1/3] [9.1.04] Commentaires footer --- core/core.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/core.php b/core/core.php index d6f40cb5..8bfcd270 100644 --- a/core/core.php +++ b/core/core.php @@ -1888,14 +1888,14 @@ class layout extends common { * Affiche le copyright */ public function showCopyright() { - // Bloc copyright + // Ouverture Bloc copyright $items = '
'; $items .= ''; // Affichage de motorisé par $items .= 'getData(['theme','footer','displayCopyright']) === false ? 'class="displayNone"' : ''; $items .= '>Motorisé par '; - // Toujours affiche le nom du CMS + // Toujours afficher le nom du CMS $items .= ''; $items .= 'ZwiiCMS'; $items .= ''; @@ -1904,7 +1904,7 @@ class layout extends common { $items .= $this->getData(['theme','footer','displayVersion']) === false ? 'class="displayNone"' : ''; $items .= '> '. common::ZWII_VERSION ; $items .= ''; - // Afifchage du lien de connexion + // Affichage du lien de connexion $items .= 'getData(['theme','footer','displaySiteMap']) === false? 'class="displayNone"' : ''; $items .= '> | Plan du site'; From 665b66f2bfd4d0e18971850c35f3e8c0e8e7816d Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sat, 11 May 2019 23:31:37 +0200 Subject: [PATCH 2/3] [9.1.04] header responsive test continuing --- core/core.php | 8 ++++---- core/module/theme/view/header/header.js.php | 9 +++++---- core/module/theme/view/header/header.php | 21 ++++++++++++--------- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/core/core.php b/core/core.php index 8bfcd270..7394fcb9 100644 --- a/core/core.php +++ b/core/core.php @@ -1006,16 +1006,16 @@ class core extends common { $css .= ';height: 0; padding-top:'; $css .= ( $sizes[1] / $sizes[0] )* 100; $css .= '%'; - } else { + //} else { // Le fichier n'existe plus // largeur par défaut - $css .= ';height: 150px;'; + // $css .= ';height: 150px; line-height: 150px;'; } } else { // Valeur de hauteur traditionnelle - $css .= ';height:' . $this->getData(['theme', 'header', 'height']); + $css .= ';height:' . $this->getData(['theme', 'header', 'height']) . ';line-height:' . $this->getData(['theme', 'header', 'height']) ; } - $css .= ';line-height:' . $this->getData(['theme', 'header', 'height']) . ';text-align:' . $this->getData(['theme', 'header', 'textAlign']) . '}'; + $css .= ';text-align:' . $this->getData(['theme', 'header', 'textAlign']) . '}'; if($themeHeaderImage = $this->getData(['theme', 'header', 'image'])) { $css .= 'header{background-image:url("../file/source/' . $themeHeaderImage . '");background-position:' . $this->getData(['theme', 'header', 'imagePosition']) . ';background-repeat:' . $this->getData(['theme', 'header', 'imageRepeat']) . '}'; } diff --git a/core/module/theme/view/header/header.js.php b/core/module/theme/view/header/header.js.php index bbc4a551..937d404b 100755 --- a/core/module/theme/view/header/header.js.php +++ b/core/module/theme/view/header/header.js.php @@ -23,16 +23,16 @@ $("input, select").on("change", function() { var css = "@import url('https://fonts.googleapis.com/css?family=" + headerFont + "');"; // Couleurs, image, alignement et hauteur de la bannière - css += "header{background-color:" + $("#themeHeaderBackgroundColor").val() + ";text-align:" + $("#themeHeaderTextAlign").val() + ";line-height:" + $("#themeHeaderHeight").val(); + css += "header{background-color:" + $("#themeHeaderBackgroundColor").val() + ";text-align:" + $("#themeHeaderTextAlign").val() + ";"; // Hauteur proportionnelle var themeHeaderHeight = $("#themeHeaderHeight").val(); var widthSize = $("#themeHeaderImageWidth").val(); var heightSize = $("#themeHeaderImageHeight").val(); if (themeHeaderHeight === "none" ) { - css += ";height: 0; padding-top:" + (heightSize / widthSize ) * 100 + "%;}"; + css += "height: 0; padding-top:" + (heightSize / widthSize ) * 100 + "%}"; } else { - css += ";height:" + themeHeaderHeight + ";}"; + css += ";line-height:" + $("#themeHeaderHeight").val() + ";height:" + themeHeaderHeight + "}"; } var themeHeaderImage = $("#themeHeaderImage").val(); @@ -47,7 +47,7 @@ $("input, select").on("change", function() { css += "header{background-size:" + $("#themeHeaderImageContainer").val() + "}"; -console.log(css); +console.log(widthSize + "-" + heightSize + ' ' + themeHeaderImage ); // Taille, couleur, épaisseur et capitalisation du titre de la bannière @@ -145,6 +145,7 @@ $("#themeHeaderImage").on("change", function() { }); } }).trigger("change"); + // Affiche / Cache les options de la position $("#themeHeaderPosition").on("change", function() { if($(this).val() === 'site') { diff --git a/core/module/theme/view/header/header.php b/core/module/theme/view/header/header.php index 1dcf7720..ac2c6ebe 100755 --- a/core/module/theme/view/header/header.php +++ b/core/module/theme/view/header/header.php @@ -40,16 +40,19 @@

Image

getData(['theme','header','image'])); - echo template::text('themeHeaderImageWidth', [ - 'value' => $sizes [0], - 'noDirty' => true - ]); - echo template::text('themeHeaderImageHeight', [ - 'value' => $sizes [1], - 'noDirty' => true - ]); $imageFile = file_exists('site/file/source/'.$this->getData(['theme', 'header', 'image'])) ? $this->getData(['theme', 'header', 'image']) : ""; + if ($this->getData(['theme', 'header', 'image']) && + $imageFile !== '') { + $sizes = getimagesize('site/file/source/'.$this->getData(['theme','header','image'])); + echo template::text('themeHeaderImageWidth', [ + 'value' => $sizes [0], + 'noDirty' => true + ]); + echo template::text('themeHeaderImageHeight', [ + 'value' => $sizes [1], + 'noDirty' => true + ]); + } echo template::file('themeHeaderImage', [ 'label' => 'Fond', 'type' => 1, From d315060e0a39afe9671bead78746bdb1be77b6c3 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sun, 12 May 2019 09:03:50 +0200 Subject: [PATCH 3/3] =?UTF-8?q?[9.1.04]=20aper=C3=A7u=20dans=20le=20header?= =?UTF-8?q?=20=20travail=20en=20cours?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/theme/view/header/header.js.php | 79 +++++++++++++-------- core/module/theme/view/header/header.php | 20 +++--- 2 files changed, 58 insertions(+), 41 deletions(-) diff --git a/core/module/theme/view/header/header.js.php b/core/module/theme/view/header/header.js.php index 937d404b..31edd996 100755 --- a/core/module/theme/view/header/header.js.php +++ b/core/module/theme/view/header/header.js.php @@ -12,12 +12,35 @@ +// Récupérer les dimensions de l'image et les place dans des champs cachés +$("#themeHeaderImage").on("change", function() { + if($(this).val() !== '') { + var tmpImg = new Image(); + var url = "" + "site/file/source/" + $("#themeHeaderImage").val(); + tmpImg.src= url; + $(tmpImg).on('load',function(){ + $("#themeHeaderImageWidth").val(tmpImg.width); + $("#themeHeaderImageHeight").val(tmpImg.height); + }); + } else { + $("#themeHeaderImageWidth").val(0); + $("#themeHeaderImageHeight").val(0); + } + console.log ("imagesize"); +}).trigger("change"); + /** * Aperçu en direct */ $("input, select").on("change", function() { + var themeHeaderHeight = $("#themeHeaderHeight").val(); + var widthSize = $("#themeHeaderImageWidth").val(); + var heightSize = $("#themeHeaderImageHeight").val(); + var themeHeaderImage = $("#themeHeaderImage").val(); + + // Import des polices de caractères var headerFont = $("#themeHeaderFont").val(); var css = "@import url('https://fonts.googleapis.com/css?family=" + headerFont + "');"; @@ -26,28 +49,36 @@ $("input, select").on("change", function() { css += "header{background-color:" + $("#themeHeaderBackgroundColor").val() + ";text-align:" + $("#themeHeaderTextAlign").val() + ";"; // Hauteur proportionnelle - var themeHeaderHeight = $("#themeHeaderHeight").val(); - var widthSize = $("#themeHeaderImageWidth").val(); - var heightSize = $("#themeHeaderImageHeight").val(); - if (themeHeaderHeight === "none" ) { - css += "height: 0; padding-top:" + (heightSize / widthSize ) * 100 + "%}"; - } else { - css += ";line-height:" + $("#themeHeaderHeight").val() + ";height:" + themeHeaderHeight + "}"; - } - var themeHeaderImage = $("#themeHeaderImage").val(); + + // Une imge est sélectionnée if(themeHeaderImage) { - css += "header{background-image:url('site/file/source/" + themeHeaderImage + "');background-repeat:" + $("#themeHeaderImageRepeat").val() + ";background-position:" + $("#themeHeaderImagePosition").val() + "}"; - } - else { - css += "header{background-image:none}"; - } - // Adaptation de la bannière - css += "header{background-size:" + $("#themeHeaderImageContainer").val() + "}"; + + css += "background-image:url('site/file/source/" + themeHeaderImage + "');background-repeat:" + $("#themeHeaderImageRepeat").val() + ";background-position:" + $("#themeHeaderImagePosition").val() + ";"; + // Adaptation de la bannière + css += "background-size:" + $("#themeHeaderImageContainer").val() + ";"; + // Position responsive + if (themeHeaderHeight === "none" ) { + + css += "height: 0; padding-top:" + (heightSize / widthSize ) * 100 + "%;"; + + console.log(widthSize + "-" + heightSize + ' ' + themeHeaderImage ); + //console.log(css); + } else { + css += "line-height:" + $("#themeHeaderHeight").val() + ";height:" + themeHeaderHeight + ";"; + } + + }else { + + css += "background-image:none;"; + // Forcer la sélection 150px + $("#themeHeaderHeight option:eq(2)").prop("selected", true); + + } + css += "}"; -console.log(widthSize + "-" + heightSize + ' ' + themeHeaderImage ); // Taille, couleur, épaisseur et capitalisation du titre de la bannière @@ -119,20 +150,6 @@ $("#themeHeaderHeight").on("change", function() { } }).trigger("change"); -// Récupérer les dimensions de l'image et les place dans des champs cachés -$("#themeHeaderImage").on("change", function() { - if($(this).val() !== '') { - var tmpImg = new Image(); - var url = "" + "site/file/source/" + $("#themeHeaderImage").val(); - tmpImg.src= url; - $(tmpImg).on('load',function(){ - $("#themeHeaderImageWidth").val(tmpImg.width); - $("#themeHeaderImageHeight").val(tmpImg.height); - }); - } -}).trigger("change"); - - // Affiche / Cache les options de l'image du fond $("#themeHeaderImage").on("change", function() { diff --git a/core/module/theme/view/header/header.php b/core/module/theme/view/header/header.php index ac2c6ebe..4bfa4027 100755 --- a/core/module/theme/view/header/header.php +++ b/core/module/theme/view/header/header.php @@ -43,16 +43,16 @@ $imageFile = file_exists('site/file/source/'.$this->getData(['theme', 'header', 'image'])) ? $this->getData(['theme', 'header', 'image']) : ""; if ($this->getData(['theme', 'header', 'image']) && $imageFile !== '') { - $sizes = getimagesize('site/file/source/'.$this->getData(['theme','header','image'])); - echo template::text('themeHeaderImageWidth', [ - 'value' => $sizes [0], - 'noDirty' => true - ]); - echo template::text('themeHeaderImageHeight', [ - 'value' => $sizes [1], - 'noDirty' => true - ]); - } + $sizes = getimagesize('site/file/source/'.$this->getData(['theme','header','image'])); + } + echo template::hidden('themeHeaderImageWidth', [ + 'value' => $sizes [0], + 'noDirty' => true + ]); + echo template::hidden('themeHeaderImageHeight', [ + 'value' => $sizes [1], + 'noDirty' => true + ]); echo template::file('themeHeaderImage', [ 'label' => 'Fond', 'type' => 1,