mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
- Themes: uninstalling themes from the admin.
- ExtensionManager: UninstallExtension API --HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4043841
This commit is contained in:
@@ -67,7 +67,20 @@ namespace Orchard.Core.Themes.Controllers {
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
catch (Exception exception) {
|
||||
_notifier.Error("Installing theme failed: " + exception.Message);
|
||||
_notifier.Error(T("Installing theme failed: " + exception.Message));
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
}
|
||||
|
||||
public ActionResult Uninstall(string themeName) {
|
||||
try {
|
||||
if (!_authorizer.Authorize(Permissions.InstallUninstallTheme, T("Couldn't uninstall theme")))
|
||||
return new HttpUnauthorizedResult();
|
||||
_themeService.UninstallTheme(themeName);
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
catch (Exception exception) {
|
||||
_notifier.Error(T("Uninstalling theme failed: " + exception.Message));
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
}
|
||||
|
@@ -76,6 +76,10 @@ namespace Orchard.Core.Themes.Services {
|
||||
_extensionManager.InstallExtension("Theme", file);
|
||||
}
|
||||
|
||||
public void UninstallTheme(string themeName) {
|
||||
_extensionManager.UninstallExtension("Theme", themeName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@
|
||||
<%= theme.Version %><br />
|
||||
<%= theme.Description %><br />
|
||||
<%= theme.HomePage %><br />
|
||||
<%=Html.ActionLink("Activate", "Activate", new {themeName = theme.ThemeName}) %>
|
||||
<%=Html.ActionLink("Activate", "Activate", new {themeName = theme.ThemeName}) %> | <%=Html.ActionLink("Uninstall", "Uninstall", new {themeName = theme.ThemeName}) %>
|
||||
</p>
|
||||
</li>
|
||||
<% }
|
||||
|
Reference in New Issue
Block a user