From 4d303e7121678745a6ec26c31d78c8666fca8f63 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 23 Sep 2015 14:21:04 +0200 Subject: [PATCH] NavigationController: Redirect to the shared overview if its the referrer.. ..when editing a navigation item. refs #5600 --- application/controllers/NavigationController.php | 3 ++- application/views/scripts/navigation/shared.phtml | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/application/controllers/NavigationController.php b/application/controllers/NavigationController.php index 335b05adc..2519647b2 100644 --- a/application/controllers/NavigationController.php +++ b/application/controllers/NavigationController.php @@ -188,9 +188,10 @@ class NavigationController extends Controller public function editAction() { $itemName = $this->params->getRequired('name'); + $referrer = $this->params->get('referrer', 'index'); $form = new NavigationConfigForm(); - $form->setRedirectUrl('navigation'); + $form->setRedirectUrl($referrer === 'shared' ? 'navigation/shared' : 'navigation'); $form->setItemTypes($this->listItemTypes()); $form->setTitle(sprintf($this->translate('Edit Navigation Item %s'), $itemName)); $form->setUser($this->Auth()->getUser()); diff --git a/application/views/scripts/navigation/shared.phtml b/application/views/scripts/navigation/shared.phtml index 7f148e3e3..939249f84 100644 --- a/application/views/scripts/navigation/shared.phtml +++ b/application/views/scripts/navigation/shared.phtml @@ -24,7 +24,10 @@ qlink( $name, 'navigation/edit', - array('name' => $name), + array( + 'name' => $name, + 'referrer' => 'shared' + ), array( 'title' => sprintf($this->translate('Edit shared navigation item %s'), $name) )