From 44d1ed0982834cec409fd59e648a31f09f61f68f Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Tue, 12 Nov 2013 10:45:17 +0100 Subject: [PATCH] // Add category name to page header title --- controllers/admin/AdminCategoriesController.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php index 6ee52154d..823c8e0ce 100644 --- a/controllers/admin/AdminCategoriesController.php +++ b/controllers/admin/AdminCategoriesController.php @@ -160,16 +160,25 @@ class AdminCategoriesControllerCore extends AdminController public function initPageHeaderToolbar() { - if (empty($this->display)) - { + parent::initPageHeaderToolbar(); + + if ($this->display != 'add') $this->page_header_toolbar_btn['new_category'] = array( 'href' => self::$currentIndex.'&addcategory&token='.$this->token, 'desc' => $this->l('Add new category'), 'icon' => 'process-icon-new' ); - } - parent::initPageHeaderToolbar(); + if ($this->display == 'view') + { + array_pop($this->toolbar_title); + $obj = $this->loadObject(); + + if (Validate::isLoadedObject($obj)) + $this->toolbar_title[] = $obj->name[$this->context->employee->id_lang]; + + $this->page_header_toolbar_title = implode(' '.Configuration::get('PS_NAVIGATION_PIPE').' ', $this->toolbar_title); + } } public function initContent()