From 0f85512bb84e000a9b2f1411613d691c00270ce0 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sat, 30 Jan 2021 12:25:03 +0100 Subject: [PATCH 1/7] Bug page null dans les modules --- CHANGES.md | 3 +++ core/core.php | 17 +++++++++++------ core/module/install/ressource/defaultdata.php | 12 +----------- core/module/page/page.php | 6 ++++-- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 5b4873e3..19895ff3 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,9 @@ # Changelog ## version 10.4.00 +Corrections : + - Bug de pages non accessibles dans le menu suite à la création d'entrées fantômes dans le fichier de données de modules. + - Nettoyage du fichiers des données de modules des entrées fantômes. - Modifications : - Filtrage des URL générées par facebook (FBCLID) occasionnant une erreur 404 - Captcha arithmétique, activation recommandée dans la configuration. diff --git a/core/core.php b/core/core.php index 3af6c1ab..f654b20a 100755 --- a/core/core.php +++ b/core/core.php @@ -44,7 +44,7 @@ class common { const ACCESS_TIMER = 1800; // Numéro de version - const ZWII_VERSION = '10.4.00.013'; + const ZWII_VERSION = '10.4.00.014'; const ZWII_UPDATE_CHANNEL = "v10"; public static $actions = []; @@ -1499,12 +1499,8 @@ class common { foreach ($pageList as $parentKey => $parent) { //La page est un blog if ($this->getData(['page',$parent,'moduleId']) === 'blog' ) { - //echo "
".$parent;
 					$articleIds = array_keys(helper::arrayCollumn($this->getData(['module', $parent, 'posts']), 'publishedOn', 'SORT_DESC'));
