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, 'group' => self::GROUP_VISITOR,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Contact' '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' => [ 'module' => [
@ -996,8 +1028,6 @@ class common {
// Version 9.0.0 // Version 9.0.0
if($this->getData(['core', 'dataVersion']) < 900) { if($this->getData(['core', 'dataVersion']) < 900) {
$this->setData(['theme', 'site', 'blocks','100']); $this->setData(['theme', 'site', 'blocks','100']);
$this->setData(['page', 'blockLeft', 'content','']);
$this->setData(['page', 'blockRight', 'content','']);
$this->setData(['core', 'dataVersion', 900]); $this->setData(['core', 'dataVersion', 900]);
$this->SaveData(); $this->SaveData();
} }
@ -2136,8 +2166,8 @@ class layout extends common {
$leftItems .= '<option value="">Choisissez une page</option>'; $leftItems .= '<option value="">Choisissez une page</option>';
$currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2); $currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2);
foreach($this->getHierarchy(null, false) as $parentPageId => $childrenPageIds) { foreach($this->getHierarchy(null, false) as $parentPageId => $childrenPageIds) {
if ($this->getData(['page', $parentPageId, 'title']) === 'blockLeft' if ($this->getData(['page', $parentPageId]) === 'blockLeft'
OR $this->getData(['page', $parentPageId, 'title']) === 'blockRight') { continue; } OR $this->getData(['page', $parentPageId]) === 'blockRight') { continue; }
$leftItems .= '<option value="' . helper::baseUrl() . $parentPageId . '"' . ($parentPageId === $currentPageId ? ' selected' : false) . '>' . $this->getData(['page', $parentPageId, 'title']) . '</option>'; $leftItems .= '<option value="' . helper::baseUrl() . $parentPageId . '"' . ($parentPageId === $currentPageId ? ' selected' : false) . '>' . $this->getData(['page', $parentPageId, 'title']) . '</option>';
foreach($childrenPageIds as $childKey) { foreach($childrenPageIds as $childKey) {
$leftItems .= '<option value="' . helper::baseUrl() . $childKey . '"' . ($childKey === $currentPageId ? ' selected' : false) . '>&nbsp;&nbsp;&nbsp;&nbsp;' . $this->getData(['page', $childKey, 'title']) . '</option>'; $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 * Suppression
*/ */
public function delete() { public function delete() {
if($this->isPost()) {
// La page n'existe pas // La page n'existe pas
if($this->getData(['page', $this->getUrl(2)]) === null) { if($this->getData(['page', $this->getUrl(2)]) === null) {
// Valeurs en sortie // Valeurs en sortie
@ -110,12 +109,6 @@ class page extends common {
'state' => true 'state' => true
]); ]);
} }
} else {
// Valeurs en sortie
$this->addOutput([
'access' => false
]);
}
} }

View File

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