[-] FO : show mobile theme if you have click "Broswe the mobile site" on a PC

This commit is contained in:
PrestaEdit
2012-11-27 22:55:57 +01:00
parent f5d4fbccfd
commit 19e14c976a
+20 -15
View File
@@ -111,22 +111,27 @@ class ContextCore
$this->mobile_device = false;
if ($this->checkMobileContext())
{
require_once(_PS_TOOL_DIR_.'mobile_Detect/Mobile_Detect.php');
$this->mobile_detect = new Mobile_Detect();
switch ((int)Configuration::get('PS_ALLOW_MOBILE_DEVICE'))
if(Context::getContext()->cookie->no_mobile == false AND (int)Configuration::get('PS_ALLOW_MOBILE_DEVICE') != 0)
$this->mobile_device = true;
else
{
case 1: // Only for mobile device
if ($this->mobile_detect->isMobile() && !$this->mobile_detect->isTablet())
$this->mobile_device = true;
break;
case 2: // Only for touchpads
if ($this->mobile_detect->isTablet() && $this->mobile_detect->isMobile())
$this->mobile_device = true;
break;
case 3: // For touchpad or mobile devices
if ($this->mobile_detect->isMobile() || $this->mobile_detect->isTablet())
$this->mobile_device = true;
break;
require_once(_PS_TOOL_DIR_.'mobile_Detect/Mobile_Detect.php');
$this->mobile_detect = new Mobile_Detect();
switch ((int)Configuration::get('PS_ALLOW_MOBILE_DEVICE'))
{
case 1: // Only for mobile device
if ($this->mobile_detect->isMobile() && !$this->mobile_detect->isTablet())
$this->mobile_device = true;
break;
case 2: // Only for touchpads
if ($this->mobile_detect->isTablet() && $this->mobile_detect->isMobile())
$this->mobile_device = true;
break;
case 3: // For touchpad or mobile devices
if ($this->mobile_detect->isMobile() || $this->mobile_detect->isTablet())
$this->mobile_device = true;
break;
}
}
}
}