-					//var_dump($articleIds);
 					foreach ($articleIds as $key => $article) {
-						//echo $article;
-						//echo "

"; // Droits les deux groupes $this->setData(['module', $parent, 'posts', $article,'editConsent', 3]); // Limite de taille 500 @@ -1542,7 +1538,6 @@ class common { $path = realpath('site/data'); foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $filename) { - echo "$filename
"; if (strpos($filename,'back.json')) { rename($filename, str_replace('back.json','backup.json',$filename)); } @@ -1556,6 +1551,16 @@ class common { unlink('module/search/ressource/vartheme.css'); $this->deleteData(['theme','search','keywordColor']); + // Nettoyer les modules avec des données null + + $modules = $this->getData(['module']); + foreach($modules as $key => $value) { + if (is_null($value) ) { + unset($modules[$key]); + } + } + $this->setData (['module',$modules]); + $this->setData(['core', 'dataVersion', 10400]); /** diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index c6ef26dd..1993a80c 100755 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -781,17 +781,7 @@ class init extends common { 'values' => '' ] ] - ], - 'locale' => [ - 'homePageId' => 'accueil', - 'page302' => 'erreur302', - 'page403' => 'erreur403', - 'page404' => 'erreur404', - 'legalPageId' => 'mentions-legales', - 'searchPageId' => 'recherche', - 'metaDescription' => 'Zwii est un CMS sans base de données qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.', - 'title' => 'Votre site en quelques clics !' - ], + ] ] ]; } diff --git a/core/module/page/page.php b/core/module/page/page.php index 53372e8a..88e6b37f 100755 --- a/core/module/page/page.php +++ b/core/module/page/page.php @@ -317,8 +317,10 @@ class page extends common { $this->setData(['page', $childrenPageId, 'parentPageId', $pageId]); } // Change l'id de page dans les données des modules - $this->setData(['module', $pageId, $this->getData(['module', $this->getUrl(2)])]); - $this->deleteData(['module', $this->getUrl(2)]); + if ($this->getData(['module', $this->getUrl(2)]) !== null ) { + $this->setData(['module', $pageId, $this->getData(['module', $this->getUrl(2)])]); + $this->deleteData(['module', $this->getUrl(2)]); + } // Si la page correspond à la page d'accueil, change l'id dans la configuration du site if($this->getData(['locale', 'homePageId']) === $this->getUrl(2)) { $this->setData(['locale', 'homePageId', $pageId]); From 3b8b09df590c761984a87099be6cbd5ad7268c47 Mon Sep 17 00:00:00 2001 From: Prof Langues Date: Thu, 4 Feb 2021 16:41:54 +0100 Subject: [PATCH 2/7] =?UTF-8?q?015=20Effets=20d'agrandissements=20de=20l'i?= =?UTF-8?q?mage=20en=20arri=C3=A8re=20plan=20lorsque=20la=20page=20s'?= =?UTF-8?q?=C3=A9tire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.php | 21 ++++++++++++++------- core/module/theme/view/body/body.js.php | 7 ++++--- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/core/core.php b/core/core.php index f654b20a..3f47ba4d 100755 --- a/core/core.php +++ b/core/core.php @@ -44,7 +44,7 @@ class common { const ACCESS_TIMER = 1800; // Numéro de version - const ZWII_VERSION = '10.4.00.014'; + const ZWII_VERSION = '10.4.00.015'; const ZWII_UPDATE_CHANNEL = "v10"; public static $actions = []; @@ -1647,20 +1647,27 @@ class core extends common { $css = '/*' . md5(json_encode($this->getData(['theme']))) . '*/'; // Import des polices de caractères $css .= '@import url("https://fonts.googleapis.com/css?family=' . $this->getData(['theme', 'text', 'font']) . '|' . $this->getData(['theme', 'title', 'font']) . '|' . $this->getData(['theme', 'header', 'font']) . '|' . $this->getData(['theme', 'menu', 'font']) . '");'; - // Fond du site + // Fond du body $colors = helper::colorVariants($this->getData(['theme', 'body', 'backgroundColor'])); - $css .= 'body,div.mce-edit-area{background-color:' . $colors['normal'] . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'text', 'font'])) . '",sans-serif}'; - // Fond TinyMCe - $css .= 'div.mce-edit-area{background-color:' . $colors['normal'] . ' !important}'; + // Body + $css .= 'body{font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'text', 'font'])) . '",sans-serif}'; if($themeBodyImage = $this->getData(['theme', 'body', 'image'])) { - $css .= 'body,div.mce-edit-area{background-image:url("../file/source/' . $themeBodyImage . '");background-position:' . $this->getData(['theme', 'body', 'imagePosition']) . ';background-attachment:' . $this->getData(['theme', 'body', 'imageAttachment']) . ';background-size:' . $this->getData(['theme', 'body', 'imageSize']) . ';background-repeat:' . $this->getData(['theme', 'body', 'imageRepeat']) . '}'; - $css .= 'div.mce-edit-area{background-image:url("../file/source/' . $themeBodyImage . '") !important;background-position:' . $this->getData(['theme', 'body', 'imagePosition']) . ';background-attachment:' . $this->getData(['theme', 'body', 'imageAttachment']) . ';background-size:' . $this->getData(['theme', 'body', 'imageSize']) . ';background-repeat:' . $this->getData(['theme', 'body', 'imageRepeat']) . '}'; + // Image dans html pour éviter les déformations. + $css .= 'html{background-image:url("../file/source/' . $themeBodyImage . '");background-position:' . $this->getData(['theme', 'body', 'imagePosition']) . ';background-attachment:' . $this->getData(['theme', 'body', 'imageAttachment']) . ';background-size:' . $this->getData(['theme', 'body', 'imageSize']) . ';background-repeat:' . $this->getData(['theme', 'body', 'imageRepeat']) . '}'; + // Couleur du body transparente + $css .= 'body{background-color: rgba(0,0,0,0)}'; + } else { + // Pas d'image couleur du body + $css .= 'html{background-color:' . $colors['normal'] . ';}'; } // Icône BacktoTop $css .= '#backToTop {background-color:' .$this->getData(['theme', 'body', 'toTopbackgroundColor']). ';color:'.$this->getData(['theme', 'body', 'toTopColor']).';}'; // Site $colors = helper::colorVariants($this->getData(['theme', 'text', 'linkColor'])); $css .= 'a{color:' . $colors['normal'] . '}'; + // Fond TinyMCe + $css .= 'div.mce-edit-area{background-color:' . $colors['normal'] . ' !important}'; + $css .= 'div.mce-edit-area{background-color:' . $colors['normal'] . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'text', 'font'])) . '",sans-serif}'; //$css .= 'a:hover:not(.inputFile, button){color:' . $colors['darken'] . '}'; $css .= 'body,.row > div{font-size:' . $this->getData(['theme', 'text', 'fontSize']) . '}'; $css .= 'body{color:' . $this->getData(['theme', 'text', 'textColor']) . '}'; diff --git a/core/module/theme/view/body/body.js.php b/core/module/theme/view/body/body.js.php index 4b46e333..cf08898d 100755 --- a/core/module/theme/view/body/body.js.php +++ b/core/module/theme/view/body/body.js.php @@ -22,14 +22,15 @@ $(document).ready(function(){ */ $("input, select").on("change", function() { // Couleur du fond - var css = "body{background-color:" + $("#themeBodyBackgroundColor").val() + "}"; + var css = "html{background-color:" + $("#themeBodyBackgroundColor").val() + "}"; // Image du fond var themeBodyImage = $("#themeBodyImage").val(); if(themeBodyImage) { - css += "body{background-image:url('site/file/source/" + themeBodyImage + "');background-repeat:" + $("#themeBodyImageRepeat").val() + ";background-position:" + $("#themeBodyImagePosition").val() + ";background-attachment:" + $("#themeBodyImageAttachment").val() + ";background-size:" + $("#themeBodyImageSize").val() + "}"; + css += "html{background-image:url('site/file/source/" + themeBodyImage + "');background-repeat:" + $("#themeBodyImageRepeat").val() + ";background-position:" + $("#themeBodyImagePosition").val() + ";background-attachment:" + $("#themeBodyImageAttachment").val() + ";background-size:" + $("#themeBodyImageSize").val() + "}"; + css += "html{background-color:rgba(0,0,0,0);}"; } else { - css += "body{background-image:none}"; + css += "html{background-image:none}"; } css += '#backToTop {background-color:' + $("#themeBodyToTopBackground").val() + ';color:' + $("#themeBodyToTopColor").val() + ';}'; From 3facabaeca969c8cd57ad507774265abb2512b6f Mon Sep 17 00:00:00 2001 From: Prof Langues Date: Thu, 4 Feb 2021 16:52:37 +0100 Subject: [PATCH 3/7] =?UTF-8?q?Form=202.6=20Caract=C3=A8res=20sp=C3=A9ciau?= =?UTF-8?q?x=20mal=20affich=C3=A9s=20dans=20les=20noms=20des=20champs=20?= =?UTF-8?q?=20du=20formulaire=20lors=20de=20l'=C3=A9dition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/form/form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/form/form.php b/module/form/form.php index 955f40f0..5dc1f5c8 100755 --- a/module/form/form.php +++ b/module/form/form.php @@ -94,7 +94,7 @@ class form extends common { $inputs = []; foreach($this->getInput('formConfigPosition', null) as $index => $position) { $inputs[] = [ - 'name' => $this->getInput('formConfigName[' . $index . ']'), + 'name' => htmlspecialchars_decode($this->getInput('formConfigName[' . $index . ']'),ENT_QUOTES), 'position' => helper::filter($position, helper::FILTER_INT), 'required' => $this->getInput('formConfigRequired[' . $index . ']', helper::FILTER_BOOLEAN), 'type' => $this->getInput('formConfigType[' . $index . ']'), From f6c1e2a9f371e0aba51252f837f4fd1801224165 Mon Sep 17 00:00:00 2001 From: Prof Langues Date: Thu, 4 Feb 2021 16:55:29 +0100 Subject: [PATCH 4/7] =?UTF-8?q?Form=20num=C3=A9ro=20de=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/form/form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/form/form.php b/module/form/form.php index 5dc1f5c8..3b17c1f4 100755 --- a/module/form/form.php +++ b/module/form/form.php @@ -32,7 +32,7 @@ class form extends common { public static $pagination; - const FORM_VERSION = '2.5'; + const FORM_VERSION = '2.6'; // Objets const TYPE_MAIL = 'mail'; From 2935a4dd8ea71f09bb792f18b114960b93c5768b Mon Sep 17 00:00:00 2001 From: Prof Langues Date: Fri, 5 Feb 2021 10:07:58 +0100 Subject: [PATCH 5/7] =?UTF-8?q?Active=20la=20position=20fixe=20sur=20conta?= =?UTF-8?q?in=20ou=20cover=20dans=20l'image=20d'arri=C3=A8re=20plan?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/theme/view/body/body.js.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/module/theme/view/body/body.js.php b/core/module/theme/view/body/body.js.php index cf08898d..19a42926 100755 --- a/core/module/theme/view/body/body.js.php +++ b/core/module/theme/view/body/body.js.php @@ -21,6 +21,15 @@ $(document).ready(function(){ * Aperçu en direct */ $("input, select").on("change", function() { + + // Option fixe pour contain et cover + var themeBodyImageSize = $("#themeBodyImageSize").val(); + + if(themeBodyImageSize === "cover" || + themeBodyImageSize === "contain" ) { + $("#themeBodyImageAttachment").val("fixed"); + } + // Couleur du fond var css = "html{background-color:" + $("#themeBodyBackgroundColor").val() + "}"; // Image du fond From 17a7b6376131850484db8f2e0a56f1cbbcbfbb96 Mon Sep 17 00:00:00 2001 From: Prof Langues Date: Fri, 5 Feb 2021 11:23:08 +0100 Subject: [PATCH 6/7] =?UTF-8?q?Bug=20s=C3=A9lecteur=20de=20fichier=20label?= =?UTF-8?q?=20de=20type=20block=20plut=C3=B4t=20que=20inline-block?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/layout/common.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/layout/common.css b/core/layout/common.css index d96e1334..04f43261 100755 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -1158,7 +1158,7 @@ textarea { } label { - display: inline-block; + display: block; margin-bottom: 4px; } From e9c3c2ba220d23f0ab51e794bede4ee257490fbd Mon Sep 17 00:00:00 2001 From: Prof Langues Date: Fri, 5 Feb 2021 11:28:58 +0100 Subject: [PATCH 7/7] Changes --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 19895ff3..e1a6c91c 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,9 @@ Corrections : - Bug de pages non accessibles dans le menu suite à la création d'entrées fantômes dans le fichier de données de modules. - Nettoyage du fichiers des données de modules des entrées fantômes. + - Thème : déformation des images en arrière-plan dans les modes responsives cover et contain lorsque la longueur de la page change. L'image en arrière-plan est désormais placée dans la balise html et l'option fixe s'active lorsque cover ou contain sont sélectionnés. + - Thème : déformation du sélecteur de fichiers dans certains formats de page. + - Module Form : mauvais affichage du guillemet et de l'apostrophe dans les noms des champs lors de l'édition. - Modifications : - Filtrage des URL générées par facebook (FBCLID) occasionnant une erreur 404 - Captcha arithmétique, activation recommandée dans la configuration.