diff --git a/CHANGES.md b/CHANGES.md index 6e497c53..eab85b66 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,12 @@ - Activation et désactivation de la déconnexion automatique empêchant plusieurs sessions avec le même compte. ## 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. + - 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. diff --git a/core/core.php b/core/core.php index e2ac309a..62d3d27a 100755 --- a/core/core.php +++ b/core/core.php @@ -1532,12 +1532,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 @@ -1575,7 +1571,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)); } @@ -1589,6 +1584,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]); } @@ -1697,20 +1702,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/layout/common.css b/core/layout/common.css index 283c6883..af2c7e2e 100755 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -1149,7 +1149,7 @@ textarea { } label { - display: inline-block; + display: block; margin-bottom: 4px; } diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 974dd756..69ccf251 100755 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -808,17 +808,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]); diff --git a/core/module/theme/view/body/body.js.php b/core/module/theme/view/body/body.js.php index 4b46e333..19a42926 100755 --- a/core/module/theme/view/body/body.js.php +++ b/core/module/theme/view/body/body.js.php @@ -21,15 +21,25 @@ $(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 = "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() + ';}'; diff --git a/module/form/form.php b/module/form/form.php index 955f40f0..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'; @@ -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 . ']'),