[*] BO : #PI-123 - toolbar and page title refactoring
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14594 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -168,18 +168,10 @@
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<div class="toolbarBox">
|
||||
{if $show_toolbar}
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
|
||||
<div class="pageTitle">
|
||||
<h3>{block name=pageTitle}
|
||||
<span id="current_obj" style="font-weight: normal;">{$title|default:' '}</span>
|
||||
{/block}</h3>
|
||||
</div>
|
||||
{/if}
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="productTabs">
|
||||
<ul class="tab">
|
||||
|
||||
@@ -24,16 +24,10 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<div class="toolbarBox">
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
|
||||
<div class="pageTitle">
|
||||
<h3>
|
||||
<span id="current_obj" style="font-weight: normal;">
|
||||
{$title|default:' '}
|
||||
</span>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
{if $show_toolbar}
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
{/if}
|
||||
|
||||
{if !$has_shop_selected}
|
||||
<div class="hint" style="display:block">{l s='Please select the shop you want to configure'}</div>
|
||||
|
||||
+4
-10
@@ -24,16 +24,10 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<div class="toolbarBox">
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
|
||||
<div class="pageTitle">
|
||||
<h3>
|
||||
<span id="current_obj" style="font-weight: normal;">
|
||||
{$title|default:' '}
|
||||
</span>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
{if $show_toolbar}
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
{/if}
|
||||
|
||||
<div id="account_list">
|
||||
{foreach from=$account_number_list item=detail key=name}
|
||||
|
||||
@@ -58,14 +58,10 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="toolbarBox">
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
|
||||
<div class="pageTitle">
|
||||
<h3>
|
||||
<span id="current_obj" style="font-weight: normal;">{$title|default:' '}</span>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
|
||||
|
||||
{if $generate}
|
||||
<div class="module_confirmation conf confirm">
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
{if $show_toolbar}
|
||||
<div class="toolbar-placeholder">
|
||||
<div class="toolbarBox {if $toolbar_scroll}toolbarHead{/if}">
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
|
||||
<div class="pageTitle">
|
||||
<h3>
|
||||
{block name=pageTitle}
|
||||
<span id="current_obj" style="font-weight: normal;">{$title|default:' '}</span>
|
||||
{/block}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
{/if}
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
|
||||
<div>
|
||||
<div class="productTabs">
|
||||
|
||||
@@ -24,19 +24,8 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
{if $show_toolbar}
|
||||
<div class="toolbar-placeholder">
|
||||
<div class="toolbarBox{if $toolbar_scroll} toolbarHead{/if}">
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
|
||||
<div class="pageTitle">
|
||||
<h3>
|
||||
<span id="current_obj" style="font-weight: normal;">{$title|default:' '}</span>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
|
||||
{if $module_confirmation}
|
||||
<div class="module_confirmation conf confirm">
|
||||
|
||||
@@ -24,16 +24,9 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<div class="toolbarBox">
|
||||
{if $show_toolbar}
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
|
||||
<div class="pageTitle">
|
||||
<h3>{block name=pageTitle}
|
||||
<span id="current_obj" style="font-weight: normal;">{$title|default:' '}</span>
|
||||
{/block}</h3>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
|
||||
<form action="{$url_submit}" id={$table}_form method="post">
|
||||
{if $display_key}
|
||||
<input type="hidden" name="show_modules" value="{$display_key}" />
|
||||
|
||||
@@ -30,19 +30,8 @@
|
||||
</script>
|
||||
<script type="text/javascript" src="../js/admin-dnd.js"></script>
|
||||
|
||||
{if $show_toolbar}
|
||||
<div class="toolbar-placeholder">
|
||||
<div class="toolbarBox {if $toolbar_scroll}toolbarHead{/if}">
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
|
||||
<div class="pageTitle">
|
||||
<h3>{block name=pageTitle}
|
||||
<span id="current_obj" style="font-weight: normal;">{$title|default:' '}</span>
|
||||
{/block}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
|
||||
<div class="filter-module">
|
||||
<form>
|
||||
|
||||
@@ -840,23 +840,11 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
{if $show_toolbar}
|
||||
<div class="toolbar-placeholder">
|
||||
<div class="toolbarBox {if $toolbar_scroll}toolbarHead{/if}">
|
||||
{include file="toolbar.tpl"}
|
||||
<div class="pageTitle">
|
||||
<h3>
|
||||
{block name=pageTitle}
|
||||
<span id="current_obj" style="font-weight: normal;">{$title|default:' '}</span>
|
||||
{/block}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
{/if}
|
||||
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
|
||||
<fieldset id="customer_part"><legend><img src="../img/admin/tab-customers.gif" />{l s='Customer'}</legend>
|
||||
<p><label>{l s='Search customers:'}</label><input type="text" id="customer" value="" />
|
||||
<a class="fancybox button" href="{$link->getAdminLink('AdminCustomers')}&addcustomer&liteDisplaying=1&submitFormAjax=1#"><img src="../img/admin/add.gif" title="new"/><span>{l s='Add new customer'}</span></a></p>
|
||||
|
||||
@@ -31,18 +31,8 @@ $(function() {
|
||||
</script>
|
||||
|
||||
{if $show_toolbar}
|
||||
<div class="toolbar-placeholder">
|
||||
<div class="toolbarBox {if $toolbar_scroll}toolbarHead{/if}">
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
|
||||
<div class="pageTitle">
|
||||
<h3>
|
||||
{block name=pageTitle}
|
||||
<span id="current_obj" style="font-weight: normal;">{$title|default:' '}</span>
|
||||
{/block}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
{/if}
|
||||
|
||||
{if isset($features)}
|
||||
|
||||
@@ -25,18 +25,7 @@
|
||||
*}
|
||||
|
||||
{if $show_toolbar}
|
||||
<div class="toolbar-placeholder">
|
||||
<div class="toolbarBox {if $toolbar_scroll}toolbarHead{/if}">
|
||||
{include file="toolbar.tpl"}
|
||||
<div class="pageTitle">
|
||||
<h3>
|
||||
{block name=pageTitle}
|
||||
<span id="current_obj" style="font-weight: normal;">{$title|default:' '}</span>
|
||||
{/block}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -59,17 +59,7 @@
|
||||
{/if}{* End if simple_header *}
|
||||
|
||||
{if $show_toolbar}
|
||||
<div class="toolbar-placeholder">
|
||||
<div class="toolbarBox {if $toolbar_scroll}toolbarHead{/if}">
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
|
||||
<div class="pageTitle">
|
||||
<h3>{block name=pageTitle}
|
||||
<span id="current_obj" style="font-weight: normal;">{$title|default:' '}</span>
|
||||
{/block}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
|
||||
{/if}
|
||||
|
||||
{if !$simple_header}
|
||||
|
||||
@@ -25,20 +25,7 @@
|
||||
*}
|
||||
|
||||
{if $show_toolbar}
|
||||
<div class="toolbar-placeholder">
|
||||
<div class="toolbarBox {if $toolbar_scroll}toolbarHead{/if}">
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
|
||||
<div class="pageTitle">
|
||||
<h3>
|
||||
{block name=pageTitle}
|
||||
<span id="current_obj" style="font-weight: normal;">
|
||||
{$title|default:' '}
|
||||
</span>
|
||||
{/block}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -25,18 +25,7 @@
|
||||
*}
|
||||
|
||||
{if $show_toolbar}
|
||||
<div class="toolbar-placeholder">
|
||||
<div class="toolbarBox {if $toolbar_scroll}toolbarHead{/if}">
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn}
|
||||
<div class="pageTitle">
|
||||
<h3>
|
||||
{block name=pageTitle}
|
||||
<span id="current_obj" style="font-weight: normal;">{$title|default:' '}</span>
|
||||
{/block}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
|
||||
{/if}
|
||||
|
||||
<div class="leadin">{block name="leadin"}{/block}</div>
|
||||
|
||||
@@ -23,77 +23,101 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
{block name=toolbarBox}
|
||||
<ul class="cc_button">
|
||||
{foreach from=$toolbar_btn item=btn key=k}
|
||||
<li>
|
||||
<a id="desc-{$table}-{$btn.imgclass|default:$k}" class="toolbar_btn" {if isset($btn.href)}href="{$btn.href}"{/if} title="{$btn.desc}" {if isset($btn.target) && $btn.target}target="_blank"{/if}{if isset($btn.js) && $btn.js}onclick="{$btn.js}"{/if}>
|
||||
<span class="process-icon-{$btn.imgclass|default:$k} {$btn.class|default:'' }" ></span>
|
||||
<div {if isset($btn.force_desc) && $btn.force_desc == true } class="locked" {/if}>{$btn.desc}</div>
|
||||
</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
|
||||
<script language="javascript">
|
||||
$(function() {
|
||||
//get reference on save link
|
||||
btn_save = $('span[class~="process-icon-save"]').parent();
|
||||
<div class="toolbar-placeholder">
|
||||
<div class="toolbarBox {if $toolbar_scroll}toolbarHead{/if}">
|
||||
{block name=toolbarBox}
|
||||
<ul class="cc_button">
|
||||
{foreach from=$toolbar_btn item=btn key=k}
|
||||
<li>
|
||||
<a id="desc-{$table}-{$btn.imgclass|default:$k}" class="toolbar_btn" {if isset($btn.href)}href="{$btn.href}"{/if} title="{$btn.desc}" {if isset($btn.target) && $btn.target}target="_blank"{/if}{if isset($btn.js) && $btn.js}onclick="{$btn.js}"{/if}>
|
||||
<span class="process-icon-{$btn.imgclass|default:$k} {$btn.class|default:'' }" ></span>
|
||||
<div {if isset($btn.force_desc) && $btn.force_desc == true } class="locked" {/if}>{$btn.desc}</div>
|
||||
</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
|
||||
//get reference on form submit button
|
||||
btn_submit = $('#{$table}_form_submit_btn');
|
||||
<script language="javascript">
|
||||
$(function() {
|
||||
//get reference on save link
|
||||
btn_save = $('span[class~="process-icon-save"]').parent();
|
||||
|
||||
if (btn_save.length > 0 && btn_submit.length > 0)
|
||||
{
|
||||
//get reference on save and stay link
|
||||
btn_save_and_stay = $('span[class~="process-icon-save-and-stay"]').parent();
|
||||
//get reference on form submit button
|
||||
btn_submit = $('#{$table}_form_submit_btn');
|
||||
|
||||
//get reference on current save link label
|
||||
lbl_save = $('#desc-{$table}-save div');
|
||||
|
||||
//override save link label with submit button value
|
||||
if (btn_submit.val().length > 0)
|
||||
lbl_save.html(btn_submit.attr("value"));
|
||||
|
||||
if (btn_save_and_stay.length > 0)
|
||||
{
|
||||
|
||||
//get reference on current save link label
|
||||
lbl_save_and_stay = $('#desc-{$table}-save-and-stay div');
|
||||
|
||||
//override save and stay link label with submit button value
|
||||
if (btn_submit.val().length > 0 && lbl_save_and_stay && !lbl_save_and_stay.hasClass('locked'))
|
||||
if (btn_save.length > 0 && btn_submit.length > 0)
|
||||
{
|
||||
lbl_save_and_stay.html(btn_submit.val() + " {l s='and stay'} ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//hide standard submit button
|
||||
btn_submit.hide();
|
||||
|
||||
//submit the form
|
||||
{block name=formSubmit}
|
||||
btn_save.click(function() {
|
||||
//add hidden input to emulate submit button click when posting the form -> field name posted
|
||||
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'" value="1" />');
|
||||
|
||||
$('#{$table}_form').submit();
|
||||
return false;
|
||||
});
|
||||
|
||||
if (btn_save_and_stay)
|
||||
{
|
||||
btn_save_and_stay.click(function() {
|
||||
//add hidden input to emulate submit button click when posting the form -> field name posted
|
||||
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'AndStay" value="1" />');
|
||||
|
||||
$('#{$table}_form').submit();
|
||||
return false;
|
||||
});
|
||||
//get reference on save and stay link
|
||||
btn_save_and_stay = $('span[class~="process-icon-save-and-stay"]').parent();
|
||||
|
||||
//get reference on current save link label
|
||||
lbl_save = $('#desc-{$table}-save div');
|
||||
|
||||
//override save link label with submit button value
|
||||
if (btn_submit.val().length > 0)
|
||||
lbl_save.html(btn_submit.attr("value"));
|
||||
|
||||
if (btn_save_and_stay.length > 0)
|
||||
{
|
||||
|
||||
//get reference on current save link label
|
||||
lbl_save_and_stay = $('#desc-{$table}-save-and-stay div');
|
||||
|
||||
//override save and stay link label with submit button value
|
||||
if (btn_submit.val().length > 0 && lbl_save_and_stay && !lbl_save_and_stay.hasClass('locked'))
|
||||
{
|
||||
lbl_save_and_stay.html(btn_submit.val() + " {l s='and stay'} ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//hide standard submit button
|
||||
btn_submit.hide();
|
||||
|
||||
//submit the form
|
||||
{block name=formSubmit}
|
||||
btn_save.click(function() {
|
||||
//add hidden input to emulate submit button click when posting the form -> field name posted
|
||||
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'" value="1" />');
|
||||
|
||||
$('#{$table}_form').submit();
|
||||
return false;
|
||||
});
|
||||
|
||||
if (btn_save_and_stay)
|
||||
{
|
||||
btn_save_and_stay.click(function() {
|
||||
//add hidden input to emulate submit button click when posting the form -> field name posted
|
||||
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'AndStay" value="1" />');
|
||||
|
||||
$('#{$table}_form').submit();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
{/block}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
<div class="pageTitle">
|
||||
<h3>{block name=pageTitle}
|
||||
<span id="current_obj" style="font-weight: normal;">
|
||||
{if $title}
|
||||
{foreach $title as $key => $item name=title}
|
||||
{* Use strip_tags because if the string already has been through htmlentities using escape will break it *}
|
||||
<span class="breadcrumb item-{$key} ">{$item|strip_tags}
|
||||
{if !$smarty.foreach.title.last}
|
||||
<img alt=">" style="margin-right:5px" src="../img/admin/separator_breadcrum.png">
|
||||
{/if}
|
||||
</span>
|
||||
{/foreach}
|
||||
{else}
|
||||
|
||||
{/if}
|
||||
</span>
|
||||
{/block}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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 .= '<span class="breadcrumb item-'.$key.' ">'.Tools::safeOutput($item['name']).'</span> : ';
|
||||
|
||||
$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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -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 .= '<span class="breadcrumb item-'.$key.' ">'.$item['name'].'</span> : ';
|
||||
|
||||
$bread = rtrim($bread, ': ');
|
||||
|
||||
$this->toolbar_title = $bread;
|
||||
$this->toolbar_title = $bread_extended;
|
||||
}
|
||||
|
||||
public function initProcess()
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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',
|
||||
));
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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].')';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user