From 407c407b5b112bbf2b7d34570be66312f009f354 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sun, 10 Feb 2019 14:27:31 +0100 Subject: [PATCH] Cascade changt de nom d'une barre --- core/module/page/page.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/core/module/page/page.php b/core/module/page/page.php index 90f1848f..d2f6c627 100755 --- a/core/module/page/page.php +++ b/core/module/page/page.php @@ -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 '
';
+					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