mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
ThemeService now finds first theme that is _enabled_ in priority list. If no theme exists or is enabled the SafeMode theme is selected.
--HG-- branch : dev
This commit is contained in:
@@ -154,11 +154,11 @@ namespace Orchard.Themes.Services {
|
|||||||
|
|
||||||
foreach (var theme in requestTheme) {
|
foreach (var theme in requestTheme) {
|
||||||
var t = GetThemeByName(theme.ThemeName);
|
var t = GetThemeByName(theme.ThemeName);
|
||||||
if (t != null)
|
if (t != null && t.Enabled)
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return GetThemeByName("SafeMode");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ITheme GetThemeByName(string name) {
|
public ITheme GetThemeByName(string name) {
|
||||||
@@ -221,7 +221,8 @@ namespace Orchard.Themes.Services {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private bool IsThemeEnabled(ExtensionDescriptor descriptor) {
|
private bool IsThemeEnabled(ExtensionDescriptor descriptor) {
|
||||||
return _shellDescriptorManager.GetShellDescriptor().Features.Any(sf => sf.Name == descriptor.Name);
|
return (descriptor.Name == "TheAdmin" || descriptor.Name == "SafeMode") ||
|
||||||
|
_shellDescriptorManager.GetShellDescriptor().Features.Any(sf => sf.Name == descriptor.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ITheme CreateTheme(ExtensionDescriptor descriptor) {
|
private ITheme CreateTheme(ExtensionDescriptor descriptor) {
|
||||||
|
|||||||
Reference in New Issue
Block a user