diff --git a/classes/Context.php b/classes/Context.php index 37235e264..782070b68 100644 --- a/classes/Context.php +++ b/classes/Context.php @@ -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; } diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php index be124f9ca..f8eac8cab 100755 --- a/classes/controller/FrontController.php +++ b/classes/controller/FrontController.php @@ -252,6 +252,8 @@ class FrontControllerCore extends Controller // Check mobile context if (Tools::isSubmit('no_mobile_theme')) $this->context->cookie->no_mobile = true; + else if (Tools::isSubmit('mobile_theme_ok')) + $this->context->cookie->no_mobile = false; $locale = strtolower(Configuration::get('PS_LOCALE_LANGUAGE')).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY').'.UTF-8'); setlocale(LC_COLLATE, $locale); @@ -792,7 +794,8 @@ class FrontControllerCore extends Controller 'HOOK_FOOTER' => Hook::exec('displayFooter'), 'conditions' => Configuration::get('PS_CONDITIONS'), 'id_cgv' => Configuration::get('PS_CONDITIONS_CMS_ID'), - 'PS_SHOP_NAME' => Configuration::get('PS_SHOP_NAME') + 'PS_SHOP_NAME' => Configuration::get('PS_SHOP_NAME'), + 'PS_ALLOW_MOBILE_DEVICE' => file_exists(_PS_THEME_MOBILE_DIR_) && (bool)Configuration::get('PS_ALLOW_MOBILE_DEVICE') )); } diff --git a/themes/default/css/global.css b/themes/default/css/global.css index d14209dcf..a88266875 100644 --- a/themes/default/css/global.css +++ b/themes/default/css/global.css @@ -59,6 +59,8 @@ body{ /* positionnement ****************************************************************************** */ .hidden {display:none} .f_right {float:right} +p.center {text-align:center} +.clearBoth {clear:both}} /* title *************************************************************************************** */ h1 { diff --git a/themes/default/footer.tpl b/themes/default/footer.tpl index 70cf9b840..fba155230 100644 --- a/themes/default/footer.tpl +++ b/themes/default/footer.tpl @@ -34,7 +34,10 @@ -
+ {/if}