Fix unexpected desktop mode on mobile devices + small fixes (#1514)

This commit is contained in:
RainLoop 2017-09-24 19:14:48 +03:00
parent 677a5f2e35
commit ed5685314e
10 changed files with 115 additions and 88 deletions

View file

@ -162,18 +162,20 @@ class Service
$bMobileDevice = $oMobileDetect->isMobile() &&
($bUseMobileVersionForTablets ? true : !$oMobileDetect->isTablet());
$bMobile = (0 < \count($aPaths) && !empty($aPaths[0]) && 'mobile' === \strtolower($aPaths[0]));
}
if ($bIndex && !$bMobile)
{
$iMobileKey = (int) \RainLoop\Utils::GetCookie(\RainLoop\Actions::RL_SKIP_MOBILE_KEY, 0);
if (1 !== $iMobileKey)
if ($bIndex)
{
if ($bMobileDevice)
{
$this->oActions->Location('./?/Mobile/');
return $this;
$sMobileType = (string) \RainLoop\Utils::GetCookie(\RainLoop\Actions::RL_MOBILE_TYPE, '');
switch ($sMobileType) {
default:
$sMobileType = '';
$bMobile = $bMobileDevice;
break;
case 'mobile':
$bMobile = true;
break;
case 'desktop':
$bMobile = false;
break;
}
}
}