diff --git a/modules/blockcms/blockcms.php b/modules/blockcms/blockcms.php index e6add78ea..38631f540 100755 --- a/modules/blockcms/blockcms.php +++ b/modules/blockcms/blockcms.php @@ -52,11 +52,6 @@ class BlockCms extends Module 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 !Db::getInstance()->execute(' CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cms_block`( @@ -69,15 +64,12 @@ class BlockCms extends Module PRIMARY KEY (`id_cms_block`) ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8') OR !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`( `id_cms_block` int(10) unsigned NOT NULL, `id_lang` int(10) unsigned NOT NULL, `name` varchar(40) NOT NULL default \'\', PRIMARY KEY (`id_cms_block`, `id_lang`) ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8') OR - !Db::getInstance()->execute(rtrim($queryLang, ',')) OR !Db::getInstance()->execute(' CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'cms_block_page`( `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_POWEREDBY', 1)) 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() diff --git a/modules/editorial/editorial.php b/modules/editorial/editorial.php index e95e7f8e2..20a537051 100644 --- a/modules/editorial/editorial.php +++ b/modules/editorial/editorial.php @@ -80,7 +80,7 @@ class Editorial extends Module $id_editorial = Db::getInstance()->Insert_ID(); $result = true; - foreach (Language::getLanguages() as $lang) + foreach (Language::getLanguages(false) as $lang) $result &= Db::getInstance()->autoExecute(_DB_PREFIX_.'editorial_lang', array( 'id_editorial' => $id_editorial, 'id_lang' => $lang['id_lang'], diff --git a/modules/mondialrelay/config.xml b/modules/mondialrelay/config.xml index ceed20645..81aca9169 100755 --- a/modules/mondialrelay/config.xml +++ b/modules/mondialrelay/config.xml @@ -2,7 +2,7 @@ mondialrelay - + diff --git a/modules/moneybookers/moneybookers.php b/modules/moneybookers/moneybookers.php index 89a6090d2..b6172395e 100644 --- a/modules/moneybookers/moneybookers.php +++ b/modules/moneybookers/moneybookers.php @@ -1,6 +1,6 @@ registerHook('payment') OR + if (!parent::install() OR + !$this->registerHook('payment') OR !$this->registerHook('paymentReturn')) return false; Configuration::updateValue('MB_HIDE_LOGIN', 1); @@ -134,6 +134,8 @@ class MoneyBookers extends PaymentModule Configuration::updateValue('MB_ID_LOGO_WALLET', 1); Configuration::updateValue('MB_PARAMETERS', 0); Configuration::updateValue('MB_DISPLAY_MODE', 1); + Configuration::updateValue('MB_LOCAL_METHODS', 2); + Configuration::updateValue('MB_INTER_METHODS', 5); return true; } @@ -169,28 +171,28 @@ class MoneyBookers extends PaymentModule 'max_redirects' => 10, 'timeout' => $timeout, 'header' => array( - 'Accept-language: en', + 'Accept-language: en', 'Cookie: foo=bar'))); - + if (is_callable('curl_init') && ($ch = curl_init())) { curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); - + $content = curl_exec($ch); curl_close($ch); } else { - // Check availability of the context options + // Check availability of the context options if (!is_array($contextOptions) || !count($contextOptions)) $contextOptions = $defaultContextOptions; - + // Create a stream context $stream_context = @stream_context_create($contextOptions); - + if (($fp = @fopen($url, $mode, false, $stream_context))) { $content = fgets($fp, 4096); @@ -199,7 +201,7 @@ class MoneyBookers extends PaymentModule else if (!($content = @file_get_contents($url, false, $stream_context))) if (($fp = @fsockopen($url, 80, $errnom, $errstr, $timeout))) { - preg_match('@^(?:http://)?([^/]+)@i', $url, $matches); + preg_match('@^(?:http://)?([^/]+)@i', $url, $matches); $host = $matches[1]; $out = "GET / HTTP/1.1\r\n"; $out .= "Host: ".$host."\r\n"; @@ -231,7 +233,7 @@ class MoneyBookers extends PaymentModule if (isset($_POST['mb_email_to_validate']) && !empty($_POST['mb_email_to_validate'])) { - try + try { $url = 'http://moneybookers.prestashop.com/email_check.php?email='.$_POST['mb_email_to_validate'].'&url=http://'.$_SERVER['HTTP_HOST'].__PS_BASE_URI__; $content = $this->_fetchWebContent($url); @@ -250,13 +252,13 @@ class MoneyBookers extends PaymentModule } } catch(Exception $e) - { + { $errors[] = $this->l('Unable to contact activation server, please try again later.'); } } - else + else $errors[] = $this->l('E-mail field is required'); - + /* Validate secret word */ if (isset($_POST['SubmitSecret'])) { @@ -325,7 +327,7 @@ class MoneyBookers extends PaymentModule Configuration::updateValue('MB_INTER_METHODS', $inter); Configuration::updateValue('MB_DISPLAY_MODE', (int)($_POST['mb_display_mode'])); } - + if (Tools::getValue('submitSettings')) { foreach(array('leftColumn', 'rightColumn') as $hookName) @@ -336,7 +338,7 @@ class MoneyBookers extends PaymentModule else if (Tools::getValue('logo_position') == self::RIGHT_COLUMN) $this->registerHook('rightColumn'); } - + /* Display errors */ if (sizeof($errors)) { @@ -364,9 +366,9 @@ class MoneyBookers extends PaymentModule self::DISABLE => $this->l('Disable'), self::LEFT_COLUMN => $this->l('Left Column'), self::RIGHT_COLUMN => $this->l('Right Column')); - - $currentLogoBlockPosition = ($this->isRegisteredInHook('leftColumn')) ? self::LEFT_COLUMN : - (($this->isRegisteredInHook('rightColumn')) ? self::RIGHT_COLUMN : -1); + + $currentLogoBlockPosition = ($this->isRegisteredInHook('leftColumn')) ? self::LEFT_COLUMN : + (($this->isRegisteredInHook('rightColumn')) ? self::RIGHT_COLUMN : -1); /* Display settings form */ $output .= ' @@ -376,13 +378,13 @@ class MoneyBookers extends PaymentModule $this->l('With more than 17 million users and more than 15,000 new accounts created per day, Moneybookers also offers one of the biggest electronic wallet in the world. Your customers can also pay by using their e-mail and password thanks to the e-Wallet solution.').'

'. $this->l('Moneybookers changes its name and becomes Skrill!').'

- +
'.$this->l('Settings').'
'.$this->l('You can display the Skrill/Moneybookers logo on your shop, this may reassure your customers about the fact that you are a serious merchant.').'
- '.$this->l('Select the logo position').' : + '.$this->l('Select the logo position').' :

'.$this->l('Change your logo position in the Front Office. Works with').' @@ -438,7 +440,7 @@ class MoneyBookers extends PaymentModule '.$this->l('For merchants over €100,000 fees can be negotiated.').' Contact: ecommerce@moneybookers.com
-'.$this->l('To view the last update of the detailed fees').' '.$this->l('Click here').' +'.$this->l('To view the last update of the detailed fees').' '.$this->l('Click here').'

** '.$this->l('Moneybookers eWallet').'
@@ -572,7 +574,7 @@ class MoneyBookers extends PaymentModule return $output; } - + private function _displayLogoBlock($position) { $imgPath = 'http://www.prestashop.com/images/logo_partners/logo-skrill.png'; @@ -580,7 +582,7 @@ class MoneyBookers extends PaymentModule $imgPath = __PS_BASE_URI__.'modules/moneybookers/logo-skrill.png'; return '

'; } - + public function hookRightColumn($params) { return $this->_displayLogoBlock(self::RIGHT_COLUMN); @@ -595,7 +597,7 @@ class MoneyBookers extends PaymentModule public function hookPayment($params) { global $smarty, $cookie; - + if (!Configuration::get('MB_PARAMETERS') OR !Configuration::get('MB_PARAMETERS_2') OR (Configuration::get('MB_LOCAL_METHODS') == '' AND Configuration::get('MB_INTER_METHODS') == '')) return; @@ -617,7 +619,7 @@ class MoneyBookers extends PaymentModule { $localMethods = Configuration::get('MB_LOCAL_METHODS'); $interMethods = Configuration::get('MB_INTER_METHODS'); - + $smarty->assign(array( 'display_mode' => (int)(Configuration::get('MB_DISPLAY_MODE')), 'local' => $localMethods ? explode('|', $localMethods) : array(), @@ -684,11 +686,11 @@ class MoneyBookers extends PaymentModule case _PS_OS_OUTOFSTOCK_: $smarty->assign('status', 'ok'); break; - + case _PS_OS_BANKWIRE_: $smarty->assign('status', 'pending'); break; - + case _PS_OS_ERROR_: default: $smarty->assign('status', 'failed'); @@ -697,7 +699,7 @@ class MoneyBookers extends PaymentModule return $this->display(__FILE__, 'confirmation.tpl'); } - + /** * Set the detail of a payment - Call before the validate order init * correctly the pcc object @@ -717,7 +719,7 @@ class MoneyBookers extends PaymentModule $this->pcc->card_expiration = ''; - $this->pcc->card_holder = (string)(isset($response['pay_to_email']) ? + $this->pcc->card_holder = (string)(isset($response['pay_to_email']) ? $response['pay_to_email'] : ''); } }