git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17245 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dMetzger
2012-09-07 15:41:35 +00:00
parent a0203b82b1
commit 2ed0a00ef0
+2 -9
View File
@@ -25,9 +25,6 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*/ */
if ((bool)Configuration::get('PS_ALLOW_MOBILE_DEVICE'))
require_once(_PS_TOOL_DIR_.'mobile_Detect/Mobile_Detect.php');
/** /**
* @since 1.5.0 * @since 1.5.0
*/ */
@@ -108,12 +105,6 @@ class ContextCore
*/ */
protected $mobile_device; protected $mobile_device;
public function __construct()
{
if ((bool)Configuration::get('PS_ALLOW_MOBILE_DEVICE'))
$this->mobile_detect = new Mobile_Detect();
}
public function getMobileDevice() public function getMobileDevice()
{ {
if (is_null($this->mobile_device)) if (is_null($this->mobile_device))
@@ -121,6 +112,8 @@ class ContextCore
$this->mobile_device = false; $this->mobile_device = false;
if ($this->checkMobileContext()) 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')) switch ((int)Configuration::get('PS_ALLOW_MOBILE_DEVICE'))
{ {
case 1: // Only for mobile device case 1: // Only for mobile device