bug changement menu standard ou accessoire

This commit is contained in:
fredtempez 2022-03-09 09:15:47 +01:00
parent 66faa596dd
commit f4cc1af9ae
1 changed files with 8 additions and 7 deletions

View File

@ -388,14 +388,15 @@ class page extends common {
$lastPosition = 1; $lastPosition = 1;
$hierarchy = $this->getInput('pageEditParentPageId') ? $this->getHierarchy($this->getInput('pageEditParentPageId')) : array_keys($this->getHierarchy()); $hierarchy = $this->getInput('pageEditParentPageId') ? $this->getHierarchy($this->getInput('pageEditParentPageId')) : array_keys($this->getHierarchy());
$position = $this->getInput('pageEditPosition', helper::FILTER_INT); $position = $this->getInput('pageEditPosition', helper::FILTER_INT);
$extraPosition = $this->getinput('pageEditExtraPosition', helper::FILTER_BOOLEAN);
foreach($hierarchy as $hierarchyPageId) { foreach($hierarchy as $hierarchyPageId) {
// Ignore la page en cours de modification // Ne traite que les pages du menu sélectionné
if($hierarchyPageId === $this->getUrl(2) ) { if ($this->getData(['page', $hierarchyPageId, 'extraPosition']) === $extraPosition ) {
continue; // Ignore la page en cours de modification
} if($hierarchyPageId === $this->getUrl(2) ) {
// Ne traite que les pages du menu standard continue;
if ($this->getData(['page', $hierarchyPageId, 'extraPosition']) === false) { }
// Incrémente de +1 pour laisser la place à la position de la page en cours de modification // Incrémente de +1 pour laisser la place à la position de la page en cours de modification
if($lastPosition === $position) { if($lastPosition === $position) {
$lastPosition++; $lastPosition++;
@ -481,7 +482,7 @@ class page extends common {
'hideMenuSide' => $this->getinput('pageEditHideMenuSide', helper::FILTER_BOOLEAN), 'hideMenuSide' => $this->getinput('pageEditHideMenuSide', helper::FILTER_BOOLEAN),
'hideMenuHead' => $this->getinput('pageEditHideMenuHead', helper::FILTER_BOOLEAN), 'hideMenuHead' => $this->getinput('pageEditHideMenuHead', helper::FILTER_BOOLEAN),
'hideMenuChildren' => $this->getinput('pageEditHideMenuChildren', helper::FILTER_BOOLEAN), 'hideMenuChildren' => $this->getinput('pageEditHideMenuChildren', helper::FILTER_BOOLEAN),
'extraPosition' => $this->getinput('pageEditExtraPosition', helper::FILTER_BOOLEAN) 'extraPosition' => $extraPosition
] ]
]); ]);