// Improve multishop API
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13566 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -209,21 +209,21 @@ class HelperFormCore extends Helper
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (Context::shop())
|
||||
switch (Shop::getContext())
|
||||
{
|
||||
case Shop::CONTEXT_SHOP :
|
||||
$assos[$this->context->shop->id] = $this->context->shop->id;
|
||||
break;
|
||||
$assos[Shop::getContextShopID()] = Shop::getContextShopID();
|
||||
break;
|
||||
|
||||
case Shop::CONTEXT_GROUP :
|
||||
foreach (Shop::getShops(false, $this->context->shop->getGroupID(), true) as $id_shop)
|
||||
foreach (Shop::getShops(false, Shop::getContextGroupShopID(), true) as $id_shop)
|
||||
$assos[$id_shop] = $id_shop;
|
||||
break;
|
||||
break;
|
||||
|
||||
default :
|
||||
foreach (Shop::getShops(false, null, true) as $id_shop)
|
||||
$assos[$id_shop] = $id_shop;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -71,12 +71,12 @@ class HelperOptionsCore extends Helper
|
||||
$isDisabled = $isInvisible = false;
|
||||
if (Shop::isFeatureActive())
|
||||
{
|
||||
if (isset($field['visibility']) && $field['visibility'] > $this->context->shop->getContextType())
|
||||
if (isset($field['visibility']) && $field['visibility'] > Shop::getContext())
|
||||
{
|
||||
$isDisabled = true;
|
||||
$isInvisible = true;
|
||||
}
|
||||
else if (Context::shop() != Shop::CONTEXT_ALL && !Configuration::isOverridenByCurrentContext($key))
|
||||
else if (Shop::getContext() != Shop::CONTEXT_ALL && !Configuration::isOverridenByCurrentContext($key))
|
||||
$isDisabled = true;
|
||||
}
|
||||
$field['is_disabled'] = $isDisabled;
|
||||
@@ -126,7 +126,7 @@ class HelperOptionsCore extends Helper
|
||||
}
|
||||
|
||||
// Multishop default value
|
||||
$field['multishop_default'] = (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && !$isInvisible);
|
||||
$field['multishop_default'] = (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL && !$isInvisible);
|
||||
|
||||
// Assign the modifications back to parent array
|
||||
$category_data['fields'][$key] = $field;
|
||||
|
||||
Reference in New Issue
Block a user