// Fixed tabs
This commit is contained in:
+5
-6
@@ -232,12 +232,10 @@ class TabCore extends ObjectModel
|
||||
{
|
||||
self::$_cache_tabs[$id_lang] = array();
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'tab` t
|
||||
LEFT JOIN `'._DB_PREFIX_.'tab_lang` tl
|
||||
ON (t.`id_tab` = tl.`id_tab` AND tl.`id_lang` = '.(int)$id_lang.')
|
||||
ORDER BY t.`position` ASC
|
||||
');
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'tab` t
|
||||
LEFT JOIN `'._DB_PREFIX_.'tab_lang` tl ON (t.`id_tab` = tl.`id_tab` AND tl.`id_lang` = '.(int)$id_lang.')
|
||||
ORDER BY t.`position` ASC');
|
||||
foreach ($result as $row)
|
||||
{
|
||||
if (!isset(self::$_cache_tabs[$id_lang][$row['id_parent']]))
|
||||
@@ -252,6 +250,7 @@ class TabCore extends ObjectModel
|
||||
$array_all = array_merge($array_all, $array_parent);
|
||||
return $array_all;
|
||||
}
|
||||
|
||||
return (isset(self::$_cache_tabs[$id_lang][$id_parent]) ? self::$_cache_tabs[$id_lang][$id_parent] : array());
|
||||
}
|
||||
|
||||
|
||||
@@ -1441,7 +1441,9 @@ class AdminControllerCore extends Controller
|
||||
$current_id = Tab::getCurrentParentId();
|
||||
foreach ($tabs as $index => $tab)
|
||||
{
|
||||
if (($tab['class_name'] == 'AdminStock' && Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') == 0) || $tab['class_name'] == 'AdminCarrierWizard')
|
||||
if (!checkTabRights($tab['id_tab'])
|
||||
|| ($tab['class_name'] == 'AdminStock' && Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') == 0)
|
||||
|| $tab['class_name'] == 'AdminCarrierWizard')
|
||||
{
|
||||
unset($tabs[$index]);
|
||||
continue;
|
||||
@@ -1490,10 +1492,6 @@ class AdminControllerCore extends Controller
|
||||
unset($sub_tabs[$index2]);
|
||||
}
|
||||
$tabs[$index]['sub_tabs'] = $sub_tabs;
|
||||
|
||||
// If there are no subtabs, we don't want to display the parent tab in menu
|
||||
if (empty($sub_tabs))
|
||||
unset($tabs[$index]);
|
||||
}
|
||||
|
||||
if (Validate::isLoadedObject($this->context->employee))
|
||||
|
||||
Reference in New Issue
Block a user