Просмотр исходного кода

Load theme icons in views rendered without layout (#9564)

The theme was only loaded by the layout, so AJAX-loaded views such as the feed and category settings panels fell back to the default icons.
Carl 6 часов назад
Родитель
Сommit
df1953f8d3
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      app/Models/Themes.php

+ 5 - 0
app/Models/Themes.php

@@ -167,6 +167,11 @@ class FreshRSS_Themes extends Minz_Model {
 			return '';
 		}
 
+		// Not yet loaded when rendering without layout, e.g. AJAX views
+		if (!isset(self::$themeIcons) && FreshRSS_Context::hasUserConf()) {
+			self::load(FreshRSS_Context::userConf()->theme);
+		}
+
 		$url = $name . '.svg';
 		$url = isset(self::$themeIcons[$url]) ? (self::$themeIconsUrl . $url) : (self::$defaultIconsUrl . $url);