Cleanup lessphp specific for SnappyMail

This commit is contained in:
djmaze 2021-11-29 11:41:10 +01:00
parent a50b537892
commit 2d435fb42b
2 changed files with 829 additions and 1302 deletions

View file

@ -7,17 +7,16 @@ trait Themes
public function GetTheme(bool $bAdmin): string
{
static $sTheme;
if ($sTheme) {
return $sTheme;
if (!$sTheme) {
$sTheme = $this->Config()->Get('webmail', 'theme', 'Default');
if (!$bAdmin
&& ($oAccount = $this->getAccountFromToken(false))
&& $this->GetCapa(false, \RainLoop\Enumerations\Capa::THEMES, $oAccount)
&& ($oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount))) {
$sTheme = (string) $oSettingsLocal->GetConf('Theme', $sTheme);
}
$sTheme = $this->ValidateTheme($sTheme) ?: 'Default';
}
$sTheme = $this->Config()->Get('webmail', 'theme', 'Default');
if (!$bAdmin
&& ($oAccount = $this->getAccountFromToken(false))
&& $this->GetCapa(false, \RainLoop\Enumerations\Capa::THEMES, $oAccount)
&& ($oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount))) {
$sTheme = (string) $oSettingsLocal->GetConf('Theme', $sTheme);
}
$sTheme = $this->ValidateTheme($sTheme) ?: 'Default';
return $sTheme;
}
@ -100,9 +99,6 @@ trait Themes
$sTheme = \substr($sTheme, 0, -7);
}
$oLess = new \LessPHP\lessc();
$oLess->setFormatter('compressed');
$aResult = array();
$sThemeCSSFile = ($bCustomTheme ? APP_INDEX_ROOT_PATH : APP_VERSION_ROOT_PATH).'themes/'.$sTheme.'/styles.css';
@ -122,6 +118,6 @@ trait Themes
$aResult[] = $this->Plugins()->CompileCss($bAdmin);
return $oLess->compile(\implode("\n", $aResult));
return (new \LessPHP\lessc())->compile(\implode("\n", $aResult));
}
}

File diff suppressed because it is too large Load diff