diff --git a/core/core.php b/core/core.php index 8f83cace..ce1961fb 100755 --- a/core/core.php +++ b/core/core.php @@ -1954,10 +1954,14 @@ class core extends common { } elseif($this->output['content'] === '') { http_response_code(404); - $this->addOutput([ - 'title' => 'Erreur 404', - 'content' => template::speech('Oups ! La page demandée est introuvable...') - ]); + if ($this->getData(['config','page404'])) { + header('Location:' . helper::baseUrl() . $this->getData(['config','page404'])); + } else { + $this->addOutput([ + 'title' => 'Erreur 404', + 'content' => template::speech('Oups ! La page demandée est introuvable...') + ]); + } } // Mise en forme des métas if($this->output['metaTitle'] === '') { diff --git a/core/module/config/config.php b/core/module/config/config.php index 07881941..4a12da33 100755 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -424,6 +424,7 @@ class config extends common { 'config', [ 'homePageId' => $this->getInput('configHomePageId', helper::FILTER_ID, true), + 'page404' => $this->getInput('configPage404', helper::FILTER_ID, true), '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 a5d149c4..4611a2d3 100755 --- a/core/module/config/view/index/index.php +++ b/core/module/config/view/index/index.php @@ -29,21 +29,7 @@

Informations générales

-
- 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']) - ]); ?> -
-
+
'Titre du site', 'value' => $this->getData(['config', 'title']), @@ -60,6 +46,29 @@ ]); ?>
+
+
+ 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']) + ]); ?> +
+
+ 'Page 404', + 'selected' =>$this->getData(['config', 'page404']) + ]); ?> +
+
diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 5e7397a1..666c05d1 100755 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -9,6 +9,7 @@ class init extends common { 'favicon' => 'favicon.ico', 'faviconDark' => 'faviconDark.ico', 'homePageId' => 'accueil', + 'page404' => 'erreur-404', 'maintenance' => false, 'social' => [ 'facebookId' => 'facebook', @@ -24,15 +25,15 @@ class init extends common { 'legalPageId' => 'mentions-legales', '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 !', - 'proxyUrl' => "", - 'proxyPort' => "", - 'proxyType' => "tcp://", + 'proxyUrl' => '', + 'proxyPort' => '', + 'proxyType' => 'tcp://', 'smtp' => [ 'enable' => false, ], - "connect" => [ - "timeout" => 600, - "attempt" => 3, + 'connect' => [ + 'timeout' => 600, + 'attempt' => 3, 'log' => false ] ], @@ -537,6 +538,29 @@ class init extends common { 'hideMenuSide' => false, 'hideMenuHead' => false, 'hideMenuChildren' => false + ],'erreur-404'=> [ + 'typeMenu' => 'text', + 'iconUrl' => '', + 'disable' => false, + 'content' => '

Page introuvable !<\/h1>', + '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' => [