[*] BO : reorganization of admin tabs

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13820 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2012-03-02 14:44:07 +00:00
parent a32fc0cc5b
commit 0f865fd2d6
74 changed files with 10384 additions and 11234 deletions
+26 -10
View File
@@ -114,17 +114,33 @@ class ProfileCore extends ObjectModel
{
if (!isset(self::$_cache_accesses[$id_profile]))
{
$result = Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.'access`
WHERE `id_profile` = '.(int)$id_profile);
self::$_cache_accesses[$id_profile] = array();
foreach ($result as $row)
// Super admin profile has full auth
if ($id_profile == _PS_ADMIN_PROFILE_)
{
if (!isset(self::$_cache_accesses[$id_profile][$row['id_tab']]))
self::$_cache_accesses[$id_profile][$row['id_tab']] = array();
self::$_cache_accesses[$id_profile][$row['id_tab']] = $row;
foreach (Tab::getTabs(Context::getContext()->language->id) as $tab)
self::$_cache_accesses[$id_profile][$tab['id_tab']] = array(
'id_profile' => _PS_ADMIN_PROFILE_,
'id_tab' => $tab['id_tab'],
'view' => '1',
'add' => '1',
'edit' => '1',
'delete' => '1',
);
}
else
{
$result = Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.'access`
WHERE `id_profile` = '.(int)$id_profile);
self::$_cache_accesses[$id_profile] = array();
foreach ($result as $row)
{
if (!isset(self::$_cache_accesses[$id_profile][$row['id_tab']]))
self::$_cache_accesses[$id_profile][$row['id_tab']] = array();
self::$_cache_accesses[$id_profile][$row['id_tab']] = $row;
}
}
}
return self::$_cache_accesses[$id_profile];