From 8cff607b5db4e4d5b8e1544e7de4b91ad6eeffd9 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 1 Oct 2015 00:40:54 +0200 Subject: [PATCH] Add tab for new, update and remove navigation item refs #5543 --- application/controllers/NavigationController.php | 12 +++--------- application/views/scripts/navigation/form.phtml | 6 ------ 2 files changed, 3 insertions(+), 15 deletions(-) delete mode 100644 application/views/scripts/navigation/form.phtml diff --git a/application/controllers/NavigationController.php b/application/controllers/NavigationController.php index 689a123cf6..c251f61eb4 100644 --- a/application/controllers/NavigationController.php +++ b/application/controllers/NavigationController.php @@ -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 @@ -231,8 +230,7 @@ public function addAction() }); $form->handleRequest(); - $this->view->form = $form; - $this->render('form'); + $this->renderForm($form, $this->translate('New Navigation Item')); } /** @@ -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) { @@ -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')); } /** @@ -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); @@ -338,8 +333,7 @@ public function removeAction() }); $form->handleRequest(); - $this->view->form = $form; - $this->render('form'); + $this->renderForm($form, $this->translate('Remove Navigation Item')); } /** diff --git a/application/views/scripts/navigation/form.phtml b/application/views/scripts/navigation/form.phtml deleted file mode 100644 index cbf06590d6..0000000000 --- a/application/views/scripts/navigation/form.phtml +++ /dev/null @@ -1,6 +0,0 @@ -
- showOnlyCloseButton(); ?> -
-
- -
\ No newline at end of file