// Context part 32

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8095 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-08-17 13:40:05 +00:00
parent 51f2bf2617
commit 39d005f222
14 changed files with 24 additions and 20 deletions
+2 -2
View File
@@ -67,7 +67,7 @@ class Ebay extends Module
$this->id_lang = Language::getIdByIso('fr');
// Check the country and ask the bypass if not 'fr'
if (strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))) != 'fr' && !isset($this->context->cookie->ebay_country_default_fr))
if (strtolower($this->context->country->iso_code) != 'fr' && !isset($this->context->cookie->ebay_country_default_fr))
{
$this->warning = $this->l('eBay module currently works only for eBay.fr');
return false;
@@ -485,7 +485,7 @@ class Ebay extends Module
// Checking Country
if (Tools::getValue('ebay_country_default_fr') == 'ok')
$this->context->cookie->ebay_country_default_fr = true;
if (strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))) != 'fr' && !isset($this->context->cookie->ebay_country_default_fr))
if (strtolower($this->context->country->iso_code) != 'fr' && !isset($this->context->cookie->ebay_country_default_fr))
return $this->_html.$this->displayError($this->l('eBay module currently works only for eBay.fr').'. <a href="'.$_SERVER['REQUEST_URI'].'&ebay_country_default_fr=ok">'.$this->l('Continue anyway ?').'</a>');
+1 -1
View File
@@ -46,7 +46,7 @@ echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
<link><?php echo _PS_BASE_URL_.__PS_BASE_URI__; ?></link>
<mail><?php echo Configuration::get('PS_SHOP_EMAIL') ?></mail>
<generator>PrestaShop</generator>
<language><?php echo Language::getIsoById((int)($cookie->id_lang)); ?></language>
<language><?php echo Context::getContext()->language->iso_code; ?></language>
<image>
<title><![CDATA[<?php echo Configuration::get('PS_SHOP_NAME') ?>]]></title>
<url><?php echo _PS_BASE_URL_.__PS_BASE_URI__.'img/logo.jpg'; ?></url>
+2 -2
View File
@@ -382,9 +382,9 @@ class MoneyBookers extends PaymentModule
$selected = ($currentLogoBlockPosition == $position) ? 'selected="selected"' : '';
$output .= '<option value="'.$position.'" '.$selected.'>'.$translation.'</option>';
}
$link = new Link();
$link = $this->context->link;
$admin_dir = substr(_PS_ADMIN_DIR_, strrpos(_PS_ADMIN_DIR_,'/') + 1);
$iso_code = strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT')));
$iso_code = strtolower($this->context->country->iso_code);
$landingPage = ($iso_code == 'en' || $iso_code == 'us') ? 'http://www.moneybookers.com/ads/partners/index.html?p=Prestashop' :
'http://www.moneybookers.com/ads/partners/'.$iso_code.'/index.html?p=Prestashop';
+1 -1
View File
@@ -30,7 +30,7 @@ require_once(dirname(__FILE__).'/../../init.php');
include(dirname(__FILE__).'/../../header.php');
$smarty->assign('iso_code', Tools::strtolower(Language::getIsoById($cookie->id_lang ? (int)$cookie->id_lang : Configuration::get('PS_LANG_DEFAULT'))));
$smarty->assign('iso_code', Tools::strtolower(Context::getContext()->language->iso_code));
echo Module::display(dirname(__FILE__).'/paypal', 'about.tpl');
+1 -1
View File
@@ -123,7 +123,7 @@ class sendToAFriend extends Module
}
if (!isset($cover))
$cover = array('id_image' => Language::getIsoById((int)$cookie->id_lang).'-default', 'legend' => 'No picture');
$cover = array('id_image' => $this->context->language->iso_code.'-default', 'legend' => 'No picture');
$this->context->smarty->assign(array(
'cover' => $cover,
@@ -1199,7 +1199,7 @@ class TSBuyerProtection extends AbsTrustedShops
}
public function hookRightColumn($params)
{
$lang = Language::getIsoById($params['cookie']->id_lang);
$lang = $this->context->language->iso_code;
$lang = strtoupper($lang);
if (array_key_exists($lang, $this->available_languages) AND isset(TSBuyerProtection::$CERTIFICATE[$lang]['tsID']))
{
@@ -1219,7 +1219,7 @@ class TSBuyerProtection extends AbsTrustedShops
*/
public function hookPaymentTop($params)
{
$lang = Language::getIsoById($params['cookie']->id_lang);
$lang = $this->context->language->iso_code;
$lang = strtoupper($lang);
if (!isset(TSBuyerProtection::$CERTIFICATE[$lang]) ||
@@ -464,7 +464,7 @@ class TrustedShopsRating extends AbsTrustedShops
if (!$this->_isTsIdActive((int)($params['cookie']->id_lang)))
return false;
self::$smarty->assign(array('rating_url' => $this->getRatingUrl((int)($params['objOrder']->id)), 'language' => Language::getIsoById((int)($params['cookie']->id_lang))));
self::$smarty->assign(array('rating_url' => $this->getRatingUrl((int)($params['objOrder']->id)), 'language' => $this->context->language->iso_code));
return $this->display(self::$module_name, 'order-confirmation.tpl');
}
+1 -1
View File
@@ -138,7 +138,7 @@ class Twenga extends PaymentModule
self::$base_path = $this->site_url.'/modules/twenga/';
$this->feed_url = self::$base_path.'export.php?twenga_token='.sha1(Configuration::get('TWENGA_TOKEN')._COOKIE_KEY_);
self::$shop_country = Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'));
self::$shop_country = $this->context->country->iso_code;
require_once realpath(self::$base_dir.'/lib/PrestashopStats.php');
require_once realpath(self::$base_dir.'/lib/TwengaObj.php');