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,10 +1954,14 @@ class core extends common {
} }
elseif($this->output['content'] === '') { elseif($this->output['content'] === '') {
http_response_code(404); http_response_code(404);
$this->addOutput([ if ($this->getData(['config','page404'])) {
'title' => 'Erreur 404', header('Location:' . helper::baseUrl() . $this->getData(['config','page404']));
'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...')
]);
}
} }
// Mise en forme des métas // Mise en forme des métas
if($this->output['metaTitle'] === '') { if($this->output['metaTitle'] === '') {

View File

@ -424,6 +424,7 @@ class config extends common {
'config', 'config',
[ [
'homePageId' => $this->getInput('configHomePageId', helper::FILTER_ID, true), 'homePageId' => $this->getInput('configHomePageId', helper::FILTER_ID, true),
'page404' => $this->getInput('configPage404', helper::FILTER_ID, true),
'analyticsId' => $this->getInput('configAnalyticsId'), 'analyticsId' => $this->getInput('configAnalyticsId'),
'autoBackup' => $this->getInput('configAutoBackup', helper::FILTER_BOOLEAN), 'autoBackup' => $this->getInput('configAutoBackup', helper::FILTER_BOOLEAN),
'maintenance' => $this->getInput('configMaintenance', helper::FILTER_BOOLEAN), 'maintenance' => $this->getInput('configMaintenance', helper::FILTER_BOOLEAN),

View File

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

View File

@ -9,6 +9,7 @@ class init extends common {
'favicon' => 'favicon.ico', 'favicon' => 'favicon.ico',
'faviconDark' => 'faviconDark.ico', 'faviconDark' => 'faviconDark.ico',
'homePageId' => 'accueil', 'homePageId' => 'accueil',
'page404' => 'erreur-404',
'maintenance' => false, 'maintenance' => false,
'social' => [ 'social' => [
'facebookId' => 'facebook', 'facebookId' => 'facebook',
@ -24,15 +25,15 @@ class init extends common {
'legalPageId' => 'mentions-legales', '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.', '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 !', 'title' => 'Votre site en quelques clics !',
'proxyUrl' => "", 'proxyUrl' => '',
'proxyPort' => "", 'proxyPort' => '',
'proxyType' => "tcp://", 'proxyType' => 'tcp://',
'smtp' => [ 'smtp' => [
'enable' => false, 'enable' => false,
], ],
"connect" => [ 'connect' => [
"timeout" => 600, 'timeout' => 600,
"attempt" => 3, 'attempt' => 3,
'log' => false 'log' => false
] ]
], ],
@ -537,6 +538,29 @@ class init extends common {
'hideMenuSide' => false, 'hideMenuSide' => false,
'hideMenuHead' => false, 'hideMenuHead' => false,
'hideMenuChildren' => 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' => [ 'module' => [