Cascade changt de nom d'une barre

This commit is contained in:
fredtempez 2019-02-10 14:27:31 +01:00
parent 536a942306
commit 407c407b5b
1 changed files with 20 additions and 0 deletions

View File

@ -242,6 +242,26 @@ class page extends common {
'barRight' => $barRight
]
]);
// Barre renommée : changement le nom de la barre dans les pages mères
if ($this->getinput('pageEditBlock') === 'bar') {
echo '<pre>';
foreach ($this->getHierarchy() as $eachPageId=>$parentId) {
if ($this->getData(['page',$eachPageId,'barRight']) === $this->getUrl(2)) {
$this->setData(['page',$eachPageId,'barRight',$pageId]);
}
if ($this->getData(['page',$eachPageId,'barLeft']) === $this->getUrl(2)) {
$this->setData(['page',$eachPageId,'barLeft',$pageId]);
}
foreach ($parentId as $childId) {
if ($this->getData(['page',$childId,'barRight']) === $this->getUrl(2)) {
$this->setData(['page',$childId,'barRight',$pageId]);
}
if ($this->getData(['page',$childId,'barLeft']) === $this->getUrl(2)) {
$this->setData(['page',$childId,'barLeft',$pageId]);
}
}
}
}
// Redirection vers la configuration
if($this->getInput('pageEditModuleRedirect', helper::FILTER_BOOLEAN)) {
// Valeurs en sortie