Add labs.use_mobile_version_for_tablets setting in applicxation.ini (#1507)

This commit is contained in:
RainLoop 2017-09-22 19:41:40 +03:00
parent c0d2f5f86e
commit 677a5f2e35
2 changed files with 5 additions and 1 deletions

View file

@ -395,6 +395,7 @@ Enables caching in the system'),
'try_to_detect_hidden_images' => array(false),
'hide_dangerous_actions' => array(false),
'use_app_debug_js' => array(false),
'use_mobile_version_for_tablets' => array(false),
'use_app_debug_css' => array(false),
'use_imap_sort' => array(true),
'use_imap_force_selection' => array(false),

View file

@ -156,8 +156,11 @@ class Service
if ($this->oActions->Config()->Get('labs', 'allow_mobile_version', false))
{
$bUseMobileVersionForTablets = $this->oActions->Config()->Get('labs', 'use_mobile_version_for_tablets', false);
$oMobileDetect = new \Detection\MobileDetect();
$bMobileDevice = $oMobileDetect->isMobile() && !$oMobileDetect->isTablet();
$bMobileDevice = $oMobileDetect->isMobile() &&
($bUseMobileVersionForTablets ? true : !$oMobileDetect->isTablet());
$bMobile = (0 < \count($aPaths) && !empty($aPaths[0]) && 'mobile' === \strtolower($aPaths[0]));
}