From 21887439e43eaaa9d34abdfaca47b40f99d3b67b Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Sat, 30 Oct 2021 18:42:00 +0200 Subject: [PATCH 01/12] fichier robots.txt absent des ressources suppriemr la copie --- core/core.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/core.php b/core/core.php index 37413657..4f9ee00d 100644 --- a/core/core.php +++ b/core/core.php @@ -945,15 +945,13 @@ class common { // Move flushed files to their final location. Compress if the option is enabled. $sitemap->finalize(); - // Update robots.txt file in output directory or create a new one + // Update robots.txt file in output directory if ($this->getData(['config','seo', 'robots']) === true) { unlink('robots.txt'); $sitemap->updateRobots(); - } else { - copy('core/module/install/ressource/robots.txt', 'robots.txt'); } - + // Submit your sitemaps to Google, Yahoo, Bing and Ask.com if (empty ($this->getData(['config','proxyType']) . $this->getData(['config','proxyUrl']) . ':' . $this->getData(['config','proxyPort'])) ) { $sitemap->submitSitemap(); From 9273e89431c9470e191fd2e9a92b21f67876f822 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 2 Nov 2021 12:54:56 +0100 Subject: [PATCH 02/12] bug copye site --- core/module/translate/translate.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/module/translate/translate.php b/core/module/translate/translate.php index 3c11a393..9a5a4a00 100644 --- a/core/module/translate/translate.php +++ b/core/module/translate/translate.php @@ -46,6 +46,7 @@ class translate extends common { // Création du dossier if (is_dir(self::DATA_DIR . $toCreate) === false ) { // Si le dossier est déjà créé $success = mkdir (self::DATA_DIR . $toCreate, 0755); + $success = mkdir (self::DATA_DIR . $toCreate.'/content', 0755); } else { $success = true; } @@ -53,6 +54,7 @@ class translate extends common { $success = (copy (self::DATA_DIR . $copyFrom . '/locale.json', self::DATA_DIR . $toCreate . '/locale.json') === true && $success === true) ? true : false; $success = (copy (self::DATA_DIR . $copyFrom . '/module.json', self::DATA_DIR . $toCreate . '/module.json') === true && $success === true) ? true : false; $success = (copy (self::DATA_DIR . $copyFrom . '/page.json', self::DATA_DIR . $toCreate . '/page.json') === true && $success === true) ? true : false; + $success = ($this->copyDir (self::DATA_DIR . $copyFrom . '/content', self::DATA_DIR . $toCreate . '/content') === true && $success === true) ? true : false; // Enregistrer la langue if ($success) { $this->setData(['config', 'i18n', $toCreate, 'site' ]); From e92100a0d8661ed1924af67ba40e9774e2587a0a Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 2 Nov 2021 18:46:51 +0100 Subject: [PATCH 03/12] Effet backup avec bouton wait --- core/module/config/view/backup/backup.css | 42 -------------------- core/module/config/view/backup/backup.js.php | 11 ++--- 2 files changed, 4 insertions(+), 49 deletions(-) diff --git a/core/module/config/view/backup/backup.css b/core/module/config/view/backup/backup.css index 8796d11b..af65af6d 100755 --- a/core/module/config/view/backup/backup.css +++ b/core/module/config/view/backup/backup.css @@ -16,45 +16,3 @@ * admin.css */ - -/** -* Effet d'animation -*/ -/* Start by setting display:none to make this hidden. - Then we position it in relation to the viewport window - with position:fixed. Width, height, top and left speak - for themselves. Background we set to 80% white with - our animation centered, and no-repeating */ -.modal { - display: none; - position: fixed; - z-index: 1000; - top: 0; - left: 0; - height: 100%; - width: 100%; - background: rgba( 0, 0, 0, .9 ) - url('core/module/config/ressource/ajax-loader.png') - 50% 45% - no-repeat; - } - -.alertMessage { - color: lightgrey; - display: none; - display: flex; - align-items: center; - justify-content: center; -} - - /* When the body has the loading class, we turn - the scrollbar off with overflow:hidden */ - body.loading .modal .alertMessage { - overflow: hidden; - } - - /* Anytime the body has the loading class, our - modal element will be visible */ - body.loading .modal .alertMessage { - display: block; - } diff --git a/core/module/config/view/backup/backup.js.php b/core/module/config/view/backup/backup.js.php index 7e564b07..cfa4a152 100644 --- a/core/module/config/view/backup/backup.js.php +++ b/core/module/config/view/backup/backup.js.php @@ -15,8 +15,7 @@ $( document).ready(function() { $("#configBackupSubmit").addClass("disabled").prop("disabled", true); e.preventDefault(); if ($("input[name=configBackupOption]").is(':checked')) { - $("body").addClass("loading"); - $(".modal").addClass("alertMessage"); + $('body').css('cursor', 'wait'); } var url = "getUrl(0); ?>/backup"; $.ajax({ @@ -24,17 +23,15 @@ $( document).ready(function() { url: url, data: $("form").serialize(), success: function(data){ - $("body").removeClass("loading"); + $('body').css('cursor', 'default'); core.alert("La sauvegarde a été générée avec succès."); }, error: function(data){ - $("body").removeClass("loading"); + + $('body').css('cursor', 'default'); core.alert("Une erreur s'est produite, la sauvegarde n'a pas été générée !"); }, complete: function(){ - if ($("input[name=configBackupOption]").is(':checked')) { - $(".modal").removeClass("alertMessage"); - } $("#configBackupSubmit").removeClass("disabled").prop("disabled", false); } }); From a0dc711cea0f884138535c2db9b429f611cce748 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Wed, 3 Nov 2021 16:30:48 +0100 Subject: [PATCH 04/12] changes --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index fa4a44ed..de459719 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,9 @@ # Changelog ## Version 11.1.01 +- Corrections : + - Langues : bug de l'utilitaire de copie de site. + - Fichier robots.txt non copié si absent. - Modifications : - Dispositions des écrans du thème : site, menu, pied de page, menu et bannière. From 3ce482598ecdbfc37e71d26a3e6b80dde9c60076 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Wed, 3 Nov 2021 17:24:34 +0100 Subject: [PATCH 05/12] Fix robots.txt --- CHANGES.md | 2 +- core/core.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index de459719..e45a5f8b 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,7 +3,7 @@ ## Version 11.1.01 - Corrections : - Langues : bug de l'utilitaire de copie de site. - - Fichier robots.txt non copié si absent. + - Fichier robots.txt non fourni lors les bots ne sont pas autorisés. - Modifications : - Dispositions des écrans du thème : site, menu, pied de page, menu et bannière. diff --git a/core/core.php b/core/core.php index 4f9ee00d..f8880fff 100644 --- a/core/core.php +++ b/core/core.php @@ -950,6 +950,8 @@ class common { if ($this->getData(['config','seo', 'robots']) === true) { unlink('robots.txt'); $sitemap->updateRobots(); + } else { + file_put_contents('robots.txt','User-agent: *' . PHP_EOL . 'Disallow: /'); } // Submit your sitemaps to Google, Yahoo, Bing and Ask.com From 77c48682e114a63fe37c24fe1d80059cc5427c81 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Wed, 3 Nov 2021 17:42:29 +0100 Subject: [PATCH 06/12] bug drapeaux --- core/module/config/config.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/module/config/config.php b/core/module/config/config.php index 87e751f4..2cd6a7e2 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -527,7 +527,18 @@ class config extends common { 'captcha' => $this->getInput('configAdvancedConnectCaptcha',helper::FILTER_BOOLEAN), ], 'i18n' => [ - 'enable' => $this->getData(['config', 'i18n', 'enable']) + 'enable' => $this->getData(['config', 'i18n', 'enable']), + 'scriptGoogle' => $this->getData(['config', 'i18n', 'scriptGoogle']), + 'showCredits' => $this->getData(['config', 'i18n', 'showCredits']), + 'autoDetect' => $this->getData(['config', 'i18n', 'autoDetect']), + 'admin' => $this->getData(['config', 'i18n', 'admin']), + 'fr' => $this->getData(['config', 'i18n', 'fr']), + 'de' => $this->getData(['config', 'i18n', 'de']), + 'en' => $this->getData(['config', 'i18n', 'en']), + 'es' => $this->getData(['config', 'i18n', 'es']), + 'it' => $this->getData(['config', 'i18n', 'it']), + 'nl' => $this->getData(['config', 'i18n', 'nl']), + 'pt' => $this->getData(['config', 'i18n', 'pt']) ] ] ]); From f8e15f3f5b99d0aa80f479fb2a66c960618a7948 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Fri, 5 Nov 2021 14:44:28 +0100 Subject: [PATCH 07/12] =?UTF-8?q?Bug=20page=20parent=20renomm=C3=A9e=20ave?= =?UTF-8?q?c=20des=20pages=20enfants=20absentes=20non=20affich=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/page/page.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/module/page/page.php b/core/module/page/page.php index 3ba16329..5bc2a94d 100644 --- a/core/module/page/page.php +++ b/core/module/page/page.php @@ -258,7 +258,7 @@ class page extends common { ]); } // Impossible de supprimer une page contenant des enfants - elseif($this->getHierarchy($url[0])) { + elseif($this->getHierarchy($url[0],null)) { // Valeurs en sortie $this->addOutput([ 'redirect' => helper::baseUrl() . 'page/edit/' . $url[0], @@ -326,7 +326,7 @@ class page extends common { $pageId = helper::increment($pageId, self::$coreModuleIds); $pageId = helper::increment($pageId, self::$moduleIds); // Met à jour les enfants - foreach($this->getHierarchy($this->getUrl(2)) as $childrenPageId) { + foreach($this->getHierarchy($this->getUrl(2),null) as $childrenPageId) { $this->setData(['page', $childrenPageId, 'parentPageId', $pageId]); } // Change l'id de page dans les données des modules @@ -377,7 +377,7 @@ class page extends common { } // Si la page est une page enfant, actualise les positions des autres enfants du parent, sinon actualise les pages sans parents $lastPosition = 1; - $hierarchy = $this->getInput('pageEditParentPageId') ? $this->getHierarchy($this->getInput('pageEditParentPageId')) : array_keys($this->getHierarchy()); + $hierarchy = $this->getInput('pageEditParentPageId') ? $this->getHierarchy($this->getInput('pageEditParentPageId'),null) : array_keys($this->getHierarchy()); $position = $this->getInput('pageEditPosition', helper::FILTER_INT); foreach($hierarchy as $hierarchyPageId) { // Ignore la page en cours de modification From 49b9dfd2f3aa190dadcfef49575b7eea0d66181d Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Fri, 5 Nov 2021 14:46:12 +0100 Subject: [PATCH 08/12] changes --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index e45a5f8b..44fecfe9 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ - Corrections : - Langues : bug de l'utilitaire de copie de site. - Fichier robots.txt non fourni lors les bots ne sont pas autorisés. + - Page parente ayant des pages enfants non affichées dans le menu : lors du renommage de la page, les pages enfants n'étaient pas actualisées. - Modifications : - Dispositions des écrans du thème : site, menu, pied de page, menu et bannière. From 2c613b7186180da4627d2403a69865c5aa30c787 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Fri, 5 Nov 2021 15:13:52 +0100 Subject: [PATCH 09/12] ne pas actualiser les positions des pages orphelines --- core/module/page/page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/module/page/page.php b/core/module/page/page.php index 5bc2a94d..07c153e6 100644 --- a/core/module/page/page.php +++ b/core/module/page/page.php @@ -377,7 +377,7 @@ class page extends common { } // Si la page est une page enfant, actualise les positions des autres enfants du parent, sinon actualise les pages sans parents $lastPosition = 1; - $hierarchy = $this->getInput('pageEditParentPageId') ? $this->getHierarchy($this->getInput('pageEditParentPageId'),null) : array_keys($this->getHierarchy()); + $hierarchy = $this->getInput('pageEditParentPageId') ? $this->getHierarchy($this->getInput('pageEditParentPageId')) : array_keys($this->getHierarchy()); $position = $this->getInput('pageEditPosition', helper::FILTER_INT); foreach($hierarchy as $hierarchyPageId) { // Ignore la page en cours de modification From 3b74d630d2fb9660e81562d33e22cef94ad19d62 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 9 Nov 2021 13:29:20 +0100 Subject: [PATCH 10/12] theme site bug option marges --- core/module/theme/view/site/site.js.php | 37 +++++++++---------------- 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/core/module/theme/view/site/site.js.php b/core/module/theme/view/site/site.js.php index fb5e4b77..5032dd69 100644 --- a/core/module/theme/view/site/site.js.php +++ b/core/module/theme/view/site/site.js.php @@ -11,35 +11,23 @@ * @link http://zwiicms.fr/ */ - /* - * Chargement de l'aperçu - */ -$(document).ready(function() { - - /** - * Option de marge si la taille n'est pas fluide - */ - if ($('#themeSiteWidth').val() === '100%') { - $("#themeSiteMargin").prop("checked", true); - $("#themeSiteMargin").addClass("disabled"); - } else { - $("#themeSiteMargin").addClass("enabled"); - } - - // Charger l'aperçu initial - previewDOM(); - -}); /** * Aperçu en direct */ $("input, select").on("change",function() { - previewDOM(); -}); -function previewDOM() { + /** + * Option de marge si la taille n'est pas fluide + */ + if ($('#themeSiteWidth').val() === '100%') { + console.log ("pop"); + $("#themeSiteMarginWrapper").prop("checked", true); + $("#themeSiteMarginWrapper").hide(); + } else { + $("#themeSiteMarginWrapper").show(); + } /** * Aperçu dans la boîte @@ -96,7 +84,6 @@ function previewDOM() { // Couleur ou image de fond var backgroundImage = getData(['theme','body','image'])); ?>; - console.log(backgroundImage); var backgroundcolor = getdata(['theme','body','backgroundColor'])); ?>; if(backgroundImage) { css += "div.bodybackground{background-image:url(" + backgroundImage + ");background-repeat:" + $("#themeBodyImageRepeat").val() + ";background-position:" + $("#themeBodyImagePosition").val() + ";background-attachment:" + $("#themeBodyImageAttachment").val() + ";background-size:" + $("#themeBodyImageSize").val() + "}"; @@ -125,4 +112,6 @@ function previewDOM() { .text(css) .appendTo("head"); -}; +}).trigger("change"); + + From 72a936e9ef6003f0531fcde1256a195d0bb660fd Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 12 Nov 2021 09:17:28 +0100 Subject: [PATCH 11/12] bug analytic --- core/core.js.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core.js.php b/core/core.js.php index f21a5f9d..ed7a8f87 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -223,7 +223,7 @@ core.start = function() { * Message sur l'utilisation des cookies */ var analytics = ""; - if (getData(['config', 'analyticsId'])); ?>) { + if (getData(['config', 'seo', 'analyticsId'])); ?>) { analytics = ' grâce au cookie Google Analytics' } if(getData(['config', 'cookieConsent'])); ?>) { From 9d76304aca3eabcfc3dbc4286bd7c5aa2ba31d2a Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 12 Nov 2021 09:24:53 +0100 Subject: [PATCH 12/12] class i18nFlag + ul --- core/core.php | 7 +++---- core/layout/common.css | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/core/core.php b/core/core.php index f8880fff..06ba6d46 100644 --- a/core/core.php +++ b/core/core.php @@ -2070,17 +2070,16 @@ class common { ( isset($_COOKIE['ZWII_I18N_SCRIPT']) AND $_COOKIE['ZWII_I18N_SCRIPT'] === $key ) ) { - $select = ' id="i18nFlagSelected" '; + $select = ' class="i18nFlagSelected" '; } else { - $select = ' id="i18nFlag" '; + $select = ' class="i18nFlag" '; } echo '
  • '; - echo ''; + echo ' .  $key . '; echo '
  • '; } } - echo ''; } } diff --git a/core/layout/common.css b/core/layout/common.css index bd6e8b5d..95ca7543 100755 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -697,11 +697,11 @@ li .menuSideChild { /* Drapeaux */ -#i18nFlag { +.i18nFlag { width: 70%; } -#i18nFlagSelected { +.i18nFlagSelected { width: 100%; } @@ -714,12 +714,12 @@ li .menuSideChild { @media screen and (max-width:1024px){ - #i18nFlag { + .i18nFlag { width: 100%; padding: 5px; } - #i18nFlagSelected { + .i18nFlagSelected { width: 130%; padding: 5px; }