From 4b8105e9268d5bbe49bda91189b0682439709351 Mon Sep 17 00:00:00 2001 From: dMetzger Date: Fri, 7 Sep 2012 15:41:35 +0000 Subject: [PATCH] // Opti --- classes/Context.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/classes/Context.php b/classes/Context.php index 642c2b79d..ae14954ec 100644 --- a/classes/Context.php +++ b/classes/Context.php @@ -25,9 +25,6 @@ * 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 */ @@ -108,12 +105,6 @@ class ContextCore */ protected $mobile_device; - public function __construct() - { - if ((bool)Configuration::get('PS_ALLOW_MOBILE_DEVICE')) - $this->mobile_detect = new Mobile_Detect(); - } - public function getMobileDevice() { if (is_null($this->mobile_device)) @@ -121,6 +112,8 @@ 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')) { case 1: // Only for mobile device