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

(cherry picked from commit ba677de0c699cf8719bf28f67da7bbe62a1de85f)
This commit is contained in:
moreamazingnick 2022-03-29 16:34:35 +02:00 committed by Johannes Meyer
parent a6a3de3d1e
commit a76881ffa5

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'];
}