[-] BO : theme mobile : #PSCFV-3910

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17218 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2012-09-06 16:28:23 +00:00
parent 85f9330df2
commit 9be7d9b0f9
5 changed files with 20 additions and 19 deletions
+6 -13
View File
@@ -103,11 +103,6 @@ class ContextCore
*/
protected $mobile_device;
/**
* @var boolean|string touch pad device of the customer
*/
protected $touchpad_device;
public function getMobileDevice()
{
if (is_null($this->mobile_device))
@@ -117,23 +112,21 @@ class ContextCore
{
$detect = new Mobile_Detect();
switch (Configuration::get('PS_ALLOW_MOBILE_DEVICE'))
switch ((int)Configuration::get('PS_ALLOW_MOBILE_DEVICE'))
{
case '1': // Only for mobile device
case 1: // Only for mobile device
if ($detect->isMobile() && !$detect->isTablet())
$this->mobile_device = true;
break;
case '2': // Only for touchpads
case 2: // Only for touchpads
if ($detect->isTablet() && !$detect->is_mobile())
$this->mobile_device = true;
break;
case '3': // For touchpad and mobile devices
if ($detect->isMobile() && $detect->isTablet())
case 3: // For touchpad or mobile devices
if ($detect->isMobile() || $detect->isTablet())
$this->mobile_device = true;
break;
}
if ($detect->isMobile() && !$detect->isTablet())
$this->mobile_device = true;
}
}
@@ -143,7 +136,7 @@ class ContextCore
protected function checkMobileContext()
{
return file_exists(_PS_THEME_MOBILE_DIR_)
&& Configuration::get('PS_ALLOW_MOBILE_DEVICE')
&& (bool)Configuration::get('PS_ALLOW_MOBILE_DEVICE')
&& isset($_SERVER['HTTP_USER_AGENT'])
&& !Context::getContext()->cookie->no_mobile;
}