[*] FO BO MO : rename function isMultiShopActivated by isFeatureActive

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9444 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
hAitmansour
2011-10-19 09:36:12 +00:00
parent be31f53773
commit d8509b2829
31 changed files with 250 additions and 250 deletions
+9 -9
View File
@@ -225,7 +225,7 @@ class AdminControllerCore extends Controller
if ($controller == 'AdminHome')
$_POST['token'] = $this->token;
if (!Shop::isMultiShopActivated())
if (!Shop::isFeatureActive())
$this->shopLinkType = '';
// Get the name of the folder containing the custom tpl files
@@ -824,7 +824,7 @@ class AdminControllerCore extends Controller
public function initHeader()
{
// Shop context
if (Shop::isMultiShopActivated())
if (Shop::isFeatureActive())
{
if (Context::shop() == Shop::CONTEXT_ALL)
{
@@ -854,7 +854,7 @@ class AdminControllerCore extends Controller
}
// Multishop
$is_multishop = Shop::isMultiShopActivated();// && Context::shop() != Shop::CONTEXT_ALL;
$is_multishop = Shop::isFeatureActive();// && Context::shop() != Shop::CONTEXT_ALL;
/*if ($is_multishop)
{
if (Context::shop() == Shop::CONTEXT_GROUP)
@@ -959,8 +959,8 @@ class AdminControllerCore extends Controller
'search_type' => Tools::getValue('bo_search_type'),
'bo_query' => Tools::safeOutput(Tools::stripslashes(Tools::getValue('bo_query'))),
'quick_access' => $quick_access,
'multi_shop' => Shop::isMultiShopActivated(),
'shop_list' => (Shop::isMultiShopActivated() ? generateShopList() : null), //@TODO refacto
'multi_shop' => Shop::isFeatureActive(),
'shop_list' => (Shop::isFeatureActive() ? generateShopList() : null), //@TODO refacto
'tab' => $tab,
'current_parent_id' => (int)Tab::getCurrentParentId(),
'tabs' => $tabs,
@@ -1208,7 +1208,7 @@ class AdminControllerCore extends Controller
$this->context->currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
// Change shop context ?
if (Shop::isMultiShopActivated() && Tools::getValue('setShopContext') !== false)
if (Shop::isFeatureActive() && Tools::getValue('setShopContext') !== false)
{
$this->context->cookie->shopContext = Tools::getValue('setShopContext');
$url = parse_url($_SERVER['REQUEST_URI']);
@@ -1449,7 +1449,7 @@ class AdminControllerCore extends Controller
$this->_group .= ', a.'.pSQL($this->identifier);
$test_join = !preg_match('#`?'.preg_quote(_DB_PREFIX_.$this->table.'_'.$filter_key).'`? *sa#', $this->_join);
if (Shop::isMultiShopActivated() && Context::shop() != Shop::CONTEXT_ALL && $test_join)
if (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && $test_join)
{
$filter_shop = ' JOIN `'._DB_PREFIX_.$this->table.'_'.$filter_key.'` sa ';
$filter_shop .= 'ON (sa.'.$this->identifier.' = a.'.$this->identifier.' AND sa.id_'.$filter_key.' IN ('.implode(', ', $idenfier_shop).'))';
@@ -1729,7 +1729,7 @@ class AdminControllerCore extends Controller
protected function updateAssoShop($id_object = false)
{
if (!Shop::isMultiShopActivated())
if (!Shop::isFeatureActive())
return;
$shop_asso = Shop::getAssoTables();
@@ -1835,7 +1835,7 @@ class AdminControllerCore extends Controller
if (isset($options['visibility']) && $options['visibility'] > Context::getContext()->shop->getContextType())
continue;
if (Shop::isMultiShopActivated() && isset($_POST['configUseDefault'][$key]))
if (Shop::isFeatureActive() && isset($_POST['configUseDefault'][$key]))
{
Configuration::deleteFromContext($key);
continue;
+7 -7
View File
@@ -226,7 +226,7 @@ abstract class AdminTabCore
// $className = 'AdminCatalog';
$this->token = Tools::getAdminToken($className.(int)$this->id.(int)$this->context->employee->id);
if (!Shop::isMultiShopActivated())
if (!Shop::isFeatureActive())
$this->shopLinkType = '';
}
@@ -898,7 +898,7 @@ abstract class AdminTabCore
protected function updateAssoShop($id_object = false)
{
if (!Shop::isMultiShopActivated())
if (!Shop::isFeatureActive())
return ;
if(!$assos = self::getAssoShop($this->table, $id_object))
@@ -985,7 +985,7 @@ abstract class AdminTabCore
if (isset($options['visibility']) && $options['visibility'] > Context::getContext()->shop->getContextType())
continue;
if (Shop::isMultiShopActivated() && isset($_POST['configUseDefault'][$key]))
if (Shop::isFeatureActive() && isset($_POST['configUseDefault'][$key]))
{
Configuration::deleteFromContext($key);
continue;
@@ -1337,7 +1337,7 @@ abstract class AdminTabCore
else if (!preg_match('#(\s|,)\s*a\.`?'.pSQL($this->identifier).'`?(\s|,|$)#', $this->_group))
$this->_group .= ', a.'.pSQL($this->identifier);
if (Shop::isMultiShopActivated() && Context::shop() != Shop::CONTEXT_ALL && !preg_match('#`?'.preg_quote(_DB_PREFIX_.$this->table.'_'.$filterKey).'`? *sa#', $this->_join))
if (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && !preg_match('#`?'.preg_quote(_DB_PREFIX_.$this->table.'_'.$filterKey).'`? *sa#', $this->_join))
$filterShop = 'JOIN `'._DB_PREFIX_.$this->table.'_'.$filterKey.'` sa ON (sa.'.$this->identifier.' = a.'.$this->identifier.' AND sa.id_'.$filterKey.' IN ('.implode(', ', $idenfierShop).'))';
}
@@ -1871,7 +1871,7 @@ abstract class AdminTabCore
// Check if var is invisible (can't edit it in current shop context), or disable (use default value for multishop)
$isDisabled = $isInvisible = false;
if (Shop::isMultiShopActivated())
if (Shop::isFeatureActive())
{
if (isset($field['visibility']) && $field['visibility'] > $this->context->shop->getContextType())
{
@@ -1907,7 +1907,7 @@ abstract class AdminTabCore
$this->$method($key, $field, $value);
// Multishop default value
if (Shop::isMultiShopActivated() && Context::shop() != Shop::CONTEXT_ALL && !$isInvisible)
if (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && !$isInvisible)
echo '<div class="preference_default_multishop">
<label>
<input type="checkbox" name="configUseDefault['.$key.']" value="1" '.(($isDisabled) ? 'checked="checked"' : '').' onclick="checkMultishopDefaultValue(this, \''.$key.'\')" /> '.$this->l('Use default value').'
@@ -2336,7 +2336,7 @@ abstract class AdminTabCore
protected function displayAssoShop($type = 'shop')
{
if (!Shop::isMultiShopActivated() || (!$this->_object && $this->context->shop->getContextType() != Shop::CONTEXT_ALL))
if (!Shop::isFeatureActive() || (!$this->_object && $this->context->shop->getContextType() != Shop::CONTEXT_ALL))
return;
if ($type != 'shop' && $type != 'group_shop')
+1 -1
View File
@@ -425,7 +425,7 @@ class ConfigurationCore extends ObjectModel
|| (Context::shop() == Shop::CONTEXT_GROUP && Configuration::hasContext($key, null, Shop::CONTEXT_GROUP))) ? true : false;
}
return (Shop::isMultiShopActivated() && Context::shop() != Shop::CONTEXT_ALL && $testContext);
return (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && $testContext);
}
/**
+2 -2
View File
@@ -67,7 +67,7 @@ class HelperOptionsCore extends Helper
// Check if var is invisible (can't edit it in current shop context), or disable (use default value for multishop)
$isDisabled = $isInvisible = false;
if (Shop::isMultiShopActivated())
if (Shop::isFeatureActive())
{
if (isset($field['visibility']) && $field['visibility'] > $this->context->shop->getContextType())
{
@@ -105,7 +105,7 @@ class HelperOptionsCore extends Helper
}
// Multishop default value
$field['multishop_default'] = (Shop::isMultiShopActivated() && Context::shop() != Shop::CONTEXT_ALL && !$isInvisible);
$field['multishop_default'] = (Shop::isFeatureActive() && Context::shop() != Shop::CONTEXT_ALL && !$isInvisible);
// Assign the modifications back to parent array
$category_data['fields'][$key] = $field;
+1 -1
View File
@@ -248,7 +248,7 @@ abstract class ObjectModelCore
}
}
if (!Shop::isMultishopActivated())
if (!Shop::isFeatureActive())
{
if (isset($assos[$this->table]) && $assos[$this->table]['type'] == 'shop')
{
+1 -1
View File
@@ -728,7 +728,7 @@ class ShopCore extends ObjectModel
/**
* @return bool Return true if there is more than one shop
*/
public static function isMultiShopActivated()
public static function isFeatureActive()
{
static $total = null;