// Multishop interface reworked

This commit is contained in:
rMalie
2012-05-09 15:05:39 +00:00
parent 7920dea947
commit d7337c4d4f
61 changed files with 6043 additions and 391 deletions
@@ -34,8 +34,6 @@ class AdminPreferencesControllerCore extends AdminController
$this->className = 'Configuration';
$this->table = 'configuration';
// Prevent classes which extend AdminPreferences to load useless data
if (get_class($this) == 'AdminPreferencesController')
{
@@ -88,6 +86,14 @@ class AdminPreferencesControllerCore extends AdminController
'cast' => 'intval',
'type' => 'bool'
),
'PS_MULTISHOP_FEATURE_ACTIVE' => array(
'title' => $this->l('Enable multishop'),
'desc' => $this->l('Multishop feature allows you to manage several shops with one back-office. If this feature is enabled, a tab "multishop" will be available in "advanced parameters" menu.'),
'validation' => 'isBool',
'cast' => 'intval',
'type' => 'bool',
'visibility' => Shop::CONTEXT_ALL
),
);
// No HTTPS activation if you haven't already.
@@ -110,4 +116,18 @@ class AdminPreferencesControllerCore extends AdminController
parent::__construct();
}
/**
* Enable / disable multishop menu if multishop feature is activated
*
* @param string $value
*/
public function updateOptionPsMultishopFeatureActive($value)
{
Configuration::updateValue('PS_MULTISHOP_FEATURE_ACTIVE', $value);
$tab = Tab::getInstanceFromClassName('AdminShopGroup');
$tab->active = (bool)Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE');
$tab->update();
}
}