// 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:
+1
-1
@@ -663,7 +663,7 @@ if (Tools::isSubmit('getAdminHomeElement'))
|
||||
}
|
||||
|
||||
// PREACTIVATION PAYPAL WARNING
|
||||
$content = @file_get_contents('https://www.prestashop.com/partner/preactivation/preactivation-warnings.php?version=1.0&partner=paypal&iso_country='.Tools::strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))).'&iso_lang='.Tools::strtolower(Context::getContext()->language->iso_code).'&id_lang='.(int)Context::getContext().'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context);
|
||||
$content = @file_get_contents('https://www.prestashop.com/partner/preactivation/preactivation-warnings.php?version=1.0&partner=paypal&iso_country='.Tools::strtolower(Context::getContext()->country->iso_code).'&iso_lang='.Tools::strtolower(Context::getContext()->language->iso_code).'&id_lang='.(int)Context::getContext().'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context);
|
||||
$content = explode('|', $content);
|
||||
if ($content[0] == 'OK')
|
||||
Configuration::updateValue('PS_PREACTIVATION_PAYPAL_WARNING', $content[1]);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
define('PS_ADMIN_DIR', getcwd());
|
||||
include_once(dirname(__FILE__).'/../config/config.inc.php');
|
||||
|
||||
/* Getting cookie or logout */
|
||||
|
||||
+2
-2
@@ -51,8 +51,7 @@ if ((empty($_SERVER['HTTPS']) OR strtolower($_SERVER['HTTPS']) == 'off')
|
||||
.'<br/><br/><a href="https://'.Tools::getServerName().$_SERVER['REQUEST_URI'].'">https://'.Tools::getServerName().$_SERVER['REQUEST_URI'].'</a>';
|
||||
}
|
||||
|
||||
$cookie = Context::getContext()->cookie;
|
||||
$iso = strtolower(Language::getIsoById(Context::getContext()->language->id));
|
||||
$iso = strtolower(Context::getContext()->language->iso_code);
|
||||
include(_PS_TRANSLATIONS_DIR_.$iso.'/admin.php');
|
||||
include(_PS_TRANSLATIONS_DIR_.$iso.'/errors.php');
|
||||
|
||||
@@ -83,6 +82,7 @@ if (Tools::isSubmit('Submit'))
|
||||
{
|
||||
$employee->remote_addr = ip2long(Tools::getRemoteAddr());
|
||||
/* Creating cookie */
|
||||
$cookie = Context::getContext()->cookie;
|
||||
$cookie->id_employee = $employee->id;
|
||||
$cookie->email = $employee->email;
|
||||
$cookie->profile = $employee->id_profile;
|
||||
|
||||
@@ -489,7 +489,6 @@ class AdminModules extends AdminTab
|
||||
|
||||
public function displayList()
|
||||
{
|
||||
$this->context = Context::getContext();
|
||||
$modulesAuthors = array();
|
||||
$autocompleteList = 'var moduleList = [';
|
||||
|
||||
@@ -499,7 +498,7 @@ class AdminModules extends AdminTab
|
||||
$showCountryModules = Configuration::get('PS_SHOW_COUNTRY_MODULES_'.(int)$this->context->employee->id);
|
||||
|
||||
$nameCountryDefault = Country::getNameById($this->context->language->id, Configuration::get('PS_COUNTRY_DEFAULT'));
|
||||
$isoCountryDefault = Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'));
|
||||
$isoCountryDefault = $this->context->country->iso_code;
|
||||
|
||||
$serialModules = '';
|
||||
$modules = Module::getModulesOnDisk(true);
|
||||
|
||||
@@ -606,7 +606,8 @@ class CustomerCore extends ObjectModel
|
||||
/**
|
||||
* Check customer informations and return customer validity
|
||||
*
|
||||
* @parma boolean $withGuest
|
||||
* @since 1.5.0
|
||||
* @param boolean $withGuest
|
||||
* @return boolean customer validity
|
||||
*/
|
||||
public function isLogged($withGuest = false)
|
||||
@@ -622,6 +623,8 @@ class CustomerCore extends ObjectModel
|
||||
|
||||
/**
|
||||
* Logout
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
public function logout()
|
||||
{
|
||||
@@ -633,6 +636,8 @@ class CustomerCore extends ObjectModel
|
||||
/**
|
||||
* Soft logout, delete everything links to the customer
|
||||
* but leave there affiliate's informations
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
public function mylogout()
|
||||
{
|
||||
|
||||
+2
-2
@@ -189,7 +189,7 @@ class PDFCore extends PDF_PageGroupCore
|
||||
private function _builMerchantFooterDetail($conf)
|
||||
{
|
||||
// If the country is USA
|
||||
if (Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT')) == 'US')
|
||||
if (Context::getContext()->country->iso_code == 'US')
|
||||
{
|
||||
$completeAddressShop = $this->_getCompleteUSAddressFormat($conf);
|
||||
|
||||
@@ -449,7 +449,7 @@ class PDFCore extends PDF_PageGroupCore
|
||||
if (!in_array($pattern, $patternRules['avoid']))
|
||||
{
|
||||
if ($pattern == 'State:name' &&
|
||||
Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT')) == 'US')
|
||||
Context::getContext()->country->iso_code == 'US')
|
||||
{
|
||||
$state = &$addressType[$type]['addressFormatedValues'][$pattern];
|
||||
$state = strtoupper(substr($state, 0, 2));
|
||||
|
||||
@@ -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>');
|
||||
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user