From 62b4a3cd5ed9fa4592fcea49c90d3f0a814379da Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Tue, 27 Aug 2013 18:42:24 +0200 Subject: [PATCH] [+] BO : Page header toolbar --- .../admin/AdminAttachmentsController.php | 12 ++++++++++++ controllers/admin/AdminFeaturesController.php | 17 +++++++++++++++++ .../admin/AdminManufacturersController.php | 17 +++++++++++++++++ controllers/admin/AdminScenesController.php | 12 ++++++++++++ controllers/admin/AdminSuppliersController.php | 12 ++++++++++++ controllers/admin/AdminTagsController.php | 12 ++++++++++++ 6 files changed, 82 insertions(+) diff --git a/controllers/admin/AdminAttachmentsController.php b/controllers/admin/AdminAttachmentsController.php index 30a2430ec..eb751bbbb 100644 --- a/controllers/admin/AdminAttachmentsController.php +++ b/controllers/admin/AdminAttachmentsController.php @@ -55,6 +55,18 @@ class AdminAttachmentsControllerCore extends AdminController parent::__construct(); } + public function initPageHeaderToolbar() + { + $this->page_header_toolbar_title = $this->l('Attachments'); + $this->page_header_toolbar_btn['new_attachment'] = array( + 'href' => self::$currentIndex.'&addattachment&token='.$this->token, + 'desc' => $this->l('Add new attachment'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } + public function renderForm() { $this->fields_form = array( diff --git a/controllers/admin/AdminFeaturesController.php b/controllers/admin/AdminFeaturesController.php index ee8de0732..619e81ad8 100644 --- a/controllers/admin/AdminFeaturesController.php +++ b/controllers/admin/AdminFeaturesController.php @@ -212,6 +212,23 @@ class AdminFeaturesControllerCore extends AdminController return parent::renderForm(); } + public function initPageHeaderToolbar() + { + $this->page_header_toolbar_title = $this->l('Features'); + $this->page_header_toolbar_btn['new_feature'] = array( + 'href' => self::$currentIndex.'&addfeature&token='.$this->token, + 'desc' => $this->l('Add new feature'), + 'icon' => 'process-icon-new' + ); + $this->page_header_toolbar_btn['new_feature_value'] = array( + 'href' => self::$currentIndex.'&addfeature_value&token='.$this->token, + 'desc' => $this->l('Add new feature value'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } + /** * AdminController::initToolbar() override * @see AdminController::initToolbar() diff --git a/controllers/admin/AdminManufacturersController.php b/controllers/admin/AdminManufacturersController.php index cac2807d8..f204fd47b 100644 --- a/controllers/admin/AdminManufacturersController.php +++ b/controllers/admin/AdminManufacturersController.php @@ -97,6 +97,23 @@ class AdminManufacturersControllerCore extends AdminController $this->addJqueryPlugin('tagify'); } + public function initPageHeaderToolbar() + { + $this->page_header_toolbar_title = $this->l('Manufacturers'); + $this->page_header_toolbar_btn['new_manufacturer'] = array( + 'href' => self::$currentIndex.'&addmanufacturer&token='.$this->token, + 'desc' => $this->l('Add new manufacturer'), + 'icon' => 'process-icon-new' + ); + $this->page_header_toolbar_btn['new_manufacturer_address'] = array( + 'href' => self::$currentIndex.'&addaddress&token='.$this->token, + 'desc' => $this->l('Add new manufacturer address'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } + public function initListManufacturer() { $this->addRowAction('view'); diff --git a/controllers/admin/AdminScenesController.php b/controllers/admin/AdminScenesController.php index c5b70ad84..59d541104 100644 --- a/controllers/admin/AdminScenesController.php +++ b/controllers/admin/AdminScenesController.php @@ -112,6 +112,18 @@ class AdminScenesControllerCore extends AdminController return parent::renderForm(); } + public function initPageHeaderToolbar() + { + $this->page_header_toolbar_title = $this->l('Scenes'); + $this->page_header_toolbar_btn['new_scene'] = array( + 'href' => self::$currentIndex.'&addscene&token='.$this->token, + 'desc' => $this->l('Add new scene'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } + public function initToolbar() { parent::initToolbar(); diff --git a/controllers/admin/AdminSuppliersController.php b/controllers/admin/AdminSuppliersController.php index bf11a4fe8..e96f5333e 100644 --- a/controllers/admin/AdminSuppliersController.php +++ b/controllers/admin/AdminSuppliersController.php @@ -70,6 +70,18 @@ class AdminSuppliersControllerCore extends AdminController $this->addJqueryPlugin('tagify'); } + public function initPageHeaderToolbar() + { + $this->page_header_toolbar_title = $this->l('Suppliers'); + $this->page_header_toolbar_btn['new_supplier'] = array( + 'href' => self::$currentIndex.'&addsupplier&token='.$this->token, + 'desc' => $this->l('Add new supplier'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } + public function renderForm() { // loads current warehouse diff --git a/controllers/admin/AdminTagsController.php b/controllers/admin/AdminTagsController.php index 525eeb4d7..ecd93e268 100644 --- a/controllers/admin/AdminTagsController.php +++ b/controllers/admin/AdminTagsController.php @@ -64,6 +64,18 @@ class AdminTagsControllerCore extends AdminController parent::__construct(); } + public function initPageHeaderToolbar() + { + $this->page_header_toolbar_title = $this->l('Tags'); + $this->page_header_toolbar_btn['new_tag'] = array( + 'href' => self::$currentIndex.'&addtag&token='.$this->token, + 'desc' => $this->l('Add new tag'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } + public function renderList() { $this->addRowAction('edit');