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