Fix missing global theme check refs #4723 (#4724)

This commit is contained in:
moreamazingnick 2022-03-29 16:34:35 +02:00 committed by GitHub
parent d63f645bd8
commit ba677de0c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -186,6 +186,7 @@ class PreferenceForm extends Form
);
}
$themeFile = StyleSheet::getThemeFile(Config::app()->get('themes', 'default'));
if (! (bool) Config::app()->get('themes', 'disabled', false)) {
$themes = Icinga::app()->getThemes();
if (count($themes) > 1) {
@ -212,7 +213,10 @@ class PreferenceForm extends Form
if (isset($formData['theme']) && $formData['theme'] !== StyleSheet::DEFAULT_THEME) {
$themeFile = StyleSheet::getThemeFile($formData['theme']);
$file = $themeFile !== null ? @file_get_contents($themeFile) : false;
}
if ($themeFile !== null) {
$file = @file_get_contents($themeFile);
if ($file && strpos($file, StyleSheet::LIGHT_MODE_IDENTIFIER) === false) {
$disabled = ['', 'light', 'system'];
}