Making progress on updating the content manager API fit better with the new dynamic UI composition scheme

- Includes changing display-related implementations (drivers & views) to work with shapes
- Editor implementations still on the old template model
- Orchard.Blogs is currently using a different display type instead of specifying alterations (for Blog and BlogPost)

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-10-11 02:06:01 -07:00
parent b7c3ada825
commit ddca57edd4
128 changed files with 635 additions and 454 deletions

View File

@@ -35,19 +35,21 @@ namespace Orchard.Core.Common.Drivers {
public Localizer T { get; set; }
public IOrchardServices Services { get; set; }
protected override DriverResult Display(CommonPart part, string displayType) {
return ContentPartTemplate(new CommonMetadataViewModel(part), "Parts/Common.Metadata")
.LongestMatch(displayType, "Summary", "SummaryAdmin")
.Location(part.GetLocation(displayType));
protected override DriverResult Display(CommonPart part, string displayType, dynamic shapeHelper) {
var metadata = shapeHelper.Common_Metadata(ContentPart: part);
if (!string.IsNullOrWhiteSpace(displayType))
metadata.Metadata.Type = string.Format("{0}.{1}", metadata.Metadata.Type, displayType);
var location = part.GetLocation(displayType);
return ContentShape(metadata).Location(location);
}
protected override DriverResult Editor(CommonPart part) {
protected override DriverResult Editor(CommonPart part, dynamic shapeHelper) {
return Combined(
OwnerEditor(part, null),
ContainerEditor(part, null));
}
protected override DriverResult Editor(CommonPart instance, ContentManagement.IUpdateModel updater) {
protected override DriverResult Editor(CommonPart instance, IUpdateModel updater, dynamic shapeHelper) {
// this event is hooked so the modified timestamp is changed when an edit-post occurs.
instance.ModifiedUtc = _clock.UtcNow;
instance.VersionModifiedUtc = _clock.UtcNow;