// 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:
rMalie
2012-02-23 15:39:44 +00:00
parent ec8f05c3ca
commit b24dcffc9c
71 changed files with 377 additions and 425 deletions

View File

@@ -633,7 +633,7 @@ class AdminModulesControllerCore extends AdminController
else
{
// If we install a module, force temporary global context for multishop
if (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && $method != 'getContent')
if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL && $method != 'getContent')
{
Context::getContext()->tmpOldShop = clone(Context::getContext()->shop);
Context::getContext()->shop = new Shop();
@@ -677,9 +677,9 @@ class AdminModulesControllerCore extends AdminController
$toolbar .= '<tr>
<th colspan="4">
<input type="checkbox" name="activateModule" value="1" '.(($module->active) ? 'checked="checked"' : '').' '.$activateOnclick.' /> '.$this->l('Activate module for').' ';
if ($this->context->shop->getContextType() == Shop::CONTEXT_SHOP)
if (Shop::getContext() == Shop::CONTEXT_SHOP)
$toolbar .= 'shop <b>'.$this->context->shop->name.'</b>';
elseif ($this->context->shop->getContextType() == Shop::CONTEXT_GROUP)
elseif (Shop::getContext() == Shop::CONTEXT_GROUP)
$toolbar .= 'all shops of group shop <b>'.$this->context->shop->getGroup()->name.'</b>';
else
$toolbar .= 'all shops';
@@ -701,7 +701,7 @@ class AdminModulesControllerCore extends AdminController
$return = ($method == 'install' ? 12 : 13);
elseif ($echo === false)
$module_errors[] = array('name' => $name, 'message' => $module->getErrors());
if (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && isset(Context::getContext()->tmpOldShop))
if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL && isset(Context::getContext()->tmpOldShop))
{
Context::getContext()->shop = clone(Context::getContext()->tmpOldShop);
unset(Context::getContext()->tmpOldShop);