mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 21:13:35 +08:00
Roughing in Containers module
Container/containable editor templates appear Container id settable via drop list ContainerPathConstraint of higher priority providing list view --HG-- branch : dev
This commit is contained in:
@@ -1,7 +1,28 @@
|
||||
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>{
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user