1.10 beta

This commit is contained in:
RainLoop Team 2016-05-02 23:42:29 +03:00
parent 116de6fd45
commit ecf23a4f6d
27 changed files with 259 additions and 158 deletions

View file

@ -1716,10 +1716,6 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$sLanguageAdmin = $oConfig->Get('webmail', 'language_admin', 'en');
$sTheme = $oConfig->Get('webmail', 'theme', 'Default');
$aResult['Themes'] = $this->GetThemes($bMobile);
$aResult['Languages'] = $this->GetLanguages(false);
$aResult['LanguagesAdmin'] = $this->GetLanguages(true);
$aResult['AllowLanguagesOnSettings'] = (bool) $oConfig->Get('webmail', 'allow_languages_on_settings', true);
$aResult['AllowLanguagesOnLogin'] = (bool) $oConfig->Get('login', 'allow_languages_on_login', true);
$aResult['AttachmentLimit'] = ((int) $oConfig->Get('webmail', 'attachment_size_limit', 10)) * 1024 * 1024;
@ -8960,7 +8956,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
}
return \in_array($sTheme, $this->GetThemes($bMobile)) ?
$sTheme : $this->Config()->Get('themes', 'default', 'Default');
$sTheme : $this->Config()->Get('themes', 'default', $bMobile ? 'Mobile' : 'Default');
}
/**
@ -9039,17 +9035,21 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
*
* @return array
*/
public function GetThemes($bMobile = false)
public function GetThemes($bMobile = false, $bIncludeMobile = true)
{
if ($bMobile)
{
return array('Mobile');
}
static $aCache = null;
if (\is_array($aCache))
static $aCache = array('full' => null, 'mobile' => null);
if ($bIncludeMobile && \is_array($aCache['full']))
{
return $aCache;
return $aCache['full'];
}
else if ($bIncludeMobile && \is_array($aCache['mobile']))
{
return $aCache['mobile'];
}
$bClear = false;
@ -9065,21 +9065,18 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
{
if ('.' !== $sFile{0} && \is_dir($sDir.'/'.$sFile) && \file_exists($sDir.'/'.$sFile.'/styles.less'))
{
if ('Default' !== $sFile && 'Clear' !== $sFile)
if ('Default' === $sFile)
{
$bDefault = true;
}
else if ('Clear' === $sFile)
{
$bClear = true;
}
else if ($bIncludeMobile || 'Mobile' !== $sFile)
{
$sList[] = $sFile;
}
else
{
if ('Default' === $sFile)
{
$bDefault = true;
}
else if ('Clear' === $sFile)
{
$bClear = true;
}
}
}
}
@closedir($rDirH);
@ -9117,7 +9114,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
\array_push($sList, 'Clear');
}
$aCache = $sList;
$aCache[$bIncludeMobile ? 'full' : 'mobile'] = $sList;
return $sList;
}

View file

@ -288,9 +288,10 @@ Enables caching in the system'),
),
'labs' => array(
'ignore_folders_subscription' => array(false,
'allow_mobile_version' => array(true,
'Experimental settings. Handle with care.
'),
'ignore_folders_subscription' => array(false),
'check_new_password_strength' => array(true),
'update_channel' => array('stable'),
'allow_gravatar' => array(true),

View file

@ -151,10 +151,16 @@ class Service
}
}
$oMobileDetect = new \Detection\MobileDetect();
$bMobileDevice = $oMobileDetect->isMobile() && !$oMobileDetect->isTablet();
$bMobile = false;
$bMobileDevice = false;
$bMobile = (0 < \count($aPaths) && !empty($aPaths[0]) && 'mobile' === \strtolower($aPaths[0]));
if ($this->oActions->Config()->Get('labs', 'allow_mobile_version', false))
{
$oMobileDetect = new \Detection\MobileDetect();
$bMobileDevice = $oMobileDetect->isMobile() && !$oMobileDetect->isTablet();
$bMobile = (0 < \count($aPaths) && !empty($aPaths[0]) && 'mobile' === \strtolower($aPaths[0]));
}
if ($bIndex && !$bMobile)
{
@ -310,6 +316,9 @@ class Service
'folderSpecLimit' => (int) $oConfig->Get('labs', 'folders_spec_limit', 50),
'faviconStatus' => (bool) $oConfig->Get('labs', 'favicon_status', true),
'listPermanentFiltered' => '' !== \trim(\RainLoop\Api::Config()->Get('labs', 'imap_message_list_permanent_filter', '')),
'themes' => $this->oActions->GetThemes($bMobile, false),
'languages' => $this->oActions->GetLanguages(false),
'languagesAdmin' => $this->oActions->GetLanguages(true),
'attachmentsActions' => $aAttachmentsActions,
'rsaPublicKey' => $sRsaPublicKey
), $bAdmin ? array(