- 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:
suhacan
2009-12-11 23:10:54 +00:00
parent 1338e5b3eb
commit dc197390d8
9 changed files with 67 additions and 10 deletions

View File

@@ -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");
}
}

View File

@@ -76,6 +76,10 @@ namespace Orchard.Core.Themes.Services {
_extensionManager.InstallExtension("Theme", file);
}
public void UninstallTheme(string themeName) {
_extensionManager.UninstallExtension("Theme", themeName);
}
#endregion
}
}

View File

@@ -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>
<% }