Skip to content

Commit

Permalink
NavigationController: Redirect to the shared overview if its the refe…
Browse files Browse the repository at this point in the history
…rrer..

..when editing a navigation item.

refs #5600
  • Loading branch information
Johannes Meyer committed Sep 23, 2015
1 parent 6aecfe6 commit 4d303e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion application/controllers/NavigationController.php
Expand Up @@ -188,9 +188,10 @@ public function addAction()
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());
Expand Down
5 changes: 4 additions & 1 deletion application/views/scripts/navigation/shared.phtml
Expand Up @@ -24,7 +24,10 @@
<td><?= $this->qlink(
$name,
'navigation/edit',
array('name' => $name),
array(
'name' => $name,
'referrer' => 'shared'
),
array(
'title' => sprintf($this->translate('Edit shared navigation item %s'), $name)
)
Expand Down

0 comments on commit 4d303e7

Please sign in to comment.