Commit inital

This commit is contained in:
Fred Tempez 2020-08-12 18:19:54 +02:00
parent b3cdc71b8d
commit 03620979b6
4 changed files with 63 additions and 25 deletions

View File

@ -1954,11 +1954,15 @@ 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']));
} 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'] === '') {
if($this->output['title']) {

View File

@ -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),

View File

@ -29,21 +29,7 @@
<div class="block">
<h4>Informations générales</h4>
<div class="row">
<div class="col4">
<?php
$pages = $this->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'])
]); ?>
</div>
<div class="col8">
<div class="col12">
<?php echo template::text('configTitle', [
'label' => 'Titre du site',
'value' => $this->getData(['config', 'title']),
@ -60,6 +46,29 @@
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php
$pages = $this->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'])
]); ?>
</div>
<div class="col6">
<?php
echo template::select('configPage404', helper::arrayCollumn($pages, 'title', 'SORT_ASC'), [
'label' => 'Page 404',
'selected' =>$this->getData(['config', 'page404'])
]); ?>
</div>
</div
</div>
</div>
</div>

View File

@ -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' => '<h1 style=\"text-align: center;\">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' => [