2010-11-08 15:33:56 -08:00
|
|
|
|
using Orchard.ContentManagement.Drivers;
|
2010-11-08 17:44:43 -08:00
|
|
|
|
using Orchard.ContentManagement.Handlers;
|
2010-11-08 15:33:56 -08:00
|
|
|
|
using Orchard.Core.Containers.Models;
|
2010-11-08 17:44:43 -08:00
|
|
|
|
using Orchard.Data;
|
2010-11-08 15:33:56 -08:00
|
|
|
|
|
|
|
|
|
namespace Orchard.Core.Containers.Drivers {
|
2010-11-08 17:44:43 -08:00
|
|
|
|
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));
|
|
|
|
|
}
|
2010-11-08 15:33:56 -08:00
|
|
|
|
}
|
2010-11-08 17:44:43 -08:00
|
|
|
|
}
|