[-] Classes : #PSTEST-214 : BugFix : TopMenu for shops and groups

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11973 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
fGaillard
2012-01-02 10:15:49 +00:00
parent 1e827f9465
commit 9ff33d65cf
2 changed files with 6 additions and 12 deletions
+1 -1
View File
@@ -387,7 +387,7 @@ class ShopCore extends ObjectModel
{
if (defined('_PS_ADMIN_DIR_'))
return Shop::getContextGroupID();
return (int)$this->id_group_shop;
return (isset($this->id_group_shop)) ? (int)$this->id_group_shop : NULL;
}
/**
+5 -11
View File
@@ -98,7 +98,7 @@ class blocktopmenu extends Module
global $cookie;
if(Tools::isSubmit('submitBlocktopmenu'))
{
if (Configuration::updateValue('MOD_BLOCKTOPMENU_ITEMS', Tools::getValue('items'), false, (int)$this->context->shop->id_group_shop, (int)$this->context->shop->id))
if (Configuration::updateValue('MOD_BLOCKTOPMENU_ITEMS', Tools::getValue('items'), null, (int)Shop::getGroupID(), (int)$this->context->shop->id))
$this->_html .= $this->displayConfirmation($this->l('Settings Updated'));
else
$this->_html .= $this->displayError($this->l('Unable to update settings'));
@@ -322,16 +322,10 @@ class blocktopmenu extends Module
private function getMenuItems()
{
if (Context::shop() == Shop::CONTEXT_SHOP)
{
if (!Configuration::isOverridenByCurrentContext('MOD_BLOCKTOPMENU_ITEMS'))
{
$items_shop = Configuration::get('MOD_BLOCKTOPMENU_ITEMS');
}
}
if (!isset($items_shop))
$items_shop = '';
$group_id = ((int)Shop::getGroupID() == 0) ? null : (int)Shop::getGroupID();
$shop_id = ((int)$this->context->shop->id == 0) ? null : (int)$this->context->shop->id;
$items_shop = Configuration::get('MOD_BLOCKTOPMENU_ITEMS', null, $group_id, $shop_id);
$items_shop = explode(',', $items_shop);
$items_global = Configuration::getGlobalValue('MOD_BLOCKTOPMENU_ITEMS');
$items_global = explode(',', $items_global);