// PrestaShop normalisation

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13868 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
nPellicari
2012-03-06 09:09:47 +00:00
parent c8f09a7148
commit 7f0df4f1c7
2 changed files with 15 additions and 15 deletions
+4 -4
View File
@@ -104,7 +104,7 @@ class ContextCore
* @var boolean|string touch pad device of the customer * @var boolean|string touch pad device of the customer
*/ */
protected $touchpad_device; protected $touchpad_device;
public function getMobileDevice() public function getMobileDevice()
{ {
if (is_null($this->mobile_device)) if (is_null($this->mobile_device))
@@ -117,10 +117,10 @@ class ContextCore
return $this->mobile_device; return $this->mobile_device;
} }
protected function checkMobileContext() protected function checkMobileContext()
{ {
return file_exists(_PS_THEME_MOBILE_DIR_) return file_exists(_PS_THEME_MOBILE_DIR_)
&& Configuration::get('PS_ALLOW_MOBILE_DEVICE') && Configuration::get('PS_ALLOW_MOBILE_DEVICE')
&& isset($_SERVER['HTTP_USER_AGENT']); && isset($_SERVER['HTTP_USER_AGENT']);
} }
@@ -146,7 +146,7 @@ class ContextCore
} }
return $this->touchpad_device; return $this->touchpad_device;
} }
/** /**
* Get a singleton context * Get a singleton context
* *
+11 -11
View File
@@ -325,7 +325,7 @@ class FrontControllerCore extends Controller
'b2b_enable' => (bool)Configuration::get('PS_B2B_ENABLE'), 'b2b_enable' => (bool)Configuration::get('PS_B2B_ENABLE'),
'request' => $link->getPaginationLink(false, false, false, true) 'request' => $link->getPaginationLink(false, false, false, true)
)); ));
// Add the tpl files directory for mobile // Add the tpl files directory for mobile
if ($this->context->getMobileDevice() != false) if ($this->context->getMobileDevice() != false)
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
@@ -339,7 +339,7 @@ class FrontControllerCore extends Controller
'customerName' => ($this->context->customer->logged ? $this->context->cookie->customer_firstname.' '.$this->context->cookie->customer_lastname : false) 'customerName' => ($this->context->customer->logged ? $this->context->cookie->customer_firstname.' '.$this->context->cookie->customer_lastname : false)
)); ));
$assignArray = array( $assign_array = array(
'img_ps_dir' => _PS_IMG_, 'img_ps_dir' => _PS_IMG_,
'img_cat_dir' => _THEME_CAT_DIR_, 'img_cat_dir' => _THEME_CAT_DIR_,
'img_lang_dir' => _THEME_LANG_DIR_, 'img_lang_dir' => _THEME_LANG_DIR_,
@@ -354,16 +354,16 @@ class FrontControllerCore extends Controller
'js_dir' => _THEME_JS_DIR_, 'js_dir' => _THEME_JS_DIR_,
'pic_dir' => _THEME_PROD_PIC_DIR_ 'pic_dir' => _THEME_PROD_PIC_DIR_
); );
// Add the images directory for mobile // Add the images directory for mobile
if ($this->context->getMobileDevice() != false) if ($this->context->getMobileDevice() != false)
$assignArray['img_mobile_dir'] = _THEME_MOBILE_IMG_DIR_; $assign_array['img_mobile_dir'] = _THEME_MOBILE_IMG_DIR_;
foreach ($assignArray as $assignKey => $assignValue) foreach ($assign_array as $assign_key => $assign_value)
if (substr($assignValue, 0, 1) == '/' || $protocol_content == 'https://') if (substr($assign_value, 0, 1) == '/' || $protocol_content == 'https://')
$this->context->smarty->assign($assignKey, $protocol_content.Tools::getMediaServer($assignValue).$assignValue); $this->context->smarty->assign($assign_key, $protocol_content.Tools::getMediaServer($assign_value).$assign_value);
else else
$this->context->smarty->assign($assignKey, $assignValue); $this->context->smarty->assign($assign_key, $assign_value);
/* /*
* These shortcuts are DEPRECATED as of version 1.5. * These shortcuts are DEPRECATED as of version 1.5.
@@ -958,7 +958,7 @@ class FrontControllerCore extends Controller
{ {
if ($this->context->getMobileDevice() != false) if ($this->context->getMobileDevice() != false)
$this->setMobileTemplate($template); $this->setMobileTemplate($template);
else else
parent::setTemplate($template); parent::setTemplate($template);
} }
@@ -970,8 +970,8 @@ class FrontControllerCore extends Controller
{ {
$mobile_template = ''; $mobile_template = '';
$tpl_file = basename($template); $tpl_file = basename($template);
$dirname = dirname($template).(substr(dirname($template), -1, 1) == '/' ? '' : '/'); $dirname = dirname($template).(substr(dirname($template), -1, 1) == '/' ? '' : '/');
if ($dirname == _PS_THEME_DIR_) if ($dirname == _PS_THEME_DIR_)
{ {
if (file_exists(_PS_THEME_MOBILE_DIR_.$tpl_file)) if (file_exists(_PS_THEME_MOBILE_DIR_.$tpl_file))