mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 21:13:35 +08:00

Container/containable editor templates appear Container id settable via drop list ContainerPathConstraint of higher priority providing list view --HG-- branch : dev
29 lines
1.1 KiB
C#
29 lines
1.1 KiB
C#
using Orchard.ContentManagement.Drivers;
|
|
using Orchard.ContentManagement.Handlers;
|
|
using Orchard.Core.Containers.Models;
|
|
using Orchard.Data;
|
|
|
|
namespace Orchard.Core.Containers.Drivers {
|
|
public class ContainerPartDriver : ContentPartDriver<ContainerPart> {
|
|
protected override DriverResult Editor(ContainerPart part, dynamic shapeHelper) {
|
|
return Editor(part, null, shapeHelper);
|
|
}
|
|
protected override DriverResult Editor(ContainerPart part, ContentManagement.IUpdateModel updater, dynamic shapeHelper) {
|
|
return ContentShape(
|
|
"Parts_Container_Edit",
|
|
() => {
|
|
if (updater != null)
|
|
updater.TryUpdateModel(part, "Container", null, null);
|
|
|
|
return shapeHelper.EditorTemplate(TemplateName: "Container", Model: part, Prefix: "Container");
|
|
});
|
|
}
|
|
}
|
|
|
|
public class ContainerPartHandler : ContentHandler {
|
|
public ContainerPartHandler(IRepository<ContainerPartRecord> repository) {
|
|
Filters.Add(StorageFilter.For(repository));
|
|
}
|
|
}
|
|
}
|