[*] 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:
tDidierjean
2012-04-12 08:34:38 +00:00
parent ff98873fb5
commit 244a2f9102
24 changed files with 162 additions and 293 deletions
@@ -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',
));
+1 -1
View File
@@ -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].')';
}
/**