From f4cc1af9ae7d159f168534090bd10adf13255305 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 9 Mar 2022 09:15:47 +0100 Subject: [PATCH] bug changement menu standard ou accessoire --- core/module/page/page.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/core/module/page/page.php b/core/module/page/page.php index e88d259c..9b3f3eee 100644 --- a/core/module/page/page.php +++ b/core/module/page/page.php @@ -388,14 +388,15 @@ class page extends common { $lastPosition = 1; $hierarchy = $this->getInput('pageEditParentPageId') ? $this->getHierarchy($this->getInput('pageEditParentPageId')) : array_keys($this->getHierarchy()); $position = $this->getInput('pageEditPosition', helper::FILTER_INT); + $extraPosition = $this->getinput('pageEditExtraPosition', helper::FILTER_BOOLEAN); foreach($hierarchy as $hierarchyPageId) { - // Ignore la page en cours de modification - if($hierarchyPageId === $this->getUrl(2) ) { - continue; - } - // Ne traite que les pages du menu standard - if ($this->getData(['page', $hierarchyPageId, 'extraPosition']) === false) { + // Ne traite que les pages du menu sélectionné + if ($this->getData(['page', $hierarchyPageId, 'extraPosition']) === $extraPosition ) { + // Ignore la page en cours de modification + if($hierarchyPageId === $this->getUrl(2) ) { + continue; + } // Incrémente de +1 pour laisser la place à la position de la page en cours de modification if($lastPosition === $position) { $lastPosition++; @@ -481,7 +482,7 @@ class page extends common { 'hideMenuSide' => $this->getinput('pageEditHideMenuSide', helper::FILTER_BOOLEAN), 'hideMenuHead' => $this->getinput('pageEditHideMenuHead', helper::FILTER_BOOLEAN), 'hideMenuChildren' => $this->getinput('pageEditHideMenuChildren', helper::FILTER_BOOLEAN), - 'extraPosition' => $this->getinput('pageEditExtraPosition', helper::FILTER_BOOLEAN) + 'extraPosition' => $extraPosition ] ]);