Skip to content

Commit

Permalink
Add tab for new, update and remove navigation item
Browse files Browse the repository at this point in the history
refs #5543
  • Loading branch information
lippserd committed Sep 30, 2015
1 parent f3f7fa3 commit 8cff607
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
12 changes: 3 additions & 9 deletions application/controllers/NavigationController.php
Expand Up @@ -202,7 +202,6 @@ public function addAction()
$form->setRedirectUrl('navigation');
$form->setUser($this->Auth()->getUser());
$form->setItemTypes($this->listItemTypes());
$form->setTitle($this->translate('Create New Navigation Item'));
$form->addDescription($this->translate('Create a new navigation item, such as a menu entry or dashlet.'));

// TODO: Fetch all "safe" parameters from the url and populate them
Expand Down Expand Up @@ -231,8 +230,7 @@ public function addAction()
});
$form->handleRequest();

$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('New Navigation Item'));
}

/**
Expand All @@ -256,7 +254,6 @@ public function editAction()
$form->setShareConfig(Config::navigation($itemType));
$form->setUserConfig(Config::navigation($itemType, $itemOwner));
$form->setRedirectUrl($referrer === 'shared' ? 'navigation/shared' : 'navigation');
$form->setTitle(sprintf($this->translate('Edit %s %s'), $this->getItemLabel($itemType), $itemName));
$form->setOnSuccess(function (NavigationConfigForm $form) use ($itemName) {
$data = array_map(
function ($v) {
Expand Down Expand Up @@ -293,8 +290,7 @@ function ($v) {
$this->httpNotFound(sprintf($this->translate('Navigation item "%s" not found'), $itemName));
}

$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('Update Navigation Item'));
}

/**
Expand All @@ -313,7 +309,6 @@ public function removeAction()

$form = new ConfirmRemovalForm();
$form->setRedirectUrl('navigation');
$form->setTitle(sprintf($this->translate('Remove %s %s'), $this->getItemLabel($itemType), $itemName));
$form->setOnSuccess(function (ConfirmRemovalForm $form) use ($itemName, $navigationConfigForm) {
try {
$itemConfig = $navigationConfigForm->delete($itemName);
Expand All @@ -338,8 +333,7 @@ public function removeAction()
});
$form->handleRequest();

$this->view->form = $form;
$this->render('form');
$this->renderForm($form, $this->translate('Remove Navigation Item'));
}

/**
Expand Down
6 changes: 0 additions & 6 deletions application/views/scripts/navigation/form.phtml

This file was deleted.

0 comments on commit 8cff607

Please sign in to comment.