diff --git a/admin-dev/themes/default/template/content.tpl b/admin-dev/themes/default/template/content.tpl index eb075512c..7d81a6596 100644 --- a/admin-dev/themes/default/template/content.tpl +++ b/admin-dev/themes/default/template/content.tpl @@ -25,7 +25,7 @@ {* ajaxBox allows*} {if isset($content)} - {if isset($show_page_header_toolbar) && $show_page_header_toolbar} + {if isset($show_page_header_toolbar) && $show_page_header_toolbar &&(!isset($lite_display) || !$lite_display)}
{foreach from=$page_header_toolbar_btn item=btn key=k} {if $k == 'modules-list'} diff --git a/admin-dev/themes/default/template/controllers/addons_catalog/content.tpl b/admin-dev/themes/default/template/controllers/addons_catalog/content.tpl index 71856813c..5ca953b48 100644 --- a/admin-dev/themes/default/template/controllers/addons_catalog/content.tpl +++ b/admin-dev/themes/default/template/controllers/addons_catalog/content.tpl @@ -22,6 +22,33 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} +{if isset($content)} + {if isset($show_page_header_toolbar) && $show_page_header_toolbar &&(!isset($lite_display) || !$lite_display)} +
+ {foreach from=$page_header_toolbar_btn item=btn key=k} + {if $k == 'modules-list'} + + {/if} + {/foreach} +
+ {include file="page_header_toolbar.tpl" toolbar_btn=$page_header_toolbar_btn title=$page_header_toolbar_title} + {/if} + {$content} +{/if} +
 
diff --git a/admin-dev/themes/default/template/controllers/cart_rules/form.tpl b/admin-dev/themes/default/template/controllers/cart_rules/form.tpl index 57ac8bf24..9f752db1e 100644 --- a/admin-dev/themes/default/template/controllers/cart_rules/form.tpl +++ b/admin-dev/themes/default/template/controllers/cart_rules/form.tpl @@ -1,45 +1,37 @@ -
- {include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title} -
{block name="leadin"}{/block}
-
- - -
- -
- -
-
- {if $currentObject->id}{/if} - -
-

{l s='Cart rule information'}

- {include file='controllers/cart_rules/informations.tpl'} -
-
-

{l s='Cart rule conditions'}

- {include file='controllers/cart_rules/conditions.tpl'} -
-
-

{l s='Cart rule actions'}

- {include file='controllers/cart_rules/actions.tpl'} -
- - -
+ +
+ {if $currentObject->id}{/if} + +
+

{l s='Cart rule information'}

+ {include file='controllers/cart_rules/informations.tpl'} + {include file="footer_toolbar.tpl"} +
+
+

{l s='Cart rule conditions'}

+ {include file='controllers/cart_rules/conditions.tpl'} + {include file="footer_toolbar.tpl"} +
+
+

{l s='Cart rule actions'}

+ {include file='controllers/cart_rules/actions.tpl'} + {include file="footer_toolbar.tpl"} +
+ + +
-{$content} - +{if isset($content)} + {if isset($show_page_header_toolbar) && $show_page_header_toolbar &&(!isset($lite_display) || !$lite_display)} +
+ {foreach from=$page_header_toolbar_btn item=btn key=k} + {if $k == 'modules-list'} + + {/if} + {/foreach} +
+ {include file="page_header_toolbar.tpl" toolbar_btn=$page_header_toolbar_btn title=$page_header_toolbar_title} + {/if} + {$content} +{/if} diff --git a/admin-dev/themes/default/template/controllers/geolocation/helpers/options/options.tpl b/admin-dev/themes/default/template/controllers/geolocation/helpers/options/options.tpl index 7558ca2e5..355edbce5 100644 --- a/admin-dev/themes/default/template/controllers/geolocation/helpers/options/options.tpl +++ b/admin-dev/themes/default/template/controllers/geolocation/helpers/options/options.tpl @@ -26,7 +26,8 @@ {extends file="helpers/options/options.tpl"} {block name="field"} {if $field['type'] == 'checkbox_table'} -
+ {*TODO : overflow*} +
@@ -44,8 +45,6 @@
-
-
{else} {$smarty.block.parent} {/if} diff --git a/admin-dev/themes/default/template/controllers/images/content.tpl b/admin-dev/themes/default/template/controllers/images/content.tpl index fb8df2852..a4223b14c 100644 --- a/admin-dev/themes/default/template/controllers/images/content.tpl +++ b/admin-dev/themes/default/template/controllers/images/content.tpl @@ -22,8 +22,32 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} - -{$content} +{if isset($content)} + {if isset($show_page_header_toolbar) && $show_page_header_toolbar &&(!isset($lite_display) || !$lite_display)} +
+ {foreach from=$page_header_toolbar_btn item=btn key=k} + {if $k == 'modules-list'} + + {/if} + {/foreach} +
+ {include file="page_header_toolbar.tpl" toolbar_btn=$page_header_toolbar_btn title=$page_header_toolbar_title} + {/if} + {$content} +{/if} {if isset($display_regenerate)} diff --git a/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl index fe29d2572..3ed53c68c 100644 --- a/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl @@ -22,7 +22,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} -{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title} +
{block name="leadin"}{/block}
{if $module_confirmation}
diff --git a/admin-dev/themes/default/template/controllers/marketing/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/marketing/helpers/view/view.tpl index b84d55b1e..6d3899f7c 100644 --- a/admin-dev/themes/default/template/controllers/marketing/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/marketing/helpers/view/view.tpl @@ -1,5 +1 @@ -{if $show_toolbar} - {include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title} -{/if} - {$modules_list} \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/modules_positions/form.tpl b/admin-dev/themes/default/template/controllers/modules_positions/form.tpl index b38b7d3c3..3953deca0 100644 --- a/admin-dev/themes/default/template/controllers/modules_positions/form.tpl +++ b/admin-dev/themes/default/template/controllers/modules_positions/form.tpl @@ -23,7 +23,6 @@ * International Registered Trademark & Property of PrestaShop SA *} -{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
{block name="leadin"}{/block}
diff --git a/admin-dev/themes/default/template/controllers/modules_positions/list_modules.tpl b/admin-dev/themes/default/template/controllers/modules_positions/list_modules.tpl index 5d77360ff..1d8d283e0 100644 --- a/admin-dev/themes/default/template/controllers/modules_positions/list_modules.tpl +++ b/admin-dev/themes/default/template/controllers/modules_positions/list_modules.tpl @@ -28,7 +28,6 @@ var come_from = 'AdminModulesPositions'; -{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
{block name="leadin"}{/block}
diff --git a/admin-dev/themes/default/template/controllers/orders/form.tpl b/admin-dev/themes/default/template/controllers/orders/form.tpl index 6d7d2b271..253df0e0b 100755 --- a/admin-dev/themes/default/template/controllers/orders/form.tpl +++ b/admin-dev/themes/default/template/controllers/orders/form.tpl @@ -976,7 +976,6 @@ } -{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
{block name="leadin"}{/block}
diff --git a/admin-dev/themes/default/template/controllers/shipping/content.tpl b/admin-dev/themes/default/template/controllers/shipping/content.tpl index 4ff8e7bda..808efda4f 100644 --- a/admin-dev/themes/default/template/controllers/shipping/content.tpl +++ b/admin-dev/themes/default/template/controllers/shipping/content.tpl @@ -23,7 +23,35 @@ * International Registered Trademark & Property of PrestaShop SA *} -{$content} + +{* ajaxBox allows*} +{if isset($content)} + {if isset($show_page_header_toolbar) && $show_page_header_toolbar &&(!isset($lite_display) || !$lite_display)} +
+ {foreach from=$page_header_toolbar_btn item=btn key=k} + {if $k == 'modules-list'} + + {/if} + {/foreach} +
+ {include file="page_header_toolbar.tpl" toolbar_btn=$page_header_toolbar_btn title=$page_header_toolbar_title} + {/if} + {$content} +{/if} +
diff --git a/admin-dev/themes/default/template/controllers/shop/content.tpl b/admin-dev/themes/default/template/controllers/shop/content.tpl index c567de15c..25bf07275 100644 --- a/admin-dev/themes/default/template/controllers/shop/content.tpl +++ b/admin-dev/themes/default/template/controllers/shop/content.tpl @@ -23,8 +23,28 @@ * International Registered Trademark & Property of PrestaShop SA *} -{if $toolbar_btn} - {include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title} +{if isset($show_page_header_toolbar) && $show_page_header_toolbar &&(!isset($lite_display) || !$lite_display)} +
+ {foreach from=$page_header_toolbar_btn item=btn key=k} + {if $k == 'modules-list'} + + {/if} + {/foreach} +
+ {include file="page_header_toolbar.tpl" toolbar_btn=$page_header_toolbar_btn title=$page_header_toolbar_title} {/if}
diff --git a/admin-dev/themes/default/template/controllers/themes/helpers/options/options.tpl b/admin-dev/themes/default/template/controllers/themes/helpers/options/options.tpl index c75802f45..3c3eb85d6 100644 --- a/admin-dev/themes/default/template/controllers/themes/helpers/options/options.tpl +++ b/admin-dev/themes/default/template/controllers/themes/helpers/options/options.tpl @@ -52,16 +52,23 @@ {block name="after"}
{/block} diff --git a/admin-dev/themes/default/template/footer_toolbar.tpl b/admin-dev/themes/default/template/footer_toolbar.tpl new file mode 100644 index 000000000..96a76ed99 --- /dev/null +++ b/admin-dev/themes/default/template/footer_toolbar.tpl @@ -0,0 +1,110 @@ +{* +* 2007-2013 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{if $show_toolbar} + +{/if} \ No newline at end of file diff --git a/admin-dev/themes/default/template/helpers/form/form.tpl b/admin-dev/themes/default/template/helpers/form/form.tpl index 51d5d2915..2f320e36e 100644 --- a/admin-dev/themes/default/template/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/helpers/form/form.tpl @@ -22,12 +22,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} - -{if $show_toolbar} - {include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title} -
{block name="leadin"}{/block}
-{/if} - {if isset($fields.title)}

