mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Adding a GetEnabledThemes() so the WidgetService can get the zones of only enabled themes
--HG-- branch : dev
This commit is contained in:
@@ -207,10 +207,29 @@ namespace Orchard.Tests.Modules.Themes.Services {
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<ExtensionDescriptor> EnabledExtensions(ShellDescriptor descriptor) {
|
||||
var extensions = new[] {
|
||||
new ExtensionDescriptor {Name = "ThemeOne", ExtensionType = "Theme"},
|
||||
new ExtensionDescriptor {Name = "ThemeTwo", BaseTheme = "ThemeOne", ExtensionType = "Theme"},
|
||||
new ExtensionDescriptor {Name = "ThemeThree", BaseTheme = "TheThemeThatIsntThere", ExtensionType = "Theme"},
|
||||
new ExtensionDescriptor {Name = "ThemeFourBasedOnFive", BaseTheme = "ThemeFiveBasedOnFour", ExtensionType = "Theme"},
|
||||
new ExtensionDescriptor {Name = "ThemeFiveBasedOnFour", BaseTheme = "ThemeFourBasedOnFive", ExtensionType = "Theme"},
|
||||
};
|
||||
|
||||
foreach (var extension in extensions) {
|
||||
extension.Features = new[] { new FeatureDescriptor { Extension = extension, Name = extension.Name } };
|
||||
yield return extension;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<FeatureDescriptor> AvailableFeatures() {
|
||||
return AvailableExtensions().SelectMany(ed => ed.Features);
|
||||
}
|
||||
|
||||
public IEnumerable<FeatureDescriptor> EnabledFeatures(ShellDescriptor descriptor) {
|
||||
return AvailableExtensions().SelectMany(ed => ed.Features);
|
||||
}
|
||||
|
||||
public IEnumerable<Feature> LoadFeatures(IEnumerable<FeatureDescriptor> featureDescriptors) {
|
||||
return featureDescriptors.Select(FrameworkFeature);
|
||||
}
|
||||
|
Reference in New Issue
Block a user