parent
da56ddc312
commit
82485236f7
|
@ -104,14 +104,19 @@ class Auth
|
|||
// Reload CSS if the theme changed
|
||||
$themingConfig = Icinga::app()->getConfig()->getSection('themes');
|
||||
$userTheme = $user->getPreferences()->getValue('icingaweb', 'theme');
|
||||
$themeMode = $user->getPreferences()->getValue('icingaweb', 'theme_mode');
|
||||
if (! (bool) $themingConfig->get('disabled', false) && $userTheme !== null) {
|
||||
$defaultTheme = $themingConfig->get('default', StyleSheet::DEFAULT_THEME);
|
||||
if (($userTheme !== $defaultTheme) || ($themeMode !== StyleSheet::DEFAULT_MODE)) {
|
||||
if ($userTheme !== $defaultTheme) {
|
||||
$this->getResponse()->setReloadCss(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Also reload CSS if the theme mode changed
|
||||
$themeMode = $user->getPreferences()->getValue('icingaweb', 'theme_mode');
|
||||
if ($themeMode && $themeMode !== StyleSheet::DEFAULT_MODE) {
|
||||
$this->getResponse()->setReloadCss(true);
|
||||
}
|
||||
|
||||
// Reload entire layout if the locale changed
|
||||
if (($locale = $user->getPreferences()->getValue('icingaweb', 'language')) !== null) {
|
||||
if (setlocale(LC_ALL, 0) !== $locale && $this->getRequest()->isXmlHttpRequest()) {
|
||||
|
|
Loading…
Reference in New Issue