Fixing the content publish/unpublish links in the Contents.Publish.SummaryAdmin part template

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-07-18 08:46:44 -07:00
parent 92c6460e57
commit 55ddbcb427
3 changed files with 13 additions and 6 deletions

View File

@@ -232,7 +232,7 @@ namespace Orchard.Core.Contents.Controllers {
}
[HttpPost]
public ActionResult Publish(int id) {
public ActionResult Publish(int id, string returnUrl) {
if (!Services.Authorizer.Authorize(Permissions.PublishContent, T("Couldn't publish content")))
return new HttpUnauthorizedResult();
@@ -244,11 +244,14 @@ namespace Orchard.Core.Contents.Controllers {
Services.ContentManager.Flush();
Services.Notifier.Information(T("{0} successfully published.", contentItem.TypeDefinition.DisplayName));
if (!String.IsNullOrEmpty(returnUrl))
return Redirect(returnUrl);
return RedirectToAction("List");
}
[HttpPost]
public ActionResult Unpublish(int id) {
public ActionResult Unpublish(int id, string returnUrl) {
if (!Services.Authorizer.Authorize(Permissions.PublishContent, T("Couldn't unpublish content")))
return new HttpUnauthorizedResult();
@@ -260,6 +263,9 @@ namespace Orchard.Core.Contents.Controllers {
Services.ContentManager.Flush();
Services.Notifier.Information(T("{0} successfully unpublished.", contentItem.TypeDefinition.DisplayName));
if (!String.IsNullOrEmpty(returnUrl))
return Redirect(returnUrl);
return RedirectToAction("List");
}