bulle aide + filtre orphelines

This commit is contained in:
Fred Tempez 2020-09-14 21:15:55 +02:00
parent 084b5c73c5
commit 659bc7f922
1 changed files with 15 additions and 7 deletions

View File

@ -150,10 +150,18 @@
$pages = $this->getData(['page']); $pages = $this->getData(['page']);
foreach($pages as $page => $pageId) { foreach($pages as $page => $pageId) {
if ($this->getData(['page',$page,'block']) === 'bar' || if ($this->getData(['page',$page,'block']) === 'bar' ||
$this->getData(['page',$page,'disable']) === true) { $this->getData(['page',$page,'disable']) === true) {
unset($pages[$page]); unset($pages[$page]);
} }
} }
$orphans = $this->getData(['page']);
foreach($orphans as $page => $pageId) {
if ($this->getData(['page',$page,'block']) === 'bar' ||
$this->getData(['page',$page,'disable']) === true ||
$this->getdata(['page',$page, 'position']) !== 0) {
unset($orphans[$page]);
}
}
echo template::select('configHomePageId', helper::arrayCollumn($pages, 'title', 'SORT_ASC'), [ echo template::select('configHomePageId', helper::arrayCollumn($pages, 'title', 'SORT_ASC'), [
'label' => 'Accueil du site', 'label' => 'Accueil du site',
'selected' =>$this->getData(['config', 'homePageId']), 'selected' =>$this->getData(['config', 'homePageId']),
@ -178,26 +186,26 @@
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
<?php <?php
echo template::select('configPage403', array_merge(['none' => 'Aucune'],helper::arrayCollumn($pages, 'title', 'SORT_ASC')), [ echo template::select('configPage403', array_merge(['none' => 'Aucune'],helper::arrayCollumn($orphans, 'title', 'SORT_ASC')), [
'label' => 'Accès interdit, erreur 403', 'label' => 'Accès interdit, erreur 403',
'selected' =>$this->getData(['config', 'page403']), 'selected' =>$this->getData(['config', 'page403']),
'help' => 'Une page 403 ne doit pas apparaître dans l\'arborescence du menu. Créez et éditez une page orpheline.' 'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php <?php
echo template::select('configPage404', array_merge(['none' => 'Aucune'],helper::arrayCollumn($pages, 'title', 'SORT_ASC')), [ echo template::select('configPage404', array_merge(['none' => 'Aucune'],helper::arrayCollumn($orphans, 'title', 'SORT_ASC')), [
'label' => 'Page inexistante, erreur 404', 'label' => 'Page inexistante, erreur 404',
'selected' =>$this->getData(['config', 'page404']), 'selected' =>$this->getData(['config', 'page404']),
'help' => 'Une page 404 ne doit pas apparaître dans l\'arborescence du menu. Créez et éditez une page orpheline.' 'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php <?php
echo template::select('configPage302', array_merge(['none' => 'Aucune'],helper::arrayCollumn($pages, 'title', 'SORT_ASC')), [ echo template::select('configPage302', array_merge(['none' => 'Aucune'],helper::arrayCollumn($orphans, 'title', 'SORT_ASC')), [
'label' => 'Site en maintenance', 'label' => 'Site en maintenance',
'selected' =>$this->getData(['config', 'page302']), 'selected' =>$this->getData(['config', 'page302']),
'help' => 'Page de maintenance personnalisable' 'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
]); ?> ]); ?>
</div> </div>
</div> </div>