mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-07-15 14:46:12 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
commit
cb1b29ff8f
@ -232,7 +232,7 @@ namespace Orchard.Core.Contents.Controllers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public ActionResult Publish(int id) {
|
public ActionResult Publish(int id, string returnUrl) {
|
||||||
if (!Services.Authorizer.Authorize(Permissions.PublishContent, T("Couldn't publish content")))
|
if (!Services.Authorizer.Authorize(Permissions.PublishContent, T("Couldn't publish content")))
|
||||||
return new HttpUnauthorizedResult();
|
return new HttpUnauthorizedResult();
|
||||||
|
|
||||||
@ -244,11 +244,14 @@ namespace Orchard.Core.Contents.Controllers {
|
|||||||
Services.ContentManager.Flush();
|
Services.ContentManager.Flush();
|
||||||
Services.Notifier.Information(T("{0} successfully published.", contentItem.TypeDefinition.DisplayName));
|
Services.Notifier.Information(T("{0} successfully published.", contentItem.TypeDefinition.DisplayName));
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(returnUrl))
|
||||||
|
return Redirect(returnUrl);
|
||||||
|
|
||||||
return RedirectToAction("List");
|
return RedirectToAction("List");
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public ActionResult Unpublish(int id) {
|
public ActionResult Unpublish(int id, string returnUrl) {
|
||||||
if (!Services.Authorizer.Authorize(Permissions.PublishContent, T("Couldn't unpublish content")))
|
if (!Services.Authorizer.Authorize(Permissions.PublishContent, T("Couldn't unpublish content")))
|
||||||
return new HttpUnauthorizedResult();
|
return new HttpUnauthorizedResult();
|
||||||
|
|
||||||
@ -260,6 +263,9 @@ namespace Orchard.Core.Contents.Controllers {
|
|||||||
Services.ContentManager.Flush();
|
Services.ContentManager.Flush();
|
||||||
Services.Notifier.Information(T("{0} successfully unpublished.", contentItem.TypeDefinition.DisplayName));
|
Services.Notifier.Information(T("{0} successfully unpublished.", contentItem.TypeDefinition.DisplayName));
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(returnUrl))
|
||||||
|
return Redirect(returnUrl);
|
||||||
|
|
||||||
return RedirectToAction("List");
|
return RedirectToAction("List");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.Core.Contents.ViewModels.PublishContentViewModel>" %>
|
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.Core.Contents.ViewModels.PublishContentViewModel>" %>
|
||||||
|
<%@ Import Namespace="Orchard.Utility.Extensions" %>
|
||||||
<% // todo: make this all work
|
<% // todo: make this all work
|
||||||
if (Model.HasPublished) { %>
|
if (Model.HasPublished) { %>
|
||||||
<%:Html.ItemDisplayLink(T("View").Text, Model.ContentItem) %><%:T(" | ") %><%
|
<%:Html.ItemDisplayLink(T("View").Text, Model.ContentItem) %><%:T(" | ") %><%
|
||||||
if (Model.HasDraft) { %>
|
if (Model.HasDraft) { %>
|
||||||
<%:Html.Link(T("Publish Draft").Text, Url.Action("Publish", new { area = "Contents", id = Model.ContentItem.Id }), new { itemprop = "PublishUrl UnsafeUrl" })%><%:T(" | ") %><%
|
<%:Html.Link(T("Publish Draft").Text, Url.Action("Publish", "Admin", new { area = "Contents", id = Model.ContentItem.Id, returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString() }), new { itemprop = "PublishUrl UnsafeUrl" })%><%:T(" | ") %><%
|
||||||
} %>
|
} %>
|
||||||
<%:Html.Link(T("Unpublish").Text, Url.Action("Unpublish", new { area = "Contents", id = Model.ContentItem.Id }), new { itemprop = "UnpublishUrl UnsafeUrl" })%><%:T(" | ") %><%
|
<%:Html.Link(T("Unpublish").Text, Url.Action("Unpublish", "Admin", new { area = "Contents", id = Model.ContentItem.Id, returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString() }), new { itemprop = "UnpublishUrl UnsafeUrl" })%><%:T(" | ") %><%
|
||||||
}
|
}
|
||||||
else { %>
|
else { %>
|
||||||
<%:Html.Link(T("Publish").Text, Url.Action("Publish", new { area = "Contents", id = Model.ContentItem.Id }), new { itemprop = "PublishUrl UnsafeUrl" })%><%:T(" | ") %><%
|
<%:Html.Link(T("Publish").Text, Url.Action("Publish", "Admin", new { area = "Contents", id = Model.ContentItem.Id, returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString() }), new { itemprop = "PublishUrl UnsafeUrl" })%><%:T(" | ") %><%
|
||||||
} %>
|
} %>
|
@ -235,8 +235,6 @@
|
|||||||
<Content Include="Contents\Views\DisplayTemplates\Parts\Contents.Publish.ascx" />
|
<Content Include="Contents\Views\DisplayTemplates\Parts\Contents.Publish.ascx" />
|
||||||
<Content Include="PublishLater\Views\DisplayTemplates\Parts\PublishLater.Metadata.ascx" />
|
<Content Include="PublishLater\Views\DisplayTemplates\Parts\PublishLater.Metadata.ascx" />
|
||||||
<Content Include="PublishLater\Views\DisplayTemplates\Parts\PublishLater.Metadata.SummaryAdmin.ascx" />
|
<Content Include="PublishLater\Views\DisplayTemplates\Parts\PublishLater.Metadata.SummaryAdmin.ascx" />
|
||||||
<Content Include="PublishLater\Views\DisplayTemplates\Parts\PublishLater.SummaryAdmin.ascx" />
|
|
||||||
<Content Include="PublishLater\Views\DisplayTemplates\Parts\PublishLater.ascx" />
|
|
||||||
<Content Include="Common\Views\EditorTemplates\Fields\Common.TextField.ascx" />
|
<Content Include="Common\Views\EditorTemplates\Fields\Common.TextField.ascx" />
|
||||||
<Content Include="Common\Views\EditorTemplates\Parts\Common.Container.ascx" />
|
<Content Include="Common\Views\EditorTemplates\Parts\Common.Container.ascx" />
|
||||||
<Content Include="Common\Views\EditorTemplates\PlainTextEditor.ascx" />
|
<Content Include="Common\Views\EditorTemplates\PlainTextEditor.ascx" />
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.Core.PublishLater.ViewModels.PublishLaterViewModel>" %>
|
|
||||||
<% // todo: make this all work
|
|
||||||
if (Model.HasPublished) { %>
|
|
||||||
<%:Html.ItemDisplayLink(T("View").Text, Model.ContentItem) %><%:T(" | ") %><%
|
|
||||||
if (Model.HasDraft) { %>
|
|
||||||
<a href="<%:Html.AntiForgeryTokenGetUrl(Url.Action("Publish", new {id = Model.ContentItem.Id})) %>" title="<%:T("Publish Draft") %>"><%:T("Publish Draft") %></a><%:T(" | ") %><%
|
|
||||||
} %>
|
|
||||||
<a href="<%:Html.AntiForgeryTokenGetUrl(Url.Action("Unpublish", new {id = Model.ContentItem.Id})) %>" title="<%:T("Unpublish") %>"><%:T("Unpublish") %></a><%:T(" | ") %><%
|
|
||||||
}
|
|
||||||
else { %>
|
|
||||||
<a href="<%:Html.AntiForgeryTokenGetUrl(Url.Action("Publish", new {id = Model.ContentItem.Id})) %>" title="<%:T("Publish")%>"><%:T("Publish") %></a><%:T(" | ") %><%
|
|
||||||
} %>
|
|
@ -1 +0,0 @@
|
|||||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.Core.PublishLater.ViewModels.PublishLaterViewModel>" %>
|
|
@ -81,7 +81,7 @@
|
|||||||
for (var i = 0; i < queryParts.length; i++) {
|
for (var i = 0; i < queryParts.length; i++) {
|
||||||
var queryPartKVP = queryParts[i].split("=");
|
var queryPartKVP = queryParts[i].split("=");
|
||||||
//trusting hrefs in the page here
|
//trusting hrefs in the page here
|
||||||
form.append($("<input type=\"hidden\" name=\"" + queryPartKVP[0] + "\" value=\"" + queryPartKVP[1] + "\" />"));
|
form.append($("<input type=\"hidden\" name=\"" + decodeURIComponent(queryPartKVP[0]) + "\" value=\"" + decodeURIComponent(queryPartKVP[1]) + "\" />"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
form.css({ "position": "absolute", "left": "-9999em" });
|
form.css({ "position": "absolute", "left": "-9999em" });
|
||||||
|
Loading…
Reference in New Issue
Block a user