// More breadcrumbs improvements
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="robots" content="NOFOLLOW, NOINDEX">
|
||||
<title>{$shop_name} {if $meta_title != ''}- {$meta_title}{/if} - PrestaShop™</title>
|
||||
<title>{$shop_name} {if $meta_title != ''}{$navigationPipe|escape:'htmlall':'UTF-8'} {$meta_title}{/if} (PrestaShop™)</title>
|
||||
{if $display_header}
|
||||
<script type="text/javascript">
|
||||
var help_class_name = '{$controller_name}';
|
||||
|
||||
@@ -356,14 +356,24 @@ class AdminControllerCore extends Controller
|
||||
*/
|
||||
public function initBreadcrumbs()
|
||||
{
|
||||
/* Breadcrumb */
|
||||
$navigationPipe = (Configuration::get('PS_NAVIGATION_PIPE') ? Configuration::get('PS_NAVIGATION_PIPE') : '>');
|
||||
$this->context->smarty->assign('navigationPipe', $navigationPipe);
|
||||
|
||||
$tabs = array();
|
||||
$tabs = Tab::recursiveTab($this->id, $tabs);
|
||||
$tabs = array_reverse($tabs);
|
||||
$prev = '';
|
||||
foreach ($tabs as $tab)
|
||||
{
|
||||
if (!empty($prev) && $prev == $tab['name'])
|
||||
array_pop($this->breadcrumbs);
|
||||
$prev = $tab['name'];
|
||||
if ($tab['id_parent'] != 0)
|
||||
$this->breadcrumbs[] = '<a href="'.Tools::htmlentitiesUTF8($this->context->link->getAdminLink($tab['class_name'])).'">'.$tab['name'].'</a>';
|
||||
else
|
||||
$this->breadcrumbs[] = $tab['name'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -373,24 +383,29 @@ class AdminControllerCore extends Controller
|
||||
*/
|
||||
public function initToolbarTitle()
|
||||
{
|
||||
$bread_extended = array_unique($this->breadcrumbs);
|
||||
$this->toolbar_title = array_unique($this->breadcrumbs);
|
||||
|
||||
switch ($this->display)
|
||||
{
|
||||
case 'edit':
|
||||
$bread_extended[] = $this->l('Edit');
|
||||
$this->toolbar_title[] = $this->l('Edit');
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
$bread_extended[] = $this->l('Add new');
|
||||
$this->toolbar_title[] = $this->l('Add new');
|
||||
break;
|
||||
|
||||
case 'view':
|
||||
$bread_extended[] = $this->l('View');
|
||||
$this->toolbar_title[] = $this->l('View');
|
||||
break;
|
||||
}
|
||||
$this->toolbar_title = $bread_extended;
|
||||
|
||||
|
||||
if ($filter = $this->addFiltersToBreadcrumbs())
|
||||
$this->toolbar_title[] = $filter;
|
||||
}
|
||||
|
||||
public function addFiltersToBreadcrumbs()
|
||||
{
|
||||
if (Tools::isSubmit('submitFilter'))
|
||||
{
|
||||
$filters = array();
|
||||
@@ -424,7 +439,7 @@ class AdminControllerCore extends Controller
|
||||
}
|
||||
|
||||
if (count($filters))
|
||||
$this->toolbar_title[] = sprintf($this->l('filter by %s'), implode(', ', $filters));
|
||||
return sprintf($this->l('filter by %s'), implode(', ', $filters));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1272,7 +1287,7 @@ class AdminControllerCore extends Controller
|
||||
|
||||
// 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->meta_title = strip_tags(is_array($this->toolbar_title) ? implode(' '.Configuration::get('PS_NAVIGATION_PIPE').' ', $this->toolbar_title) : $this->toolbar_title);
|
||||
$this->context->smarty->assign('meta_title', $this->meta_title);
|
||||
|
||||
$tpl_action = $this->tpl_folder.$this->display.'.tpl';
|
||||
@@ -1783,7 +1798,7 @@ class AdminControllerCore extends Controller
|
||||
$helper->id = $this->object->id;
|
||||
|
||||
// @todo : move that in Helper
|
||||
$helper->title = implode(' > ', $this->toolbar_title);
|
||||
$helper->title = is_array($this->toolbar_title) ? implode(' '.Configuration::get('PS_NAVIGATION_PIPE').' ', $this->toolbar_title) : $this->toolbar_title;
|
||||
$helper->toolbar_btn = $this->toolbar_btn;
|
||||
$helper->show_toolbar = $this->show_toolbar;
|
||||
$helper->toolbar_scroll = $this->toolbar_scroll;
|
||||
|
||||
@@ -187,6 +187,15 @@ class AdminCustomersControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function initToolbarTitle()
|
||||
{
|
||||
parent::initToolbarTitle();
|
||||
|
||||
if ($this->display != 'list')
|
||||
if (($customer = $this->loadObject(true)) && Validate::isLoadedObject($customer))
|
||||
$this->toolbar_title[] = Tools::htmlentitiesUTF8(Tools::substr($customer->firstname, 0, 1).'. '.$customer->firstname);
|
||||
}
|
||||
|
||||
public function initPageHeaderToolbar()
|
||||
{
|
||||
$this->page_header_toolbar_title = $this->l('Customers');
|
||||
|
||||
@@ -2524,9 +2524,10 @@ class AdminProductsControllerCore extends AdminController
|
||||
public function initToolbarTitle()
|
||||
{
|
||||
parent::initToolbarTitle();
|
||||
if ($product = $this->loadObject(true))
|
||||
if ((bool)$product->id && $this->display != 'list' && isset($this->toolbar_title[2]))
|
||||
$this->toolbar_title[2] = $this->toolbar_title[2].' ('.$this->product_name.')';
|
||||
|
||||
if ($this->display != 'list')
|
||||
if (($product = $this->loadObject(true)) && Validate::isLoadedObject($product))
|
||||
$this->toolbar_title[] = Tools::htmlentitiesUTF8($this->product_name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
<field name="active"/>
|
||||
</fields>
|
||||
<entities>
|
||||
<tab id="Home" id_parent="-1" active="1">
|
||||
<class_name>AdminHome</class_name>
|
||||
</tab>
|
||||
<tab id="Dashboard" id_parent="-1" active="1">
|
||||
<class_name>AdminDashboard</class_name>
|
||||
</tab>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<tab id="General" name="Geral"/>
|
||||
<tab id="Geolocation" name="Geolocalização"/>
|
||||
<tab id="Groups" name="Grupos"/>
|
||||
<tab id="Home" name="Início"/>
|
||||
<tab id="Dashboard" name="Dashboard"/>
|
||||
<tab id="Image_Mapping" name="Mapeamento de Imagem"/>
|
||||
<tab id="Images" name="Imagens"/>
|
||||
<tab id="Instant_Stock_Status" name="Status atual do estoque"/>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<tab id="General" name="Allgemein"/>
|
||||
<tab id="Geolocation" name="Geotargeting"/>
|
||||
<tab id="Groups" name="Gruppen"/>
|
||||
<tab id="Home" name="Startseite"/>
|
||||
<tab id="Dashboard" name="Dashboard"/>
|
||||
<tab id="Image_Mapping" name="Bilder-Mapping"/>
|
||||
<tab id="Images" name="Bilder"/>
|
||||
<tab id="Instant_Stock_Status" name="aktueller Lagerstand"/>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<entity_tab>
|
||||
<tab id="Home" name="Home"/>
|
||||
<tab id="Dashboard" name="Dashboard"/>
|
||||
<tab id="CMS_Pages" name="CMS Pages"/>
|
||||
<tab id="CMS_Categories" name="CMS Categories"/>
|
||||
<tab id="Combinations_Generator" name="Combinations Generator"/>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<tab id="General" name="General"/>
|
||||
<tab id="Geolocation" name="Localización"/>
|
||||
<tab id="Groups" name="Grupos"/>
|
||||
<tab id="Home" name="Inicio"/>
|
||||
<tab id="Dashboard" name="Dashboard"/>
|
||||
<tab id="Image_Mapping" name="Cartografía de imágenes"/>
|
||||
<tab id="Images" name="Imágenes"/>
|
||||
<tab id="Instant_Stock_Status" name="Estado de existencias instantes"/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<entity_tab>
|
||||
<tab id="Addresses" name="Adresses"/>
|
||||
<tab id="Dashboard" name="Dasboard"/>
|
||||
<tab id="Dashboard" name="Tableau de Bord"/>
|
||||
<tab id="Administration" name="Administration"/>
|
||||
<tab id="Advanced_Parameters" name="Paramètres avancés"/>
|
||||
<tab id="Attachments" name="Documents joints"/>
|
||||
@@ -34,7 +34,6 @@
|
||||
<tab id="General" name="Générales"/>
|
||||
<tab id="Geolocation" name="Géolocalisation"/>
|
||||
<tab id="Groups" name="Groupes"/>
|
||||
<tab id="Home" name="Accueil"/>
|
||||
<tab id="Image_Mapping" name="Scènes"/>
|
||||
<tab id="Images" name="Images"/>
|
||||
<tab id="Instant_Stock_Status" name="Etat instantané du stock"/>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<tab id="General" name="Generale"/>
|
||||
<tab id="Geolocation" name="Geolocalizzazione"/>
|
||||
<tab id="Groups" name="Gruppi"/>
|
||||
<tab id="Home" name="Home page"/>
|
||||
<tab id="Dashboard" name="Dashboard"/>
|
||||
<tab id="Image_Mapping" name="Mapping Immagine"/>
|
||||
<tab id="Images" name="Immagini"/>
|
||||
<tab id="Instant_Stock_Status" name="Stato dello stock Istantaneo"/>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<entity_tab>
|
||||
<tab id="Home" name="Home"/>
|
||||
<tab id="Dashboard" name="Dashboard"/>
|
||||
<tab id="CMS_Pages" name="CMS Pages"/>
|
||||
<tab id="CMS_Categories" name="CMS Categories"/>
|
||||
<tab id="Combinations_Generator" name="Combinations Generator"/>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<tab id="General" name="Ustawienia główne"/>
|
||||
<tab id="Geolocation" name="Lokalizacja geograficzna"/>
|
||||
<tab id="Groups" name="Grupy"/>
|
||||
<tab id="Home" name="Strona główna"/>
|
||||
<tab id="Dashboard" name="Dashboard"/>
|
||||
<tab id="Image_Mapping" name="Image Mapping"/>
|
||||
<tab id="Images" name="Obrazki"/>
|
||||
<tab id="Instant_Stock_Status" name="Natychmiastowe stany magazynowe"/>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<tab id="General" name="Общие настройки"/>
|
||||
<tab id="Geolocation" name="Геолокация"/>
|
||||
<tab id="Groups" name="Группы"/>
|
||||
<tab id="Home" name="Домой"/>
|
||||
<tab id="Dashboard" name="Dashboard"/>
|
||||
<tab id="Image_Mapping" name="Карта картинок"/>
|
||||
<tab id="Images" name="изображения"/>
|
||||
<tab id="Instant_Stock_Status" name="Текущее состояние склада"/>
|
||||
|
||||
Reference in New Issue
Block a user