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 be24c380c..a1eb3acf7 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
@@ -24,19 +24,8 @@
* International Registered Trademark & Property of PrestaShop SA
*}
-{if $show_toolbar}
-
-{/if}
+{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/modules_positions/form.tpl b/admin-dev/themes/default/template/controllers/modules_positions/form.tpl
index 6f16137b2..341349287 100644
--- a/admin-dev/themes/default/template/controllers/modules_positions/form.tpl
+++ b/admin-dev/themes/default/template/controllers/modules_positions/form.tpl
@@ -24,16 +24,9 @@
* 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/classes/controller/AdminController.php b/classes/controller/AdminController.php
index 87e7fb6c3..b0a087ed6 100644
--- a/classes/controller/AdminController.php
+++ b/classes/controller/AdminController.php
@@ -41,7 +41,7 @@ class AdminControllerCore extends Controller
public $layout = 'layout.tpl';
- public $meta_title = 'Administration panel';
+ protected $meta_title;
public $template = 'content.tpl';
@@ -258,7 +258,6 @@ class AdminControllerCore extends Controller
$this->controller_name = get_class($this);
if (strpos($this->controller_name, 'Controller'))
$this->controller_name = substr($this->controller_name, 0, -10);
-
parent::__construct();
if ($this->multishop_context == -1)
@@ -313,6 +312,18 @@ class AdminControllerCore extends Controller
$this->initShopContext();
}
+ /**
+ * Set breadcrumbs array for the controller page
+ */
+ public function initBreadcrumbs()
+ {
+ $tabs = array();
+ $tabs = Tab::recursiveTab($this->id, $tabs);
+ $tabs = array_reverse($tabs);
+ foreach ($tabs as $tab)
+ $this->breadcrumbs[] = $tab['name'];
+ }
+
/**
* set default toolbar_title to admin breadcrumb
*
@@ -320,36 +331,23 @@ class AdminControllerCore extends Controller
*/
public function initToolbarTitle()
{
- // Breadcrumbs
- $tabs = array();
- $tabs = Tab::recursiveTab($this->id, $tabs);
- $tabs = array_reverse($tabs);
+ $bread_extended = array_unique($this->breadcrumbs);
- $bread = '';
switch ($this->display)
{
case 'edit':
- $current_tab = array_pop($tabs);
- $tabs[] = array('name' => sprintf($this->l('Edit %s'), $current_tab['name']));
+ $bread_extended[] = $this->l('Edit');
break;
case 'add':
- $current_tab = array_pop($tabs);
- $tabs[] = array('name' => sprintf($this->l('Add %s'), $current_tab['name']));
+ $bread_extended[] = $this->l('Add new');
break;
case 'view':
- $current_tab = array_pop($tabs);
- $tabs[] = array('name' => sprintf($this->l('View %s'), $current_tab['name']));
+ $bread_extended[] = $this->l('View');
break;
}
- // note : this should use a tpl file
- foreach ($tabs as $key => $item)
- $bread .= '
'.Tools::safeOutput($item['name']).' : ';
-
- $bread = rtrim($bread, ': ');
-
- $this->toolbar_title = $bread;
+ $this->toolbar_title = $bread_extended;
}
/**
@@ -1081,6 +1079,10 @@ class AdminControllerCore extends Controller
{
$this->context->smarty->assign('display_header', $this->display_header);
$this->context->smarty->assign('display_footer', $this->display_footer);
+
+ // Use page title from meta_title if it has been set else from the breadcrumbs array
+ if (!$this->meta_title)
+ $this->meta_title = isset($this->breadcrumbs[1]) ? $this->breadcrumbs[1] : $this->breadcrumbs[0];
$this->context->smarty->assign('meta_title', $this->meta_title);
$tpl_action = $this->tpl_folder.$this->display.'.tpl';
@@ -1556,7 +1558,7 @@ class AdminControllerCore extends Controller
* non-static method which uses AdminController::translate()
*
* @param mixed $string term or expression in english
- * @param string $class name of the class, without "Controller" suffix
+ * @param string $class name of the class
* @param boolan $addslashes if set to true, the return value will pass through addslashes(). Otherwise, stripslashes().
* @param boolean $htmlentities if set to true(default), the return value will pass through htmlentities($string, ENT_QUOTES, 'utf-8')
* @return string the translation if available, or the english default text.
@@ -1681,6 +1683,8 @@ class AdminControllerCore extends Controller
$this->context->shop = new Shop(Configuration::get('PS_SHOP_DEFAULT'));
elseif ($this->context->shop->id != $shop_id)
$this->context->shop = new Shop($shop_id);
+
+ $this->initBreadcrumbs();
}
/**
diff --git a/classes/helper/HelperView.php b/classes/helper/HelperView.php
index 02d018343..c2b313f42 100644
--- a/classes/helper/HelperView.php
+++ b/classes/helper/HelperView.php
@@ -49,7 +49,6 @@ class HelperViewCore extends Helper
$this->tpl->assign(array(
'title' => $this->title,
'current' => $this->currentIndex,
- 'title' => $this->title,
'token' => $this->token,
'table' => $this->table,
'show_toolbar' => $this->show_toolbar,
diff --git a/controllers/admin/AdminAttributeGeneratorController.php b/controllers/admin/AdminAttributeGeneratorController.php
index e0e4ca946..83ca7c67b 100644
--- a/controllers/admin/AdminAttributeGeneratorController.php
+++ b/controllers/admin/AdminAttributeGeneratorController.php
@@ -249,6 +249,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController
'attribute_groups' => $attribute_groups,
'attribute_js' => $js_attributes,
'toolbar_btn' => $this->toolbar_btn,
+ 'toolbar_scroll' => true,
'title' => $this->toolbar_title,
));
}
diff --git a/controllers/admin/AdminAttributesGroupsController.php b/controllers/admin/AdminAttributesGroupsController.php
index 6a6692e63..5ef3f3c0c 100644
--- a/controllers/admin/AdminAttributesGroupsController.php
+++ b/controllers/admin/AdminAttributesGroupsController.php
@@ -504,36 +504,29 @@ class AdminAttributesGroupsControllerCore extends AdminController
public function initToolbarTitle()
{
- // Breadcrumbs
- $tabs = array();
- $tabs = Tab::recursiveTab($this->id, $tabs);
- $tabs = array_reverse($tabs);
+ $this->initBreadcrumbs();
+
+ $bread_extended = $this->breadcrumbs;
- $bread = '';
switch ($this->display)
{
case 'edit':
- $tabs[] = array('name' => $this->l('Edit new Attribute'));
+ $bread_extended[] = $this->l('Edit new Attribute');
break;
case 'add':
- $tabs[] = array('name' => $this->l('Add new Attribute'));
+ $bread_extended[] = $this->l('Add new Attribute');
break;
case 'editAttributes':
if ($this->id_attribute)
- $tabs[] = array('name' => $this->l('Edit Value'));
+ $bread_extended[] = $this->l('Edit Value');
else
- $tabs[] = array('name' => $this->l('Add new Value'));
+ $bread_extended[] = $this->l('Add new Value');
break;
}
- // note : this should use a tpl file
- foreach ($tabs as $key => $item)
- $bread .= '
'.$item['name'].' : ';
- $bread = rtrim($bread, ': ');
-
- $this->toolbar_title = $bread;
+ $this->toolbar_title = $bread_extended;
}
public function initProcess()
diff --git a/controllers/admin/AdminCartRulesController.php b/controllers/admin/AdminCartRulesController.php
index 9133cc001..ae7cfcd99 100644
--- a/controllers/admin/AdminCartRulesController.php
+++ b/controllers/admin/AdminCartRulesController.php
@@ -476,7 +476,7 @@ class AdminCartRulesControllerCore extends AdminController
'show_toolbar' => true,
'toolbar_btn' => $this->toolbar_btn,
'toolbar_scroll' => $this->toolbar_scroll,
- 'title' => $this->l('Payment: Cart Rules'),
+ 'title' => array($this->l('Payment'), $this->l('Cart Rules')),
'defaultDateFrom' => date('Y-m-d H:00:00'),
'defaultDateTo' => date('Y-m-d H:00:00', strtotime('+1 month')),
'customerFilter' => $customer_filter,
diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php
index a46fda99f..9be039dbb 100644
--- a/controllers/admin/AdminModulesController.php
+++ b/controllers/admin/AdminModulesController.php
@@ -409,11 +409,6 @@ class AdminModulesControllerCore extends AdminController
}
}
-
-
-
-
-
/*
** Filter Configuration Methods
** Set and reset filter configuration
@@ -436,9 +431,6 @@ class AdminModulesControllerCore extends AdminController
Configuration::updateValue('PS_SHOW_CAT_MODULES_'.(int)$this->id_employee, '');
}
-
-
-
/*
** Post Process Filter
**
@@ -470,11 +462,6 @@ class AdminModulesControllerCore extends AdminController
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token);
}
-
-
-
-
-
/*
** Post Process Module CallBack
**
@@ -875,12 +862,10 @@ class AdminModulesControllerCore extends AdminController
return false;
}
-
// Filter on interest
if ((int)Db::getInstance()->getValue('SELECT `id_module_preference` FROM `'._DB_PREFIX_.'module_preference` WHERE `module` = \''.pSQL($module->name).'\' AND `id_employee` = '.(int)$this->id_employee.' AND `interest` = 0') > 0)
return true;
-
// Filter on favorites
if (Configuration::get('PS_SHOW_CAT_MODULES_'.(int)$this->id_employee) == 'favorites')
{
@@ -904,7 +889,6 @@ class AdminModulesControllerCore extends AdminController
return true;
}
-
// Filter on module type and author
$show_type_modules = $this->filter_configuration['PS_SHOW_TYPE_MODULES_'.(int)$this->id_employee];
if ($show_type_modules == 'nativeModules' && !in_array($module->name, $this->list_natives_modules))
@@ -924,7 +908,6 @@ class AdminModulesControllerCore extends AdminController
return true;
}
-
// Filter on install status
$show_installed_modules = $this->filter_configuration['PS_SHOW_INSTALLED_MODULES_'.(int)$this->id_employee];
if ($show_installed_modules == 'installed' && !$module->id)
@@ -940,7 +923,6 @@ class AdminModulesControllerCore extends AdminController
if ($show_enabled_modules == 'disabled' && $module->active)
return true;
-
// Filter on country
$show_country_modules = $this->filter_configuration['PS_SHOW_COUNTRY_MODULES_'.(int)$this->id_employee];
if ($show_country_modules && (isset($module->limited_countries) && !empty($module->limited_countries)
@@ -949,7 +931,6 @@ class AdminModulesControllerCore extends AdminController
|| (!is_array($module->limited_countries) && strtolower($this->iso_default_country) != strval($module->limited_countries)))))
return true;
-
// Module has not been filtered
return false;
}
@@ -990,7 +971,6 @@ class AdminModulesControllerCore extends AdminController
$modules_preferences[$v['module']] = $v;
}
-
// Retrieve Modules List
$modules = Module::getModulesOnDisk(true, $this->logged_on_addons);
$this->initModulesList($modules);
diff --git a/controllers/admin/AdminModulesPositionsController.php b/controllers/admin/AdminModulesPositionsController.php
index d3997695a..5790651f2 100644
--- a/controllers/admin/AdminModulesPositionsController.php
+++ b/controllers/admin/AdminModulesPositionsController.php
@@ -360,6 +360,7 @@ class AdminModulesPositionsControllerCore extends AdminController
'modules' => $modules,
'show_toolbar' => true,
'toolbar_btn' => $this->toolbar_btn,
+ 'toolbar_scroll' => $this->toolbar_scroll,
'title' => $this->toolbar_title,
'table' => 'hook_module',
));
diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php
index 603792454..17209950e 100755
--- a/controllers/admin/AdminOrdersController.php
+++ b/controllers/admin/AdminOrdersController.php
@@ -166,7 +166,7 @@ class AdminOrdersControllerCore extends AdminController
'show_toolbar' => $this->show_toolbar,
'toolbar_btn' => $this->toolbar_btn,
'toolbar_scroll' => $this->toolbar_scroll,
- 'title' => $this->l('Orders: create order'),
+ 'title' => array($this->l('Orders'), $this->l('create order')),
));
$this->content .= $this->createTemplate('form.tpl')->fetch();
}
diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php
index 9217b6c05..a262bb244 100644
--- a/controllers/admin/AdminProductsController.php
+++ b/controllers/admin/AdminProductsController.php
@@ -2133,7 +2133,7 @@ class AdminProductsControllerCore extends AdminController
parent::initToolbarTitle();
if ($product = $this->loadObject(true))
if ((bool)$product->id)
- $this->toolbar_title .= ' ('.$product->name[$this->context->language->id].')';
+ $this->toolbar_title[2] = $this->toolbar_title[2].' ('.$product->name[$this->context->language->id].')';
}
/**