mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-24 10:11:35 +08:00
Merge branch 'origin/1.10.x' into dev
This commit is contained in:
@@ -125,6 +125,7 @@ namespace Orchard.Layouts.Providers {
|
||||
var shape = (dynamic)_shapeFactory.Value.Create(shapeType);
|
||||
|
||||
shape.Element = context.Element;
|
||||
shape.SnippetDescriptor = snippetDescriptor;
|
||||
|
||||
if (snippetDescriptor != null) {
|
||||
foreach (var fieldDescriptor in snippetDescriptor.Fields) {
|
||||
|
||||
@@ -11,6 +11,7 @@ using Orchard.PublishLater.Models;
|
||||
using Orchard.PublishLater.Services;
|
||||
using Orchard.PublishLater.ViewModels;
|
||||
using Orchard.Services;
|
||||
using Orchard.Tasks.Scheduling;
|
||||
|
||||
namespace Orchard.PublishLater.Drivers {
|
||||
public class PublishLaterPartDriver : ContentPartDriver<PublishLaterPart> {
|
||||
@@ -19,19 +20,22 @@ namespace Orchard.PublishLater.Drivers {
|
||||
private readonly IPublishLaterService _publishLaterService;
|
||||
private readonly IClock _clock;
|
||||
private readonly IDateLocalizationServices _dateLocalizationServices;
|
||||
private readonly IPublishingTaskManager _publishingTaskManager;
|
||||
|
||||
public PublishLaterPartDriver(
|
||||
IOrchardServices services,
|
||||
IHttpContextAccessor httpContextAccessor,
|
||||
IPublishLaterService publishLaterService,
|
||||
IClock clock,
|
||||
IDateLocalizationServices dateLocalizationServices) {
|
||||
IDateLocalizationServices dateLocalizationServices,
|
||||
IPublishingTaskManager publishingTaskManager) {
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
_publishLaterService = publishLaterService;
|
||||
_clock = clock;
|
||||
_dateLocalizationServices = dateLocalizationServices;
|
||||
T = NullLocalizer.Instance;
|
||||
Services = services;
|
||||
_publishingTaskManager = publishingTaskManager;
|
||||
}
|
||||
|
||||
public Localizer T {
|
||||
@@ -105,6 +109,9 @@ namespace Orchard.PublishLater.Drivers {
|
||||
}
|
||||
}
|
||||
|
||||
if (httpContext.Request.Form["submit.Save"] == "submit.CancelPublishLaterTasks") {
|
||||
_publishingTaskManager.DeleteTasks(model.ContentItem);
|
||||
}
|
||||
return ContentShape("Parts_PublishLater_Edit",
|
||||
() => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix));
|
||||
}
|
||||
|
||||
@@ -41,6 +41,9 @@
|
||||
@Html.HiddenFor(m => m.Editor.ShowTime)
|
||||
@Html.EditorFor(m => m.Editor)
|
||||
<button type="submit" name="submit.Save" value="submit.PublishLater">@T("Publish Later")</button>
|
||||
@if (!string.IsNullOrEmpty(Model.Editor.Date)) {
|
||||
<button type="submit" name="submit.Save" value="submit.CancelPublishLaterTasks">@T("Cancel Publish Later")</button>
|
||||
}
|
||||
</fieldset>
|
||||
|
||||
using (Script.Foot()) {
|
||||
|
||||
Reference in New Issue
Block a user