mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 04:43:35 +08:00

- Extensions: Theme and Package extensions are now automatically discovered, their metadata parsed and their types loaded by the ExtensionManager. The ExtensionDescriptor now contains an ExtensionType property which will help distinguish extension types. --HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4043750
36 lines
1.2 KiB
C#
36 lines
1.2 KiB
C#
using System;
|
|
using System.Web.Mvc;
|
|
using Orchard.Core.Themes.ViewModels;
|
|
using Orchard.Localization;
|
|
using Orchard.Themes;
|
|
using Orchard.UI.Notify;
|
|
|
|
namespace Orchard.Core.Themes.Controllers {
|
|
[ValidateInput(false)]
|
|
public class AdminController : Controller {
|
|
private readonly IThemeService _themeService;
|
|
private readonly INotifier _notifier;
|
|
|
|
public AdminController(IThemeService themeService, INotifier notifier) {
|
|
_themeService = themeService;
|
|
_notifier = notifier;
|
|
T = NullLocalizer.Instance;
|
|
}
|
|
|
|
public Localizer T { get; set; }
|
|
|
|
public ActionResult Index() {
|
|
try {
|
|
var themes = _themeService.GetInstalledThemes();
|
|
var currentTheme = _themeService.GetCurrentTheme();
|
|
var model = new ThemesIndexViewModel { CurrentTheme = currentTheme, Themes = themes };
|
|
return View(model);
|
|
}
|
|
catch (Exception exception) {
|
|
_notifier.Error(T("Listing themes failed: " + exception.Message));
|
|
return View(new ThemesIndexViewModel());
|
|
}
|
|
}
|
|
}
|
|
}
|