filtre liste de page à éditer

This commit is contained in:
fredtempez 2019-01-04 21:51:21 +01:00
parent acd65e7e2d
commit 418173956b
3 changed files with 35 additions and 14 deletions

View File

@ -176,6 +176,38 @@ class common {
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => 'Contact'
],
'blockRight' => [
'typeMenu' => 'text',
'iconUrl' => '',
'disable' => false,
'content' => '<p>Bloc à droite du site</p>',
'hideTitle' => false,
'metaDescription' => '',
'metaTitle' => '',
'moduleId' => '',
'modulePosition' => '',
'parentPageId' => '',
'position' => 0,
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => 'blockRight'
],
'blockLeft' => [
'typeMenu' => 'text',
'iconUrl' => '',
'disable' => false,
'content' => '<p>Bloc à gauche du site</p>',
'hideTitle' => false,
'metaDescription' => '',
'metaTitle' => '',
'moduleId' => '',
'modulePosition' => '',
'parentPageId' => '',
'position' => 0,
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => 'blockLeft'
]
],
'module' => [
@ -996,8 +1028,6 @@ class common {
// Version 9.0.0
if($this->getData(['core', 'dataVersion']) < 900) {
$this->setData(['theme', 'site', 'blocks','100']);
$this->setData(['page', 'blockLeft', 'content','']);
$this->setData(['page', 'blockRight', 'content','']);
$this->setData(['core', 'dataVersion', 900]);
$this->SaveData();
}
@ -2136,8 +2166,8 @@ class layout extends common {
$leftItems .= '<option value="">Choisissez une page</option>';
$currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2);
foreach($this->getHierarchy(null, false) as $parentPageId => $childrenPageIds) {
if ($this->getData(['page', $parentPageId, 'title']) === 'blockLeft'
OR $this->getData(['page', $parentPageId, 'title']) === 'blockRight') { continue; }
if ($this->getData(['page', $parentPageId]) === 'blockLeft'
OR $this->getData(['page', $parentPageId]) === 'blockRight') { continue; }
$leftItems .= '<option value="' . helper::baseUrl() . $parentPageId . '"' . ($parentPageId === $currentPageId ? ' selected' : false) . '>' . $this->getData(['page', $parentPageId, 'title']) . '</option>';
foreach($childrenPageIds as $childKey) {
$leftItems .= '<option value="' . helper::baseUrl() . $childKey . '"' . ($childKey === $currentPageId ? ' selected' : false) . '>&nbsp;&nbsp;&nbsp;&nbsp;' . $this->getData(['page', $childKey, 'title']) . '</option>';

View File

@ -75,7 +75,6 @@ class page extends common {
* Suppression
*/
public function delete() {
if($this->isPost()) {
// La page n'existe pas
if($this->getData(['page', $this->getUrl(2)]) === null) {
// Valeurs en sortie
@ -110,12 +109,6 @@ class page extends common {
'state' => true
]);
}
} else {
// Valeurs en sortie
$this->addOutput([
'access' => false
]);
}
}

View File

@ -55,8 +55,7 @@
</div>
</div>
<div class="row">
<div class="col6">
<div class="col6">
<?php echo template::select('pageTypeMenu', $module::$typeMenu,[
'help' => 'Sélectionnez le type de menu.',
'label' => 'Type de menu',
@ -64,7 +63,6 @@
]); ?>
</div>
<div class="col6">
<?php echo template::file('pageIconUrl', [
'label' => 'Icône',
'value' => $this->getData(['page', $this->getUrl(2), 'iconUrl'])