mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-24 13:33:34 +08:00
Changing Themes activate and uninstall actions to POST
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4045458
This commit is contained in:
@@ -37,6 +37,7 @@ namespace Orchard.Core.Themes.Controllers {
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Activate(string themeName) {
|
||||
try {
|
||||
if (!_authorizer.Authorize(Permissions.SetSiteTheme, T("Couldn't set the current theme")))
|
||||
@@ -54,7 +55,7 @@ namespace Orchard.Core.Themes.Controllers {
|
||||
return View(new AdminViewModel());
|
||||
}
|
||||
|
||||
[AcceptVerbs(HttpVerbs.Post)]
|
||||
[HttpPost]
|
||||
public ActionResult Install(FormCollection input) {
|
||||
try {
|
||||
if (!_authorizer.Authorize(Permissions.InstallUninstallTheme, T("Couldn't install theme")))
|
||||
@@ -71,6 +72,7 @@ namespace Orchard.Core.Themes.Controllers {
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult Uninstall(string themeName) {
|
||||
try {
|
||||
if (!_authorizer.Authorize(Permissions.InstallUninstallTheme, T("Couldn't uninstall theme")))
|
||||
|
@@ -29,9 +29,20 @@
|
||||
<%=_Encoded("By") %> <%=Html.Encode(theme.Author) %><br />
|
||||
<%=Html.Encode(theme.Version) %><br />
|
||||
<%=Html.Encode(theme.Description) %><br />
|
||||
<%=Html.Encode(theme.HomePage) %><br />
|
||||
<%=Html.ActionLink(T("Activate").ToString(), "Activate", new {themeName = theme.ThemeName}) %> | <%=Html.ActionLink(T("Uninstall").ToString(), "Uninstall", new {themeName = theme.ThemeName}) %>
|
||||
<%=Html.Encode(theme.HomePage) %>
|
||||
</p>
|
||||
<div>
|
||||
<% using(Html.BeginFormAntiForgeryPost(Url.Action("Activate"), FormMethod.Post, new { @class = "inline" })) { %>
|
||||
<fieldset>
|
||||
<button type="submit" title="<%=_Encoded("Activate") %>" name="themeName" value="<%=theme.ThemeName %>"><%=_Encoded("Activate") %></button>
|
||||
</fieldset>
|
||||
<% } %>
|
||||
<% using(Html.BeginFormAntiForgeryPost(Url.Action("Uninstall"), FormMethod.Post, new { @class = "inline" })) { %>
|
||||
<fieldset>
|
||||
<button type="submit" class="remove" title="<%=_Encoded("Uninstall") %>" name="themeName" value="<%=theme.ThemeName %>"><%=_Encoded("Uninstall")%></button>
|
||||
</fieldset>
|
||||
<% } %>
|
||||
</div>
|
||||
</li>
|
||||
<% }
|
||||
} %>
|
||||
|
Reference in New Issue
Block a user