Small fixes

This commit is contained in:
RainLoop Team 2015-11-27 19:52:19 +03:00
parent 3887073016
commit d844938ee3
6 changed files with 34 additions and 8 deletions

View file

@ -8923,6 +8923,14 @@ class Actions
$sDefault = $sDefault.'_'.$sDefault; $sDefault = $sDefault.'_'.$sDefault;
} }
$sLanguage = \preg_replace_callback('/_([a-zA-Z0-9]{2})$/', function ($aData) {
return \strtoupper($aData[0]);
}, $sLanguage);
$sDefault = \preg_replace_callback('/_([a-zA-Z0-9]{2})$/', function ($aData) {
return \strtoupper($aData[0]);
}, $sDefault);
if (\in_array($sLanguage, $aLang)) if (\in_array($sLanguage, $aLang))
{ {
$sResult = $sLanguage; $sResult = $sLanguage;
@ -8935,8 +8943,8 @@ class Actions
if (empty($sResult) && !$bAllowEmptyResult) if (empty($sResult) && !$bAllowEmptyResult)
{ {
$sResult = $this->Config()->Get('webmail', $bAdmin ? 'language_admin' : 'language', 'en_us'); $sResult = $this->Config()->Get('webmail', $bAdmin ? 'language_admin' : 'language', 'en_US');
$sResult = \in_array($sResult, $aLang) ? $sResult : 'en_us'; $sResult = \in_array($sResult, $aLang) ? $sResult : 'en_US';
} }
} }
@ -9063,7 +9071,7 @@ class Actions
{ {
if ('.' !== $sFile{0} && \is_file($sDir.'/'.$sFile) && '.yml' === \substr($sFile, -4)) if ('.' !== $sFile{0} && \is_file($sDir.'/'.$sFile) && '.yml' === \substr($sFile, -4))
{ {
$sLang = \strtolower(\substr($sFile, 0, -4)); $sLang = \substr($sFile, 0, -4);
if (0 < \strlen($sLang) && 'always' !== $sLang && '_source.en' !== $sLang) if (0 < \strlen($sLang) && 'always' !== $sLang && '_source.en' !== $sLang)
{ {
\array_push($aList, $sLang); \array_push($aList, $sLang);
@ -9482,11 +9490,13 @@ class Actions
if (null === $aLang) if (null === $aLang)
{ {
$sLang = $this->ValidateLanguage($sLang, 'en');
$aLang = array(); $aLang = array();
// \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/i18n/langs.ini', $aLang); // \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/i18n/langs.ini', $aLang);
// \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'langs/'.$sLang.'.ini', $aLang); // \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'langs/'.$sLang.'.ini', $aLang);
\RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/localization/langs.yml', $aLang); \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/localization/langs.yml', $aLang);
\RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/localization/webmail/'.$sLang.'.ini', $aLang); \RainLoop\Utils::ReadAndAddLang(APP_VERSION_ROOT_PATH.'app/localization/webmail/'.$sLang.'.yml', $aLang);
$this->Plugins()->ReadLang($sLang, $aLang); $this->Plugins()->ReadLang($sLang, $aLang);
} }

View file

@ -226,6 +226,8 @@ class ServiceActions
*/ */
public function ServiceOwnCloudAuth() public function ServiceOwnCloudAuth()
{ {
$this->oHttp->ServerNoCache();
if (!\RainLoop\Utils::IsOwnCloud() || if (!\RainLoop\Utils::IsOwnCloud() ||
!isset($_ENV['___rainloop_owncloud_email']) || !isset($_ENV['___rainloop_owncloud_email']) ||
!isset($_ENV['___rainloop_owncloud_password']) || !isset($_ENV['___rainloop_owncloud_password']) ||
@ -840,6 +842,8 @@ class ServiceActions
*/ */
public function ServiceMailto() public function ServiceMailto()
{ {
$this->oHttp->ServerNoCache();
$sTo = \trim($this->oHttp->GetQuery('to', '')); $sTo = \trim($this->oHttp->GetQuery('to', ''));
if (!empty($sTo) && \preg_match('/^mailto:/i', $sTo)) if (!empty($sTo) && \preg_match('/^mailto:/i', $sTo))
{ {
@ -859,6 +863,8 @@ class ServiceActions
*/ */
public function ServicePing() public function ServicePing()
{ {
$this->oHttp->ServerNoCache();
@\header('Content-Type: text/plain; charset=utf-8'); @\header('Content-Type: text/plain; charset=utf-8');
$this->oActions->Logger()->Write('Pong', \MailSo\Log\Enumerations\Type::INFO, 'PING'); $this->oActions->Logger()->Write('Pong', \MailSo\Log\Enumerations\Type::INFO, 'PING');
return 'Pong'; return 'Pong';
@ -869,6 +875,8 @@ class ServiceActions
*/ */
public function ServiceInfo() public function ServiceInfo()
{ {
$this->oHttp->ServerNoCache();
if ($this->oActions->IsAdminLoggined(false)) if ($this->oActions->IsAdminLoggined(false))
{ {
@\header('Content-Type: text/html; charset=utf-8'); @\header('Content-Type: text/html; charset=utf-8');
@ -881,6 +889,8 @@ class ServiceActions
*/ */
public function ServiceSso() public function ServiceSso()
{ {
$this->oHttp->ServerNoCache();
$oException = null; $oException = null;
$oAccount = null; $oAccount = null;
$bLogout = true; $bLogout = true;
@ -997,6 +1007,8 @@ class ServiceActions
*/ */
public function ServiceExternalLogin() public function ServiceExternalLogin()
{ {
$this->oHttp->ServerNoCache();
$oException = null; $oException = null;
$oAccount = null; $oAccount = null;
$bLogout = true; $bLogout = true;
@ -1063,6 +1075,8 @@ class ServiceActions
*/ */
public function ServiceExternalSso() public function ServiceExternalSso()
{ {
$this->oHttp->ServerNoCache();
$sResult = ''; $sResult = '';
$bLogout = true; $bLogout = true;
$sKey = $this->oActions->Config()->Get('labs', 'external_sso_key', ''); $sKey = $this->oActions->Config()->Get('labs', 'external_sso_key', '');
@ -1104,6 +1118,8 @@ class ServiceActions
*/ */
public function ServiceChange() public function ServiceChange()
{ {
$this->oHttp->ServerNoCache();
$oAccount = $this->oActions->GetAccount(); $oAccount = $this->oActions->GetAccount();
if ($oAccount && $this->oActions->GetCapa(false, \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS, $oAccount)) if ($oAccount && $this->oActions->GetCapa(false, \RainLoop\Enumerations\Capa::ADDITIONAL_ACCOUNTS, $oAccount))

View file

@ -2,7 +2,7 @@
Common: Common:
LANGS_NAMES: LANGS_NAMES:
LANG_EN: English LANG_EN: English
LANG_EN_US: English (US) LANG_EN_US: English
LANG_EN_GB: English (UK) LANG_EN_GB: English (UK)
LANG_EN_UK: English (UK) LANG_EN_UK: English (UK)
LANG_EN_CA: English (Canadian) LANG_EN_CA: English (Canadian)

View file

@ -13,7 +13,7 @@
<div class="controls"> <div class="controls">
<div class="flag-selector"> <div class="flag-selector">
<span class="flag-wrapper"> <span class="flag-wrapper">
<span data-bind="css: 'flag flag-' + language()" style=""></span> <span data-bind="css: 'flag flag-' + language().toLowerCase()" style=""></span>
</span> </span>
<span class="flag-name" tabindex="0" data-bind="text: languageFullName, click: selectLanguage, onSpace: selectLanguage, onEnter: selectLanguage"></span> <span class="flag-name" tabindex="0" data-bind="text: languageFullName, click: selectLanguage, onSpace: selectLanguage, onEnter: selectLanguage"></span>
&nbsp;&nbsp; &nbsp;&nbsp;

View file

@ -11,7 +11,7 @@
<label class="lang-item" data-tooltip-i18n="off" data-tooltip-join="right" data-bind="click: function () { $root.changeLanguage(key); }, css: {'selected': selected, 'user': user}, <label class="lang-item" data-tooltip-i18n="off" data-tooltip-join="right" data-bind="click: function () { $root.changeLanguage(key); }, css: {'selected': selected, 'user': user},
tooltip: function () { return $root.languageTooltipName(key); }"> tooltip: function () { return $root.languageTooltipName(key); }">
<span class="flag-wrapper"> <span class="flag-wrapper">
<span data-bind="css: 'flag flag-' + key" style=""></span> <span data-bind="css: 'flag flag-' + key.toLowerCase()" style=""></span>
</span> </span>
<span class="lang-name" data-bind="text: fullName"></span> <span class="lang-name" data-bind="text: fullName"></span>
<i class="icon-ok pull-right" style="color: green; margin-top: 3px;" <i class="icon-ok pull-right" style="color: green; margin-top: 3px;"

View file

@ -21,7 +21,7 @@
<div class="controls"> <div class="controls">
<div class="flag-selector"> <div class="flag-selector">
<span class="flag-wrapper"> <span class="flag-wrapper">
<span data-bind="css: 'flag flag-' + language()" style=""></span> <span data-bind="css: 'flag flag-' + language().toLowerCase()" style=""></span>
</span> </span>
<span class="flag-name" tabindex="0" data-bind="text: languageFullName, click: selectLanguage, onSpace: selectLanguage, onEnter: selectLanguage"></span> <span class="flag-name" tabindex="0" data-bind="text: languageFullName, click: selectLanguage, onSpace: selectLanguage, onEnter: selectLanguage"></span>
&nbsp;&nbsp; &nbsp;&nbsp;