{$fields.title}

{/if} {block name="defaultForm"} @@ -82,7 +76,7 @@ {/block} {block name="field"} -
+
{block name="input"} {if $input.type == 'text' || $input.type == 'tags'} {if isset($input.lang) AND $input.lang} @@ -639,6 +633,9 @@ + {block name="footer"} + {include file="footer_toolbar.tpl"} + {/block}
{/block} {block name="other_fieldsets"}{/block} diff --git a/admin-dev/themes/default/template/helpers/list/list_header.tpl b/admin-dev/themes/default/template/helpers/list/list_header.tpl index fe4839bc9..3ceedff5f 100644 --- a/admin-dev/themes/default/template/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_header.tpl @@ -57,25 +57,6 @@ {if !$simple_header}
{block name="leadin"}{/block} - {foreach from=$toolbar_btn item=btn key=k} - {if $k == 'modules-list'} - - {break} - {/if} - {/foreach}
{/if} @@ -100,28 +81,14 @@ {if isset($toolbar_btn) && count($toolbar_btn) >0} {foreach from=$toolbar_btn item=btn key=k} - - - - {if $k == 'modules-list'} - + {if $k != 'modules-list'} + + + {/if} {/foreach} @@ -137,7 +104,7 @@ - {/if} + + {/if}
{/if} {if $simple_header} diff --git a/admin-dev/themes/default/template/helpers/options/options.tpl b/admin-dev/themes/default/template/helpers/options/options.tpl index 42ede4696..138a7f9c9 100644 --- a/admin-dev/themes/default/template/helpers/options/options.tpl +++ b/admin-dev/themes/default/template/helpers/options/options.tpl @@ -23,10 +23,7 @@ * International Registered Trademark & Property of PrestaShop SA *} -{if $show_toolbar} - {include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title} -
{block name="leadin"}{/block}
-{/if} +
{block name="leadin"}{/block}
- {/block} -
-
-
- -{block name=pageBreadcrumb} - -{/block} diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index a09130e72..45697a700 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -1119,17 +1119,43 @@ class AdminControllerCore extends Controller $title = implode(' '.Configuration::get('PS_NAVIGATION_PIPE').' ', $this->toolbar_title); + switch ($this->display) + { + case 'view': + // Default cancel button - like old back link + $back = Tools::safeOutput(Tools::getValue('back', '')); + if (empty($back)) + $back = self::$currentIndex.'&token='.$this->token; + if (!Validate::isCleanHtml($back)) + die(Tools::displayError()); + if (!$this->lite_display) + $this->page_header_toolbar_btn['back'] = array( + 'href' => $back, + 'desc' => $this->l('Back to list') + ); + break; + case 'add': + case 'edit': + // Default cancel button - like old back link + $back = Tools::safeOutput(Tools::getValue('back', '')); + if (empty($back)) + $back = self::$currentIndex.'&token='.$this->token; + if (!Validate::isCleanHtml($back)) + die(Tools::displayError()); + if (!$this->lite_display) + $this->page_header_toolbar_btn['cancel'] = array( + 'href' => $back, + 'desc' => $this->l('Cancel') + ); + break; + } + if (is_array($this->page_header_toolbar_btn) && $this->page_header_toolbar_btn instanceof Traversable || trim($title) != '') $this->show_page_header_toolbar = true; - $this->context->smarty->assign(array( - 'show_page_header_toolbar' => $this->show_page_header_toolbar, - 'page_header_toolbar_title' => $title, - 'page_header_toolbar_btn' => $this->page_header_toolbar_btn - )); - + $this->page_header_toolbar_title = $title; $this->addPageHeaderToolBarModulesListButton(); } @@ -1149,7 +1175,17 @@ class AdminControllerCore extends Controller 'href' => '#', 'desc' => $this->l('Save') ); - //no break + $back = Tools::safeOutput(Tools::getValue('back', '')); + if (empty($back)) + $back = self::$currentIndex.'&token='.$this->token; + if (!Validate::isCleanHtml($back)) + die(Tools::displayError()); + if (!$this->lite_display) + $this->toolbar_btn['cancel'] = array( + 'href' => $back, + 'desc' => $this->l('Cancel') + ); + break; case 'view': // Default cancel button - like old back link $back = Tools::safeOutput(Tools::getValue('back', '')); @@ -1545,9 +1581,11 @@ class AdminControllerCore extends Controller } $this->getLanguages(); - // toolbar (save, cancel, new, ..) + // toolbar (save, cancel, new, ..) $this->initToolbar(); $this->initTabModuleList(); + $this->initPageHeaderToolbar(); + if ($this->display == 'edit' || $this->display == 'add') { if (!$this->loadObject(true)) @@ -1580,7 +1618,11 @@ class AdminControllerCore extends Controller $this->context->smarty->assign(array( 'content' => $this->content, + 'lite_display' => $this->lite_display, 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } @@ -1695,8 +1737,6 @@ class AdminControllerCore extends Controller */ public function renderList() { - $this->initPageHeaderToolbar(); - if (!($this->fields_list && is_array($this->fields_list))) return false; $this->getList($this->context->language->id); @@ -2114,9 +2154,9 @@ class AdminControllerCore extends Controller else $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } - elseif (Tools::getValue('submitAdd'.$this->table) - || Tools::getValue('submitAdd'.$this->table.'AndStay') - || Tools::getValue('submitAdd'.$this->table.'AndPreview')) + elseif (Tools::isSubmit('submitAdd'.$this->table) + || Tools::isSubmit('submitAdd'.$this->table.'AndStay') + || Tools::isSubmit('submitAdd'.$this->table.'AndPreview')) { // case 1: updating existing entry if ($this->id_object) @@ -2124,7 +2164,7 @@ class AdminControllerCore extends Controller if ($this->tabAccess['edit'] === '1') { $this->action = 'save'; - if (Tools::getValue('submitAdd'.$this->table.'AndStay')) + if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) $this->display = 'edit'; else $this->display = 'list'; @@ -2138,7 +2178,7 @@ class AdminControllerCore extends Controller if ($this->tabAccess['add'] === '1') { $this->action = 'save'; - if (Tools::getValue('submitAdd'.$this->table.'AndStay')) + if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) $this->display = 'edit'; else $this->display = 'list'; diff --git a/controllers/admin/AdminAccessController.php b/controllers/admin/AdminAccessController.php index 454bc19a6..e3e2268da 100644 --- a/controllers/admin/AdminAccessController.php +++ b/controllers/admin/AdminAccessController.php @@ -45,12 +45,6 @@ class AdminAccessControllerCore extends AdminController parent::__construct(); } - public function initPageHeaderToolbar() - { - $this->page_header_toolbar_title = $this->l('Permissions'); - parent::initPageHeaderToolbar(); - } - /** * AdminController::renderForm() override * @see AdminController::renderForm() @@ -131,9 +125,23 @@ class AdminAccessControllerCore extends AdminController $this->context->smarty->assign(array( 'content' => $this->content, 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } + public function initToolbarTitle() + { + $this->toolbar_title = array_unique($this->breadcrumbs); + } + + public function initPageHeaderToolbar() + { + parent::initPageHeaderToolbar(); + unset($this->page_header_toolbar_btn['cancel']); + } + public function ajaxProcessUpdateAccess() { if (_PS_MODE_DEMO_) diff --git a/controllers/admin/AdminAddonsCatalogController.php b/controllers/admin/AdminAddonsCatalogController.php index e65a897f4..82f1ce879 100644 --- a/controllers/admin/AdminAddonsCatalogController.php +++ b/controllers/admin/AdminAddonsCatalogController.php @@ -26,9 +26,22 @@ class AdminAddonsCatalogControllerCore extends AdminController { + public function __construct() + { + $this->bootstrap = true; + parent::__construct(); + } + public function initContent() { - $this->context->smarty->assign('parentDomain', Tools::getHttpHost(true).substr($_SERVER['REQUEST_URI'], 0, -1 * strlen(basename($_SERVER['REQUEST_URI'])))); + $this->initPageHeaderToolbar(); + + $this->context->smarty->assign(array( + 'parentDomain' => Tools::getHttpHost(true).substr($_SERVER['REQUEST_URI'], 0, -1 * strlen(basename($_SERVER['REQUEST_URI']))), + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn + )); parent::initContent(); } } diff --git a/controllers/admin/AdminAddressesController.php b/controllers/admin/AdminAddressesController.php index 7ef73b768..d19a55469 100644 --- a/controllers/admin/AdminAddressesController.php +++ b/controllers/admin/AdminAddressesController.php @@ -85,12 +85,12 @@ class AdminAddressesControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Addresses'); - $this->page_header_toolbar_btn['new_address'] = array( - 'href' => self::$currentIndex.'&addaddress&token='.$this->token, - 'desc' => $this->l('Add new address'), - 'icon' => 'process-icon-new' - ); + if (empty($this->display)) + $this->page_header_toolbar_btn['new_address'] = array( + 'href' => self::$currentIndex.'&addaddress&token='.$this->token, + 'desc' => $this->l('Add new address'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminAttachmentsController.php b/controllers/admin/AdminAttachmentsController.php index 99bf19cae..204da8649 100644 --- a/controllers/admin/AdminAttachmentsController.php +++ b/controllers/admin/AdminAttachmentsController.php @@ -58,12 +58,12 @@ class AdminAttachmentsControllerCore extends AdminController 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' - ); + if (empty($this->display)) + $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(); } diff --git a/controllers/admin/AdminAttributesGroupsController.php b/controllers/admin/AdminAttributesGroupsController.php index 2269a3aa5..bf2155d67 100644 --- a/controllers/admin/AdminAttributesGroupsController.php +++ b/controllers/admin/AdminAttributesGroupsController.php @@ -424,6 +424,7 @@ class AdminAttributesGroupsControllerCore extends AdminController // toolbar (save, cancel, new, ..) $this->initToolbar(); + $this->initPageHeaderToolbar(); if ($this->display == 'edit' || $this->display == 'add') { if (!($this->object = $this->loadObject(true))) @@ -451,23 +452,16 @@ class AdminAttributesGroupsControllerCore extends AdminController 'token' => $this->token, 'content' => $this->content, 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } public function initPageHeaderToolbar() { - if ($this->display == 'view') + if (empty($this->display)) { - $this->page_header_toolbar_title = $this->attribute_name[$this->context->employee->id_lang]; - $this->page_header_toolbar_btn['back_to_list'] = array( - 'href' => Context::getContext()->link->getAdminLink('AdminAttributesGroups'), - 'desc' => $this->l('Back to list'), - 'icon' => 'process-icon-back' - ); - } - else - { - $this->page_header_toolbar_title = $this->l('Attribute groups'); $this->page_header_toolbar_btn['new_attribute_group'] = array( 'href' => self::$currentIndex.'&addattribute_group&token='.$this->token, 'desc' => $this->l('Add new attribute'), @@ -478,7 +472,7 @@ class AdminAttributesGroupsControllerCore extends AdminController 'desc' => $this->l('Add new value'), 'icon' => 'process-icon-new' ); - } + } parent::initPageHeaderToolbar(); } @@ -544,7 +538,14 @@ class AdminAttributesGroupsControllerCore extends AdminController break; case 'view': - $bread_extended[] = $this->attribute_name[$this->context->employee->id_lang]; + if (Tools::getIsset('viewattribute_group')) + { + if (($id = Tools::getValue('id_attribute_group'))) + if (Validate::isLoadedObject($obj = new AttributeGroup((int)$id))) + $bread_extended[] = $obj->name[$this->context->employee->id_lang]; + } + else + $bread_extended[] = $this->attribute_name[$this->context->employee->id_lang]; break; case 'editAttributes': diff --git a/controllers/admin/AdminCartRulesController.php b/controllers/admin/AdminCartRulesController.php index ac9aada0c..932877f0c 100644 --- a/controllers/admin/AdminCartRulesController.php +++ b/controllers/admin/AdminCartRulesController.php @@ -59,12 +59,12 @@ class AdminCartRulesControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Cart rules'); - $this->page_header_toolbar_btn['new_cart_rule'] = array( - 'href' => self::$currentIndex.'&addcart_rule&token='.$this->token, - 'desc' => $this->l('Add new cart rule'), - 'icon' => 'process-icon-new' - ); + if (empty($this->display)) + $this->page_header_toolbar_btn['new_cart_rule'] = array( + 'href' => self::$currentIndex.'&addcart_rule&token='.$this->token, + 'desc' => $this->l('Add new cart rule'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminCartsController.php b/controllers/admin/AdminCartsController.php index 9439cb7db..50a51ed83 100755 --- a/controllers/admin/AdminCartsController.php +++ b/controllers/admin/AdminCartsController.php @@ -96,12 +96,12 @@ class AdminCartsControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Carts'); - $this->page_header_toolbar_btn['export_cart'] = array( - 'href' => self::$currentIndex.'&exportcart&token='.$this->token, - 'desc' => $this->l('Export carts'), - 'icon' => 'process-icon-export' - ); + if (empty($this->display)) + $this->page_header_toolbar_btn['export_cart'] = array( + 'href' => self::$currentIndex.'&exportcart&token='.$this->token, + 'desc' => $this->l('Export carts'), + 'icon' => 'process-icon-export' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php index df416fb13..8a28b506e 100644 --- a/controllers/admin/AdminCategoriesController.php +++ b/controllers/admin/AdminCategoriesController.php @@ -160,12 +160,14 @@ class AdminCategoriesControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Categories'); - $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' - ); + if (empty($this->display)) + { + $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(); } diff --git a/controllers/admin/AdminCmsContentController.php b/controllers/admin/AdminCmsContentController.php index ba33763e9..3d506037b 100644 --- a/controllers/admin/AdminCmsContentController.php +++ b/controllers/admin/AdminCmsContentController.php @@ -118,17 +118,28 @@ class AdminCmsContentControllerCore extends AdminController if (!$id_cms_category) $id_cms_category = 1; - $this->page_header_toolbar_title = $this->l('CMS'); - $this->page_header_toolbar_btn['new_cms_category'] = array( - 'href' => self::$currentIndex.'&addcms_category&token='.$this->token, - 'desc' => $this->l('Add new CMS category'), - 'icon' => 'process-icon-new' - ); - $this->page_header_toolbar_btn['new_cms_page'] = array( - 'href' => self::$currentIndex.'&addcms&id_cms_category='.$id_cms_category.'&token='.$this->token, - 'desc' => $this->l('Add new CMS page'), - 'icon' => 'process-icon-new' - ); + $this->page_header_toolbar_title = 'CMS'; + + if ($this->display == 'list') + { + $this->page_header_toolbar_btn['new_cms_category'] = array( + 'href' => self::$currentIndex.'&addcms_category&token='.$this->token, + 'desc' => $this->l('Add new CMS category'), + 'icon' => 'process-icon-new' + ); + $this->page_header_toolbar_btn['new_cms_page'] = array( + 'href' => self::$currentIndex.'&addcms&id_cms_category='.$id_cms_category.'&token='.$this->token, + 'desc' => $this->l('Add new CMS page'), + 'icon' => 'process-icon-new' + ); + } + else + { + $this->page_header_toolbar_btn['cancel'] = array( + 'href' => self::$currentIndex.'&token='.$this->token, + 'desc' => $this->l('Cancel') + ); + } if (is_array($this->page_header_toolbar_btn) && $this->page_header_toolbar_btn instanceof Traversable diff --git a/controllers/admin/AdminContactsController.php b/controllers/admin/AdminContactsController.php index f41350753..201f00dd7 100644 --- a/controllers/admin/AdminContactsController.php +++ b/controllers/admin/AdminContactsController.php @@ -119,12 +119,12 @@ class AdminContactsControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Contacts'); - $this->page_header_toolbar_btn['new_contact'] = array( - 'href' => self::$currentIndex.'&addcontact&token='.$this->token, - 'desc' => $this->l('Add new contact'), - 'icon' => 'process-icon-new' - ); + if(empty($this->display)) + $this->page_header_toolbar_btn['new_contact'] = array( + 'href' => self::$currentIndex.'&addcontact&token='.$this->token, + 'desc' => $this->l('Add new contact'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminCurrenciesController.php b/controllers/admin/AdminCurrenciesController.php index b0f80bf4c..a851e259a 100644 --- a/controllers/admin/AdminCurrenciesController.php +++ b/controllers/admin/AdminCurrenciesController.php @@ -341,5 +341,17 @@ class AdminCurrenciesControllerCore extends AdminController $this->errors[] = Tools::displayError('This currency already exists.'); parent::initProcess(); } + + public function initPageHeaderToolbar() + { + if (empty($this->display)) + $this->page_header_toolbar_btn['new_currency'] = array( + 'href' => self::$currentIndex.'&addcurrency&token='.$this->token, + 'desc' => $this->l('Add new currency'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } } diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index 545e16fbd..01054fffd 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -190,12 +190,12 @@ class AdminCustomersControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Customers'); - $this->page_header_toolbar_btn['new_customer'] = array( - 'href' => self::$currentIndex.'&addcustomer&token='.$this->token, - 'desc' => $this->l('Add new customer'), - 'icon' => 'process-icon-new' - ); + if (empty($this->display)) + $this->page_header_toolbar_btn['new_customer'] = array( + 'href' => self::$currentIndex.'&addcustomer&token='.$this->token, + 'desc' => $this->l('Add new customer'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminDeliverySlipController.php b/controllers/admin/AdminDeliverySlipController.php index 8ea2f3ebe..49f92134d 100644 --- a/controllers/admin/AdminDeliverySlipController.php +++ b/controllers/admin/AdminDeliverySlipController.php @@ -118,13 +118,16 @@ class AdminDeliverySlipControllerCore extends AdminController public function initContent() { - $this->content .= $this->renderForm().'
'; + $this->initPageHeaderToolbar(); $this->show_toolbar = false; + $this->content .= $this->renderForm(); $this->content .= $this->renderOptions(); - $this->context->smarty->assign(array( 'content' => $this->content, 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } } diff --git a/controllers/admin/AdminEmailsController.php b/controllers/admin/AdminEmailsController.php index 0f3c510ba..76126c7b5 100644 --- a/controllers/admin/AdminEmailsController.php +++ b/controllers/admin/AdminEmailsController.php @@ -181,6 +181,7 @@ class AdminEmailsControllerCore extends AdminController { $this->initTabModuleList(); $this->initToolbar(); + $this->initPageHeaderToolbar(); $this->addToolBarModulesListButton(); unset($this->toolbar_btn['save']); $back = $this->context->link->getAdminLink('AdminHome'); @@ -195,6 +196,9 @@ class AdminEmailsControllerCore extends AdminController $this->context->smarty->assign(array( 'content' => $this->content, 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } diff --git a/controllers/admin/AdminEmployeesController.php b/controllers/admin/AdminEmployeesController.php index a76e1fc58..6091cb199 100644 --- a/controllers/admin/AdminEmployeesController.php +++ b/controllers/admin/AdminEmployeesController.php @@ -140,6 +140,18 @@ class AdminEmployeesControllerCore extends AdminController } } + public function initPageHeaderToolbar() + { + if (empty($this->display)) + $this->page_header_toolbar_btn['new_employee'] = array( + 'href' => self::$currentIndex.'&addemployee&token='.$this->token, + 'desc' => $this->l('Add new employee'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } + public function renderList() { $this->_select = 'pl.`name` AS profile'; diff --git a/controllers/admin/AdminFeaturesController.php b/controllers/admin/AdminFeaturesController.php index f437c5349..c99c8ffb3 100644 --- a/controllers/admin/AdminFeaturesController.php +++ b/controllers/admin/AdminFeaturesController.php @@ -137,7 +137,6 @@ class AdminFeaturesControllerCore extends AdminController } $this->feature_name = $obj->name; - $this->toolbar_title = $this->feature_name; $this->fields_list = array( 'id_feature_value' => array( 'title' => $this->l('ID'), @@ -200,16 +199,7 @@ class AdminFeaturesControllerCore extends AdminController public function initPageHeaderToolbar() { - if ($this->display == 'view') - { - $this->page_header_toolbar_title = $this->feature_name[$this->context->employee->id_lang]; - $this->page_header_toolbar_btn['back_to_list'] = array( - 'href' => Context::getContext()->link->getAdminLink('AdminFeatures'), - 'desc' => $this->l('Back to list'), - 'icon' => 'process-icon-back' - ); - } - else + if (empty($this->display)) { $this->page_header_toolbar_title = $this->l('Features'); $this->page_header_toolbar_btn['new_feature'] = array( @@ -272,6 +262,27 @@ class AdminFeaturesControllerCore extends AdminController } } + public function initToolbarTitle() + { + $bread_extended = $this->breadcrumbs; + + switch ($this->display) + { + case 'view': + if (Tools::getIsset('viewfeature')) + { + if (($id = Tools::getValue('id_feature'))) + if (Validate::isLoadedObject($obj = new Feature((int)$id))) + $bread_extended[] = $obj->name[$this->context->employee->id_lang]; + } + else + $bread_extended[] = $this->attribute_name[$this->context->employee->id_lang]; + break; + } + + $this->toolbar_title = $bread_extended; + } + /** * AdminController::renderForm() override * @see AdminController::renderForm() @@ -349,6 +360,7 @@ class AdminFeaturesControllerCore extends AdminController { // toolbar (save, cancel, new, ..) $this->initToolbar(); + $this->initPageHeaderToolbar(); if ($this->display == 'edit' || $this->display == 'add') { if (!$this->loadObject(true)) @@ -382,6 +394,9 @@ class AdminFeaturesControllerCore extends AdminController $this->context->smarty->assign(array( 'content' => $this->content, 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } diff --git a/controllers/admin/AdminGendersController.php b/controllers/admin/AdminGendersController.php index ca7921ea1..ad111d833 100644 --- a/controllers/admin/AdminGendersController.php +++ b/controllers/admin/AdminGendersController.php @@ -87,12 +87,12 @@ class AdminGendersControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Genders'); - $this->page_header_toolbar_btn['new_gender'] = array( - 'href' => self::$currentIndex.'&addgender&token='.$this->token, - 'desc' => $this->l('Add new gender'), - 'icon' => 'process-icon-new' - ); + if(empty($this->display)) + $this->page_header_toolbar_btn['new_gender'] = array( + 'href' => self::$currentIndex.'&addgender&token='.$this->token, + 'desc' => $this->l('Add new gender'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminGroupsController.php b/controllers/admin/AdminGroupsController.php index d5552cda4..d5e927026 100644 --- a/controllers/admin/AdminGroupsController.php +++ b/controllers/admin/AdminGroupsController.php @@ -146,12 +146,12 @@ class AdminGroupsControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Groups'); - $this->page_header_toolbar_btn['new_group'] = array( - 'href' => self::$currentIndex.'&addgroup&token='.$this->token, - 'desc' => $this->l('Add new group'), - 'icon' => 'process-icon-new' - ); + if (empty($this->display)) + $this->page_header_toolbar_btn['new_group'] = array( + 'href' => self::$currentIndex.'&addgroup&token='.$this->token, + 'desc' => $this->l('Add new group'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminImagesController.php b/controllers/admin/AdminImagesController.php index 4f2aa9c48..640b0a216 100644 --- a/controllers/admin/AdminImagesController.php +++ b/controllers/admin/AdminImagesController.php @@ -648,7 +648,19 @@ class AdminImagesControllerCore extends AdminController 'safe_mode' => Tools::getSafeModeStatus(), 'link_ppreferences' => 'index.php?tab=AdminPPreferences&token='.Tools::getAdminTokenLite('AdminPPreferences').'#PS_LEGACY_IMAGES_on', )); -} + } + + public function initPageHeaderToolbar() + { + if (empty($this->display)) + $this->page_header_toolbar_btn['new_image_type'] = array( + 'href' => self::$currentIndex.'&addimage_type&token='.$this->token, + 'desc' => $this->l('Add new image type'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } /** * Move product images to the new filesystem diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php index a74e58dda..4a1f929cb 100644 --- a/controllers/admin/AdminImportController.php +++ b/controllers/admin/AdminImportController.php @@ -617,6 +617,7 @@ class AdminImportControllerCore extends AdminController { // toolbar (save, cancel, new, ..) $this->initToolbar(); + $this->initPageHeaderToolbar(); if ($this->display == 'import') if (Tools::getValue('csv')) $this->content .= $this->renderView(); @@ -631,6 +632,9 @@ class AdminImportControllerCore extends AdminController $this->context->smarty->assign(array( 'content' => $this->content, 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } diff --git a/controllers/admin/AdminInformationController.php b/controllers/admin/AdminInformationController.php index 2c18ed522..66a7e6353 100644 --- a/controllers/admin/AdminInformationController.php +++ b/controllers/admin/AdminInformationController.php @@ -40,6 +40,17 @@ class AdminInformationControllerCore extends AdminController parent::initContent(); } + public function initToolbarTitle() + { + $this->toolbar_title = array_unique($this->breadcrumbs); + } + + public function initPageHeaderToolbar() + { + parent::initPageHeaderToolbar(); + unset($this->page_header_toolbar_btn['back']); + } + public function renderView() { $this->initPageHeaderToolbar(); @@ -77,12 +88,6 @@ class AdminInformationControllerCore extends AdminController return parent::renderView(); } - public function initPageHeaderToolbar() - { - $this->page_header_toolbar_title = $this->l('Configuration information'); - parent::initPageHeaderToolbar(); - } - /** * get all tests * diff --git a/controllers/admin/AdminInvoicesController.php b/controllers/admin/AdminInvoicesController.php index 4a607117d..6b5401343 100644 --- a/controllers/admin/AdminInvoicesController.php +++ b/controllers/admin/AdminInvoicesController.php @@ -121,6 +121,7 @@ class AdminInvoicesControllerCore extends AdminController ); $this->table = 'invoice_date'; + $this->show_toolbar = false; $this->toolbar_title = $this->l('Print PDF invoices'); return parent::renderForm(); } @@ -185,6 +186,7 @@ class AdminInvoicesControllerCore extends AdminController { $this->display = 'edit'; $this->initToolbar(); + $this->initPageHeaderToolbar(); $this->content .= $this->initFormByDate(); $this->content .= $this->initFormByStatus(); $this->table = 'invoice'; @@ -192,7 +194,10 @@ class AdminInvoicesControllerCore extends AdminController $this->context->smarty->assign(array( 'content' => $this->content, - 'url_post' => self::$currentIndex.'&token='.$this->token, + 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } diff --git a/controllers/admin/AdminLanguagesController.php b/controllers/admin/AdminLanguagesController.php index 8da2e046b..ed5638fed 100644 --- a/controllers/admin/AdminLanguagesController.php +++ b/controllers/admin/AdminLanguagesController.php @@ -102,12 +102,12 @@ class AdminLanguagesControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Languages'); - $this->page_header_toolbar_btn['new_language'] = array( - 'href' => self::$currentIndex.'&addlang&token='.$this->token, - 'desc' => $this->l('Add new language'), - 'icon' => 'process-icon-new' - ); + if (empty($this->display)) + $this->page_header_toolbar_btn['new_language'] = array( + 'href' => self::$currentIndex.'&addlang&token='.$this->token, + 'desc' => $this->l('Add new language'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminLocalizationController.php b/controllers/admin/AdminLocalizationController.php index 84fbe17f4..c384493c5 100644 --- a/controllers/admin/AdminLocalizationController.php +++ b/controllers/admin/AdminLocalizationController.php @@ -300,6 +300,9 @@ class AdminLocalizationControllerCore extends AdminController 'localization_form' => $this->renderForm(), 'localization_options' => $this->renderOptions(), 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } diff --git a/controllers/admin/AdminManufacturersController.php b/controllers/admin/AdminManufacturersController.php index f854ee81c..6ad143c0c 100644 --- a/controllers/admin/AdminManufacturersController.php +++ b/controllers/admin/AdminManufacturersController.php @@ -102,17 +102,33 @@ class AdminManufacturersControllerCore extends AdminController 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' - ); + if (empty($this->display)) + { + $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' + ); + } + elseif ($this->display == 'editaddresses' || $this->display == 'addaddress') { + // Default cancel button - like old back link + if (!isset($this->no_back) || $this->no_back == false) + { + $back = Tools::safeOutput(Tools::getValue('back', '')); + if (empty($back)) + $back = self::$currentIndex.'&token='.$this->token; + + $this->page_header_toolbar_btn['cancel'] = array( + 'href' => $back, + 'desc' => $this->l('Cancel') + ); + } + } parent::initPageHeaderToolbar(); } @@ -652,6 +668,7 @@ class AdminManufacturersControllerCore extends AdminController { // toolbar (save, cancel, new, ..) $this->initToolbar(); + $this->initPageHeaderToolbar(); if ($this->display == 'editaddresses' || $this->display == 'addaddress') $this->content .= $this->renderFormAddress(); else if ($this->display == 'edit' || $this->display == 'add') @@ -676,6 +693,9 @@ class AdminManufacturersControllerCore extends AdminController $this->context->smarty->assign(array( 'content' => $this->content, 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } diff --git a/controllers/admin/AdminMarketingController.php b/controllers/admin/AdminMarketingController.php index fed124483..d6c368595 100644 --- a/controllers/admin/AdminMarketingController.php +++ b/controllers/admin/AdminMarketingController.php @@ -43,6 +43,12 @@ class AdminMarketingControllerCore extends AdminController { $this->toolbar_title = array_unique($this->breadcrumbs); } + + public function initPageHeaderToolbar() + { + parent::initPageHeaderToolbar(); + $this->page_header_toolbar_btn = array(); + } public function initToolbar() { diff --git a/controllers/admin/AdminModulesPositionsController.php b/controllers/admin/AdminModulesPositionsController.php index 3b3c08de8..db413aa5a 100644 --- a/controllers/admin/AdminModulesPositionsController.php +++ b/controllers/admin/AdminModulesPositionsController.php @@ -227,6 +227,7 @@ class AdminModulesPositionsControllerCore extends AdminController public function initContent() { $this->addJS(__PS_BASE_URI__.'js/vendor/jquery.sortable.js'); + $this->initPageHeaderToolbar(); if (array_key_exists('addToHook', $_GET) || array_key_exists('editGraft', $_GET) || (Tools::isSubmit('submitAddToHook') && $this->errors)) { @@ -237,7 +238,10 @@ class AdminModulesPositionsControllerCore extends AdminController $this->content .= $this->initMain(); $this->context->smarty->assign(array( - 'content' => $this->content + 'content' => $this->content, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } diff --git a/controllers/admin/AdminOrderMessageController.php b/controllers/admin/AdminOrderMessageController.php index f0203e214..53c99ff61 100644 --- a/controllers/admin/AdminOrderMessageController.php +++ b/controllers/admin/AdminOrderMessageController.php @@ -90,12 +90,12 @@ class AdminOrderMessageControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Order messages'); - $this->page_header_toolbar_btn['new_order_message'] = array( - 'href' => self::$currentIndex.'&addorder_message&token='.$this->token, - 'desc' => $this->l('Add new order message'), - 'icon' => 'process-icon-new' - ); + if (empty($this->display)) + $this->page_header_toolbar_btn['new_order_message'] = array( + 'href' => self::$currentIndex.'&addorder_message&token='.$this->token, + 'desc' => $this->l('Add new order message'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 4b885816d..34c1daee5 100755 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -139,12 +139,12 @@ class AdminOrdersControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Orders'); - $this->page_header_toolbar_btn['new_order'] = array( - 'href' => self::$currentIndex.'&addorder&token='.$this->token, - 'desc' => $this->l('Add new order'), - 'icon' => 'process-icon-new' - ); + if (empty($this->display) && Context::getContext()->shop->getContext() == Shop::CONTEXT_SHOP && isset($this->toolbar_btn['new']) && Shop::isFeatureActive()) + $this->page_header_toolbar_btn['new_order'] = array( + 'href' => self::$currentIndex.'&addorder&token='.$this->token, + 'desc' => $this->l('Add new order'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminPaymentController.php b/controllers/admin/AdminPaymentController.php index 2c86ab386..3f78f0e45 100644 --- a/controllers/admin/AdminPaymentController.php +++ b/controllers/admin/AdminPaymentController.php @@ -84,6 +84,17 @@ class AdminPaymentControllerCore extends AdminController } } + public function initToolbarTitle() + { + $this->toolbar_title = array_unique($this->breadcrumbs); + } + + public function initPageHeaderToolbar() + { + parent::initPageHeaderToolbar(); + $this->page_header_toolbar_btn = array(); + } + public function postProcess() { if ($this->action) diff --git a/controllers/admin/AdminPerformanceController.php b/controllers/admin/AdminPerformanceController.php index fa41f2616..d1b503ffa 100644 --- a/controllers/admin/AdminPerformanceController.php +++ b/controllers/admin/AdminPerformanceController.php @@ -496,12 +496,16 @@ class AdminPerformanceControllerCore extends AdminController public function initContent() { $this->initToolbar(); + $this->initPageHeaderToolbar(); $this->display = ''; $this->content .= $this->renderForm(); $this->context->smarty->assign(array( 'content' => $this->content, - 'url_post' => self::$currentIndex.'&token='.$this->token, + 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 4e248c459..273bca812 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -2433,12 +2433,12 @@ class AdminProductsControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Products'); - $this->page_header_toolbar_btn['new_product'] = array( - 'href' => self::$currentIndex.'&addproduct&token='.$this->token, - 'desc' => $this->l('Add new product'), - 'icon' => 'process-icon-new' - ); + if (empty($this->display)) + $this->page_header_toolbar_btn['new_product'] = array( + 'href' => self::$currentIndex.'&addproduct&token='.$this->token, + 'desc' => $this->l('Add new product'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminProfilesController.php b/controllers/admin/AdminProfilesController.php index fae0ec52d..5a6be1b18 100644 --- a/controllers/admin/AdminProfilesController.php +++ b/controllers/admin/AdminProfilesController.php @@ -99,12 +99,12 @@ class AdminProfilesControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Profiles'); - $this->page_header_toolbar_btn['new_profile'] = array( - 'href' => self::$currentIndex.'&addprofile&token='.$this->token, - 'desc' => $this->l('Add new profile'), - 'icon' => 'process-icon-new' - ); + if (empty($this->display)) + $this->page_header_toolbar_btn['new_profile'] = array( + 'href' => self::$currentIndex.'&addprofile&token='.$this->token, + 'desc' => $this->l('Add new profile'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminQuickAccessesController.php b/controllers/admin/AdminQuickAccessesController.php index d29bef13c..aa2b9c173 100644 --- a/controllers/admin/AdminQuickAccessesController.php +++ b/controllers/admin/AdminQuickAccessesController.php @@ -117,12 +117,12 @@ class AdminQuickAccessesControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Quick access'); - $this->page_header_toolbar_btn['new_quick_access'] = array( - 'href' => self::$currentIndex.'&addquick_access&token='.$this->token, - 'desc' => $this->l('Add new quick access'), - 'icon' => 'process-icon-new' - ); + if (empty($this->display)) + $this->page_header_toolbar_btn['new_quick_access'] = array( + 'href' => self::$currentIndex.'&addquick_access&token='.$this->token, + 'desc' => $this->l('Add new quick access'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminReferrersController.php b/controllers/admin/AdminReferrersController.php index 02a20f9b7..82b24213e 100644 --- a/controllers/admin/AdminReferrersController.php +++ b/controllers/admin/AdminReferrersController.php @@ -155,12 +155,12 @@ class AdminReferrersControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Referrers'); - $this->page_header_toolbar_btn['new_referrer'] = array( - 'href' => self::$currentIndex.'&addreferrer&token='.$this->token, - 'desc' => $this->l('Add new referrer'), - 'icon' => 'process-icon-new' - ); + if(empty($this->display)) + $this->page_header_toolbar_btn['new_referrer'] = array( + 'href' => self::$currentIndex.'&addreferrer&token='.$this->token, + 'desc' => $this->l('Add new referrer'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminRequestSqlController.php b/controllers/admin/AdminRequestSqlController.php index 85b93fcb5..d6e6fc501 100644 --- a/controllers/admin/AdminRequestSqlController.php +++ b/controllers/admin/AdminRequestSqlController.php @@ -267,6 +267,7 @@ class AdminRequestSqlControllerCore extends AdminController { // toolbar (save, cancel, new, ..) $this->initToolbar(); + $this->initPageHeaderToolbar(); if ($this->display == 'edit' || $this->display == 'add') { if (!$this->loadObject(true)) @@ -291,10 +292,25 @@ class AdminRequestSqlControllerCore extends AdminController $this->context->smarty->assign(array( 'content' => $this->content, - 'url_post' => self::$currentIndex.'&token='.$this->token, + 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } + public function initPageHeaderToolbar() + { + if (empty($this->display)) + $this->page_header_toolbar_btn['new_request'] = array( + 'href' => self::$currentIndex.'&addrequest_sql&token='.$this->token, + 'desc' => $this->l('Add new SQL request'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } + /** * Genrating a export file */ diff --git a/controllers/admin/AdminScenesController.php b/controllers/admin/AdminScenesController.php index af8963128..8f6c1f5d5 100644 --- a/controllers/admin/AdminScenesController.php +++ b/controllers/admin/AdminScenesController.php @@ -116,12 +116,12 @@ class AdminScenesControllerCore extends AdminController 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' - ); + if (empty($this->display)) + $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(); } diff --git a/controllers/admin/AdminSearchConfController.php b/controllers/admin/AdminSearchConfController.php index 340af6a71..9812375f8 100644 --- a/controllers/admin/AdminSearchConfController.php +++ b/controllers/admin/AdminSearchConfController.php @@ -191,6 +191,18 @@ class AdminSearchConfControllerCore extends AdminController ); } + public function initPageHeaderToolbar() + { + if (empty($this->display)) + $this->page_header_toolbar_btn['new_alias'] = array( + 'href' => self::$currentIndex.'&addalias&token='.$this->token, + 'desc' => $this->l('Add new alias'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } + public function initProcess() { parent::initProcess(); diff --git a/controllers/admin/AdminSearchEnginesController.php b/controllers/admin/AdminSearchEnginesController.php index cdebc8ef0..7a571324b 100644 --- a/controllers/admin/AdminSearchEnginesController.php +++ b/controllers/admin/AdminSearchEnginesController.php @@ -80,12 +80,12 @@ class AdminSearchEnginesControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Search engines'); - $this->page_header_toolbar_btn['new_search_engine'] = array( - 'href' => self::$currentIndex.'&addsearch_engine&token='.$this->token, - 'desc' => $this->l('Add new search engine'), - 'icon' => 'process-icon-new' - ); + if(empty($this->display)) + $this->page_header_toolbar_btn['new_search_engine'] = array( + 'href' => self::$currentIndex.'&addsearch_engine&token='.$this->token, + 'desc' => $this->l('Add new search engine'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminSlipController.php b/controllers/admin/AdminSlipController.php index 80f2adb9c..2b5035acc 100644 --- a/controllers/admin/AdminSlipController.php +++ b/controllers/admin/AdminSlipController.php @@ -79,7 +79,6 @@ class AdminSlipControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Slips'); $this->page_header_toolbar_btn['generate_pdf'] = array( 'href' => self::$currentIndex.'&token='.$this->token, 'desc' => $this->l('Generate PDF'), @@ -154,13 +153,17 @@ class AdminSlipControllerCore extends AdminController public function initContent() { $this->initToolbar(); + $this->initPageHeaderToolbar(); $this->content .= $this->renderList(); $this->content .= $this->renderForm(); - $this->content .= '
'.$this->renderOptions(); + $this->content .= $this->renderOptions(); $this->context->smarty->assign(array( 'content' => $this->content, 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } diff --git a/controllers/admin/AdminSpecificPriceRuleController.php b/controllers/admin/AdminSpecificPriceRuleController.php index d03ad757b..4137959ee 100755 --- a/controllers/admin/AdminSpecificPriceRuleController.php +++ b/controllers/admin/AdminSpecificPriceRuleController.php @@ -118,12 +118,12 @@ class AdminSpecificPriceRuleControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Specific price rules'); - $this->page_header_toolbar_btn['new_specific_price_rule'] = array( - 'href' => self::$currentIndex.'&addspecific_price_rule&token='.$this->token, - 'desc' => $this->l('Add new specific rule'), - 'icon' => 'process-icon-new' - ); + if (empty($this->display)) + $this->page_header_toolbar_btn['new_specific_price_rule'] = array( + 'href' => self::$currentIndex.'&addspecific_price_rule&token='.$this->token, + 'desc' => $this->l('Add new specific rule'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminStatesController.php b/controllers/admin/AdminStatesController.php index 57d5f42cc..af10c447f 100644 --- a/controllers/admin/AdminStatesController.php +++ b/controllers/admin/AdminStatesController.php @@ -109,12 +109,12 @@ class AdminStatesControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('States'); - $this->page_header_toolbar_btn['new_state'] = array( - 'href' => self::$currentIndex.'&addstate&token='.$this->token, - 'desc' => $this->l('Add new state'), - 'icon' => 'process-icon-new' - ); + if (empty($this->display)) + $this->page_header_toolbar_btn['new_state'] = array( + 'href' => self::$currentIndex.'&addstate&token='.$this->token, + 'desc' => $this->l('Add new state'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminStatsTabController.php b/controllers/admin/AdminStatsTabController.php index 386139bf5..fc3d50156 100644 --- a/controllers/admin/AdminStatsTabController.php +++ b/controllers/admin/AdminStatsTabController.php @@ -42,6 +42,7 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor $this->initTabModuleList(); $this->addToolBarModulesListButton(); $this->toolbar_title = $this->l('Stats', 'AdminStatsTab'); + $this->initPageHeaderToolbar(); if ($this->display == 'view') { // Some controllers use the view action without an object @@ -57,10 +58,19 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor $this->context->smarty->assign(array( 'content' => $this->content, - 'url_post' => self::$currentIndex.'&token='.$this->token, + 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } + public function initPageHeaderToolbar() + { + parent::initPageHeaderToolbar(); + unset($this->page_header_toolbar_btn['back']); + } + public function displayCalendar() { return AdminStatsTabController::displayCalendarForm(array( diff --git a/controllers/admin/AdminStatusesController.php b/controllers/admin/AdminStatusesController.php index 7e18b23ae..fa5a663ef 100644 --- a/controllers/admin/AdminStatusesController.php +++ b/controllers/admin/AdminStatusesController.php @@ -195,18 +195,20 @@ class AdminStatusesControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('States'); - $this->page_header_toolbar_btn['new_order_state'] = array( - 'href' => self::$currentIndex.'&addorder_state&token='.$this->token, - 'desc' => $this->l('Add new order state'), - 'icon' => 'process-icon-new' - ); - $this->page_header_toolbar_btn['new_order_return_state'] = array( - 'href' => self::$currentIndex.'&addorder_return_state&token='.$this->token, - 'desc' => $this->l('Add new order return state'), - 'icon' => 'process-icon-new' - ); - + if (empty($this->display)) + { + $this->page_header_toolbar_btn['new_order_state'] = array( + 'href' => self::$currentIndex.'&addorder_state&token='.$this->token, + 'desc' => $this->l('Add new order state'), + 'icon' => 'process-icon-new' + ); + $this->page_header_toolbar_btn['new_order_return_state'] = array( + 'href' => self::$currentIndex.'&addorder_return_state&token='.$this->token, + 'desc' => $this->l('Add new order return state'), + 'icon' => 'process-icon-new' + ); + } + parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminStockManagementController.php b/controllers/admin/AdminStockManagementController.php index ef4c07f53..4eac01463 100644 --- a/controllers/admin/AdminStockManagementController.php +++ b/controllers/admin/AdminStockManagementController.php @@ -78,8 +78,6 @@ class AdminStockManagementControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Stock management'); - if ($this->display == 'details') $this->page_header_toolbar_btn['back_to_list'] = array( 'href' => Context::getContext()->link->getAdminLink('AdminStockManagement'), @@ -1036,6 +1034,8 @@ class AdminStockManagementControllerCore extends AdminController $helper = new HelperForm(); + $this->initPageHeaderToolbar(); + // Check if form template has been overriden if (file_exists($this->context->smarty->getTemplateDir(0).'/'.$this->tpl_folder.'form.tpl')) $helper->tpl = $this->tpl_folder.'form.tpl'; @@ -1079,7 +1079,10 @@ class AdminStockManagementControllerCore extends AdminController $this->content .= $helper->generateForm($this->fields_form); $this->context->smarty->assign(array( - 'content' => $this->content + 'content' => $this->content, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } else diff --git a/controllers/admin/AdminStoresController.php b/controllers/admin/AdminStoresController.php index 46366f32b..3ac5cf2d1 100644 --- a/controllers/admin/AdminStoresController.php +++ b/controllers/admin/AdminStoresController.php @@ -129,6 +129,18 @@ class AdminStoresControllerCore extends AdminController unset($this->toolbar_btn['save']); } + public function initPageHeaderToolbar() + { + if (empty($this->display)) + $this->page_header_toolbar_btn['new_store'] = array( + 'href' => self::$currentIndex.'&addstore&token='.$this->token, + 'desc' => $this->l('Add new store'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } + public function renderList() { // Set toolbar options diff --git a/controllers/admin/AdminSuppliersController.php b/controllers/admin/AdminSuppliersController.php index 12f2eb438..813635d82 100644 --- a/controllers/admin/AdminSuppliersController.php +++ b/controllers/admin/AdminSuppliersController.php @@ -72,12 +72,12 @@ class AdminSuppliersControllerCore extends AdminController 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' - ); + if (empty($this->display)) + $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(); } diff --git a/controllers/admin/AdminSupplyOrdersController.php b/controllers/admin/AdminSupplyOrdersController.php index 81b2c7127..14ecb53aa 100644 --- a/controllers/admin/AdminSupplyOrdersController.php +++ b/controllers/admin/AdminSupplyOrdersController.php @@ -149,15 +149,13 @@ class AdminSupplyOrdersControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Supply orders'); - if ($this->display == 'details') $this->page_header_toolbar_btn['back'] = array( 'href' => Context::getContext()->link->getAdminLink('AdminSupplyOrders'), 'desc' => $this->l('Back to list'), 'icon' => 'process-icon-back' ); - else + elseif (empty($this->display)) { $this->page_header_toolbar_btn['new_supply_order'] = array( 'href' => self::$currentIndex.'&addsupply_order&token='.$this->token, @@ -575,6 +573,7 @@ class AdminSupplyOrdersControllerCore extends AdminController $this->display = 'update_order_state'; // overrides parent::initContent(); $this->initToolbar(); + $this->initPageHeaderToolbar(); // given the current state, loads available states $states = SupplyOrderState::getSupplyOrderStates($supply_order->id_supply_order_state); @@ -636,7 +635,10 @@ class AdminSupplyOrdersControllerCore extends AdminController $this->context->smarty->assign(array( 'content' => $content, - 'url_post' => self::$currentIndex.'&token='.$this->token, + 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } @@ -719,6 +721,8 @@ class AdminSupplyOrdersControllerCore extends AdminController if (!Validate::isLoadedObject($supply_order)) return parent::initContent(); + $this->initPageHeaderToolbar(); + // re-defines fields_list $this->fields_list = array( 'supplier_reference' => array( @@ -855,7 +859,10 @@ class AdminSupplyOrdersControllerCore extends AdminController // assigns var $this->context->smarty->assign(array( - 'content' => $content, + 'content' => $content, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } diff --git a/controllers/admin/AdminTabsController.php b/controllers/admin/AdminTabsController.php index 64b95e9a1..4ebfb054c 100644 --- a/controllers/admin/AdminTabsController.php +++ b/controllers/admin/AdminTabsController.php @@ -93,7 +93,7 @@ class AdminTabsControllerCore extends AdminController 'desc' => $this->l('Back to list'), 'icon' => 'process-icon-back' ); - else + elseif(empty($this->display)) $this->page_header_toolbar_btn['new_menu'] = array( 'href' => self::$currentIndex.'&addtab&token='.$this->token, 'desc' => $this->l('Add new menu'), diff --git a/controllers/admin/AdminTagsController.php b/controllers/admin/AdminTagsController.php index 6f879d4cf..0ec2abb15 100644 --- a/controllers/admin/AdminTagsController.php +++ b/controllers/admin/AdminTagsController.php @@ -68,12 +68,12 @@ class AdminTagsControllerCore extends AdminController 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' - ); + if (empty($this->display)) + $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(); } diff --git a/controllers/admin/AdminTaxesController.php b/controllers/admin/AdminTaxesController.php index d21cb85c3..e99020dd7 100644 --- a/controllers/admin/AdminTaxesController.php +++ b/controllers/admin/AdminTaxesController.php @@ -108,6 +108,18 @@ class AdminTaxesControllerCore extends AdminController $this->_where .= ' AND a.deleted = 0'; } + public function initPageHeaderToolbar() + { + if (empty($this->display)) + $this->page_header_toolbar_btn['new_tax'] = array( + 'href' => self::$currentIndex.'&addtax&token='.$this->token, + 'desc' => $this->l('Add new tax'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } + /** * Display delete action link */ diff --git a/controllers/admin/AdminThemesController.php b/controllers/admin/AdminThemesController.php index 86cce5625..cc62e062c 100644 --- a/controllers/admin/AdminThemesController.php +++ b/controllers/admin/AdminThemesController.php @@ -396,6 +396,18 @@ class AdminThemesControllerCore extends AdminController return parent::processDelete(); } + public function initPageHeaderToolbar() + { + if (empty($this->display)) + $this->page_header_toolbar_btn['new_theme'] = array( + 'href' => self::$currentIndex.'&addtheme&token='.$this->token, + 'desc' => $this->l('Add new theme'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } + public function initContent() { @@ -434,8 +446,10 @@ class AdminThemesControllerCore extends AdminController public function ajaxProcessGetAddonsThemes() { // notice : readfile should be replaced by something else - if (@fsockopen('addons.prestashop.com', 80, $errno, $errst, 3)) - @readfile('http://addons.prestashop.com/adminthemes.php?lang='.$this->context->language->iso_code); + /*if (@fsockopen('addons.prestashop.com', 80, $errno, $errst, 3)) + @readfile('http://addons.prestashop.com/adminthemes.php?lang='.$this->context->language->iso_code);*/ + + die(Tools::file_get_contents('http://addons.prestashop.com/adminthemes.php?lang='.$this->context->language->iso_code)); } /** diff --git a/controllers/admin/AdminTrackingController.php b/controllers/admin/AdminTrackingController.php index a0b9a5854..3a942a915 100644 --- a/controllers/admin/AdminTrackingController.php +++ b/controllers/admin/AdminTrackingController.php @@ -53,6 +53,8 @@ class AdminTrackingControllerCore extends AdminController public function initContent() { + $this->initPageHeaderToolbar(); + if ($id_category = Tools::getValue('id_category') && Tools::getIsset('viewcategory')) Tools::redirectAdmin($this->context->link->getAdminLink('AdminProducts').'&id_category='.(int)$id_category.'&viewcategory'); @@ -72,15 +74,12 @@ class AdminTrackingControllerCore extends AdminController $this->context->smarty->assign(array( 'content' => $this->content, 'url_post' => self::$currentIndex.'&token='.$this->token, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn )); } - public function initPageHeaderToolbar() - { - $this->page_header_toolbar_title = $this->l('Monitoring'); - parent::initPageHeaderToolbar(); - } - public function getCustomListCategoriesEmpty() { $this->table = 'category'; diff --git a/controllers/admin/AdminTranslationsController.php b/controllers/admin/AdminTranslationsController.php index 216f6ee5d..c0257f4e7 100644 --- a/controllers/admin/AdminTranslationsController.php +++ b/controllers/admin/AdminTranslationsController.php @@ -98,6 +98,8 @@ class AdminTranslationsControllerCore extends AdminController */ public function initContent() { + $this->initPageHeaderToolbar(); + if (!is_null($this->type_selected)) { $method_name = 'initForm'.$this->type_selected; @@ -112,7 +114,11 @@ class AdminTranslationsControllerCore extends AdminController else $this->content = $this->initMain(); - $this->context->smarty->assign(array('content' => $this->content)); + $this->context->smarty->assign(array( + 'content' => $this->content, + 'show_page_header_toolbar' => $this->show_page_header_toolbar, + 'page_header_toolbar_title' => $this->page_header_toolbar_title, + 'page_header_toolbar_btn' => $this->page_header_toolbar_btn)); } /** diff --git a/controllers/admin/AdminWarehousesController.php b/controllers/admin/AdminWarehousesController.php index a65e38048..db98b4ffe 100644 --- a/controllers/admin/AdminWarehousesController.php +++ b/controllers/admin/AdminWarehousesController.php @@ -72,12 +72,12 @@ class AdminWarehousesControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Warehouses'); - $this->page_header_toolbar_btn['new_warehouse'] = array( - 'href' => self::$currentIndex.'&addwarehouse&token='.$this->token, - 'desc' => $this->l('Add new warehouse'), - 'icon' => 'process-icon-new' - ); + if(empty($this->display)) + $this->page_header_toolbar_btn['new_warehouse'] = array( + 'href' => self::$currentIndex.'&addwarehouse&token='.$this->token, + 'desc' => $this->l('Add new warehouse'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminWebserviceController.php b/controllers/admin/AdminWebserviceController.php index 4ec04e96b..fd2890773 100755 --- a/controllers/admin/AdminWebserviceController.php +++ b/controllers/admin/AdminWebserviceController.php @@ -92,6 +92,19 @@ class AdminWebserviceControllerCore extends AdminController parent::__construct(); } + public function initPageHeaderToolbar() + { + if (empty($this->display)) + $this->page_header_toolbar_btn['new_webservice'] = array( + 'href' => self::$currentIndex.'&addwebservice_account&token='.$this->token, + 'desc' => $this->l('Add new webservice'), + 'icon' => 'process-icon-new' + ); + + parent::initPageHeaderToolbar(); + } + + protected function processUpdateOptions() { parent::processUpdateOptions(); diff --git a/controllers/admin/AdminZonesController.php b/controllers/admin/AdminZonesController.php index c54ad30eb..12e095fc0 100644 --- a/controllers/admin/AdminZonesController.php +++ b/controllers/admin/AdminZonesController.php @@ -64,12 +64,12 @@ class AdminZonesControllerCore extends AdminController public function initPageHeaderToolbar() { - $this->page_header_toolbar_title = $this->l('Zones'); - $this->page_header_toolbar_btn['new_zone'] = array( - 'href' => self::$currentIndex.'&addzone&token='.$this->token, - 'desc' => $this->l('Add new zone'), - 'icon' => 'process-icon-new' - ); + if (empty($this->display)) + $this->page_header_toolbar_btn['new_zone'] = array( + 'href' => self::$currentIndex.'&addzone&token='.$this->token, + 'desc' => $this->l('Add new zone'), + 'icon' => 'process-icon-new' + ); parent::initPageHeaderToolbar(); }