[*] MO: Set default config for blockcms, editorial and moneybookers in their install method

This commit is contained in:
rMalie
2011-11-10 14:25:15 +00:00
parent ccf8d86f8a
commit 88feeb34b2
4 changed files with 63 additions and 44 deletions
+26 -9
View File
@@ -52,11 +52,6 @@ class BlockCms extends Module
public function install() public function install()
{ {
$languages = Language::getLanguages(false);
$queryLang = 'INSERT INTO `'._DB_PREFIX_.'cms_block_lang` (`id_cms_block`, `id_lang`) VALUES';
foreach ($languages AS $language)
$queryLang .= '(1, '.(int)($language['id_lang']).'),';
if (!parent::install() OR !$this->registerHook('leftColumn') OR !$this->registerHook('rightColumn') OR !$this->registerHook('footer') OR !$this->registerHook('header') OR if (!parent::install() OR !$this->registerHook('leftColumn') OR !$this->registerHook('rightColumn') OR !$this->registerHook('footer') OR !$this->registerHook('header') OR
!Db::getInstance()->execute(' !Db::getInstance()->execute('
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cms_block`( CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cms_block`(
@@ -69,15 +64,12 @@ class BlockCms extends Module
PRIMARY KEY (`id_cms_block`) PRIMARY KEY (`id_cms_block`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8') OR ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8') OR
!Db::getInstance()->execute(' !Db::getInstance()->execute('
INSERT INTO `'._DB_PREFIX_.'cms_block` (`id_cms_category`, `location`, `position`) VALUES(1, 0, 0)') OR
!Db::getInstance()->execute('
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cms_block_lang`( CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cms_block_lang`(
`id_cms_block` int(10) unsigned NOT NULL, `id_cms_block` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL, `id_lang` int(10) unsigned NOT NULL,
`name` varchar(40) NOT NULL default \'\', `name` varchar(40) NOT NULL default \'\',
PRIMARY KEY (`id_cms_block`, `id_lang`) PRIMARY KEY (`id_cms_block`, `id_lang`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8') OR ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8') OR
!Db::getInstance()->execute(rtrim($queryLang, ',')) OR
!Db::getInstance()->execute(' !Db::getInstance()->execute('
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cms_block_page`( CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cms_block_page`(
`id_cms_block_page` int(10) unsigned NOT NULL auto_increment, `id_cms_block_page` int(10) unsigned NOT NULL auto_increment,
@@ -90,7 +82,32 @@ class BlockCms extends Module
!Configuration::updateValue('FOOTER_BLOCK_ACTIVATION', 1) OR !Configuration::updateValue('FOOTER_BLOCK_ACTIVATION', 1) OR
!Configuration::updateValue('FOOTER_POWEREDBY', 1)) !Configuration::updateValue('FOOTER_POWEREDBY', 1))
return false; return false;
return true;
// Install fixtures for blockcms
if (!Db::getInstance()->autoExecute(_DB_PREFIX_.'cms_block', array(
'id_cms_category' => 1,
'location' => 0,
'position' => 0,
), 'INSERT'))
return false;
$id_cms_block = Db::getInstance()->Insert_ID();
$result = true;
foreach (Language::getLanguages(false) as $lang)
$result &= Db::getInstance()->autoExecute(_DB_PREFIX_.'cms_block_lang', array(
'id_cms_block' => $id_cms_block,
'id_lang' => $lang['id_lang'],
'name' => $this->l('Information'),
), 'INSERT');
foreach (CMS::getCMSPages(null, 1) as $cms)
$result &= Db::getInstance()->autoExecute(_DB_PREFIX_.'cms_block_page', array(
'id_cms_block' => $id_cms_block,
'id_cms' => $cms['id_cms'],
'is_category' => 0,
), 'INSERT');
return $result;
} }
public function uninstall() public function uninstall()
+1 -1
View File
@@ -80,7 +80,7 @@ class Editorial extends Module
$id_editorial = Db::getInstance()->Insert_ID(); $id_editorial = Db::getInstance()->Insert_ID();
$result = true; $result = true;
foreach (Language::getLanguages() as $lang) foreach (Language::getLanguages(false) as $lang)
$result &= Db::getInstance()->autoExecute(_DB_PREFIX_.'editorial_lang', array( $result &= Db::getInstance()->autoExecute(_DB_PREFIX_.'editorial_lang', array(
'id_editorial' => $id_editorial, 'id_editorial' => $id_editorial,
'id_lang' => $lang['id_lang'], 'id_lang' => $lang['id_lang'],
+1 -1
View File
@@ -2,7 +2,7 @@
<module> <module>
<name>mondialrelay</name> <name>mondialrelay</name>
<displayName><![CDATA[Mondial Relay]]></displayName> <displayName><![CDATA[Mondial Relay]]></displayName>
<version><![CDATA[1.7.6]]></version> <version><![CDATA[1.7.8]]></version>
<description><![CDATA[Deliver in Relay points]]></description> <description><![CDATA[Deliver in Relay points]]></description>
<author><![CDATA[]]></author> <author><![CDATA[]]></author>
<tab><![CDATA[shipping_logistics]]></tab> <tab><![CDATA[shipping_logistics]]></tab>
+2
View File
@@ -134,6 +134,8 @@ class MoneyBookers extends PaymentModule
Configuration::updateValue('MB_ID_LOGO_WALLET', 1); Configuration::updateValue('MB_ID_LOGO_WALLET', 1);
Configuration::updateValue('MB_PARAMETERS', 0); Configuration::updateValue('MB_PARAMETERS', 0);
Configuration::updateValue('MB_DISPLAY_MODE', 1); Configuration::updateValue('MB_DISPLAY_MODE', 1);
Configuration::updateValue('MB_LOCAL_METHODS', 2);
Configuration::updateValue('MB_INTER_METHODS', 5);
return true; return true;
} }