From a7376f7f177caa4984e0c702e31eea736f37911a Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Thu, 13 Aug 2020 09:47:58 +0200 Subject: [PATCH] =?UTF-8?q?Choix=20aucune=20page=20personnalis=C3=A9e=20ve?= =?UTF-8?q?rsion=2010.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 10 ++-- core/core.php | 20 ++++--- core/module/config/config.php | 3 +- core/module/config/view/index/index.php | 57 +++++++++---------- core/module/install/ressource/defaultdata.php | 23 -------- 5 files changed, 48 insertions(+), 65 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 56652276..09d9fda3 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,15 +1,15 @@ # Changelog -## version 10.2.07 +## version 10.3.00 - Corrections : - Bloquage de l'incrémentation de l'id de page lorsque deux pages ont le même nom. - Login : l'option "Se souvenir de moi" est fonctionnelle. - Menu : déplacement de la classe "active". - Modifications : - - Configuration : sauvegarde du site dans une archive : animation d'attente avec message de confirmation ou d'erreur. - - Configuration : le nom de l'archive prend le nom du sous-domaine s'il existe. - - Captcha : correction du nom de la fonction (capcha en captcha). - - Captcha : addition présentée en lettres, réponse en chiffres. + - Configuration du site : + - Page 404 personnalisable + - Sauvegarde du site dans une archive : animation d'attente avec message de confirmation ou d'erreur. ; le nom de l'archive prend le nom du sous-domaine s'il existe. + - Captcha : addition présentée en lettres sous la forme d'images, réponse en chiffres ; correction du nom de la fonction (capcha en captcha). ## version 10.2.06 - Corrections : diff --git a/core/core.php b/core/core.php index ce1961fb..7cb527f6 100755 --- a/core/core.php +++ b/core/core.php @@ -39,7 +39,7 @@ class common { const ACCESS_TIMER = 1800; // Numéro de version - const ZWII_VERSION = '10.2.07'; + const ZWII_VERSION = '10.3.00'; const ZWII_UPDATE_CHANNEL = "v10"; public static $actions = []; @@ -1356,6 +1356,12 @@ class common { $this->deleteData(['theme','footer','displayMemberLogout']); $this->setData(['core', 'dataVersion', 10201]); } + // Version 10.3.00 + if ($this->getData(['core', 'dataVersion']) < 10300) { + // Options de barre de membre simple + $this->setData(['config','page404','none']); + $this->setData(['core', 'dataVersion', 10300]); + } } } @@ -1954,13 +1960,13 @@ class core extends common { } elseif($this->output['content'] === '') { http_response_code(404); - if ($this->getData(['config','page404'])) { - header('Location:' . helper::baseUrl() . $this->getData(['config','page404'])); + if ( $this->getData(['config','page404']) === 'none') { + $this->addOutput([ + 'title' => 'Erreur 404', + 'content' => template::speech('Oups ! La page demandée est introuvable...') + ]); } else { - $this->addOutput([ - 'title' => 'Erreur 404', - 'content' => template::speech('Oups ! La page demandée est introuvable...') - ]); + header('Location:' . helper::baseUrl() . $this->getData(['config','page404'])); } } // Mise en forme des métas diff --git a/core/module/config/config.php b/core/module/config/config.php index 4a12da33..ffb5b577 100755 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -419,12 +419,13 @@ class config extends common { } else { $legalPageId = ''; } + $this->getInput('configPage404'); // Sauvegarder $this->setData([ 'config', [ 'homePageId' => $this->getInput('configHomePageId', helper::FILTER_ID, true), - 'page404' => $this->getInput('configPage404', helper::FILTER_ID, true), + 'page404' => $this->getInput('configPage404'), 'analyticsId' => $this->getInput('configAnalyticsId'), 'autoBackup' => $this->getInput('configAutoBackup', helper::FILTER_BOOLEAN), 'maintenance' => $this->getInput('configMaintenance', helper::FILTER_BOOLEAN), diff --git a/core/module/config/view/index/index.php b/core/module/config/view/index/index.php index 4611a2d3..c840bc7e 100755 --- a/core/module/config/view/index/index.php +++ b/core/module/config/view/index/index.php @@ -47,28 +47,36 @@
-
- getData(['page']); - foreach($pages as $page => $pageId) { - if ($this->getData(['page',$page,'block']) === 'bar' || - $this->getData(['page',$page,'disable']) === true) { - unset($pages[$page]); +
+ getData(['page']); + foreach($pages as $page => $pageId) { + if ($this->getData(['page',$page,'block']) === 'bar' || + $this->getData(['page',$page,'disable']) === true) { + unset($pages[$page]); + } } - } - echo template::select('configHomePageId', helper::arrayCollumn($pages, 'title', 'SORT_ASC'), [ - 'label' => 'Page d\'accueil', - 'selected' =>$this->getData(['config', 'homePageId']) + echo template::select('configHomePageId', helper::arrayCollumn($pages, 'title', 'SORT_ASC'), [ + 'label' => 'Page d\'accueil', + 'selected' =>$this->getData(['config', 'homePageId']) ]); ?>
-
- 'Page 404', - 'selected' =>$this->getData(['config', 'page404']) - ]); ?> -
-
+ 'Aucune'],helper::arrayCollumn($pages, 'title', 'SORT_ASC')), [ + 'label' => 'Page d\'erreur 404 personnalisée', + 'selected' =>$this->getData(['config', 'page404']), + 'help' => 'Une page 404 ne doit pas apparaître dans l\'arborescence du menu. Créez puis sélectionnez une page orpheline.' + ]); ?> +
+
+ 'Sélectionner'] , helper::arrayCollumn($this->getData(['page']), 'title', 'SORT_ASC') ) , [ + 'label' => 'Mentions légales', + 'selected' => $this->getData(['config', 'legalPageId']), + 'help' => 'Les mentions légales sont obligatoires en France.' + ]); ?> +
+ @@ -110,16 +118,7 @@ 'help' => 'Le fuseau horaire est utile au bon référencement' ]); ?> -
- 'Sélectionner'] , helper::arrayCollumn($this->getData(['page']), 'title', 'SORT_ASC') ); - ?> - 'Mentions légales', - 'selected' => $this->getData(['config', 'legalPageId']), - 'help' => 'Les mentions légales sont obligatoires en France' - ]); ?> -
-
+
$this->getData(['config', 'cookieConsent']) ]); ?> diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 839ab60f..dc189880 100755 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -538,29 +538,6 @@ class init extends common { 'hideMenuSide' => false, 'hideMenuHead' => false, 'hideMenuChildren' => false - ],'erreur-404'=> [ - 'typeMenu' => 'text', - 'iconUrl' => '', - 'disable' => false, - 'content' => '

Page introuvable !

', - 'hideTitle' => false, - 'breadCrumb' => false, - 'metaDescription' => '', - 'metaTitle' => '', - 'moduleId' => '', - 'modulePosition' => 'bottom', - 'parentPageId' => '', - 'position' => 0, - 'group' => 0, - 'targetBlank' => false, - 'title' => 'Erreur 404', - 'block' => '12', - 'barLeft' => '', - 'barRight' => '', - 'displayMenu' => 'none', - 'hideMenuSide' => false, - 'hideMenuHead' => false, - 'hideMenuChildren' => false ] ], 'module' => [