mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-10 15:08:28 +03:00
Cleanup lessphp specific for SnappyMail
This commit is contained in:
parent
a50b537892
commit
2d435fb42b
2 changed files with 829 additions and 1302 deletions
|
|
@ -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
Loading…
Add table
Add a link
Reference in a new issue