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:
Louis DeJardin
2010-11-08 17:44:43 -08:00
parent ecdb058802
commit 5673576425
13 changed files with 216 additions and 11 deletions

View File

@@ -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));
}
}
}