From efe2c50d4d2cc8b7c49611bdb9081fbe54fa7de4 Mon Sep 17 00:00:00 2001 From: tDidierjean Date: Mon, 23 Apr 2012 15:06:32 +0000 Subject: [PATCH] [-] BO : fix #PSTEST-697 - remove cancel button in category list git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14823 b9a71923-0436-4b27-9f14-aed3839534dd --- .../admin/AdminCategoriesController.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php index 7c2e623ae..e1a07cee2 100644 --- a/controllers/admin/AdminCategoriesController.php +++ b/controllers/admin/AdminCategoriesController.php @@ -234,14 +234,8 @@ class AdminCategoriesControllerCore extends AdminController 'href' => self::$currentIndex.'&update'.$this->table.'&id_category='.(int)Tools::getValue('id_category').'&token='.$this->token, 'desc' => $this->l('Edit') ); - $back = Tools::safeOutput(Tools::getValue('back', '')); - if (empty($back)) - $back = self::$currentIndex.'&token='.$this->token; - $this->toolbar_btn['cancel'] = array( - 'href' => $back, - 'desc' => $this->l('Cancel') - ); } + if ($this->display == 'view') $this->toolbar_btn['new'] = array( 'href' => self::$currentIndex.'&add'.$this->table.'&id_parent='.(int)Tools::getValue('id_category').'&token='.$this->token, @@ -258,6 +252,17 @@ class AdminCategoriesControllerCore extends AdminController 'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token.$id_category, 'desc' => $this->l('Add new') ); + + if (Tools::isSubmit('id_category')) + { + $back = Tools::safeOutput(Tools::getValue('back', '')); + if (empty($back)) + $back = self::$currentIndex.'&token='.$this->token; + $this->toolbar_btn['back'] = array( + 'href' => $back, + 'desc' => $this->l('Back to list') + ); + } } }