mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-22 20:13:50 +08:00
#18165: Injecting ContentPart, ContentItem and ContentField properties automatically in any Shape
Work Item: 18165 --HG-- branch : 1.x
This commit is contained in:
@@ -34,12 +34,12 @@ namespace Orchard.Core.Common.Drivers {
|
||||
ContentShape("Parts_Common_Body",
|
||||
() => {
|
||||
var bodyText = _htmlFilters.Aggregate(part.Text, (text, filter) => filter.ProcessContent(text, GetFlavor(part)));
|
||||
return shapeHelper.Parts_Common_Body(ContentPart: part, Html: new HtmlString(bodyText));
|
||||
return shapeHelper.Parts_Common_Body(Html: new HtmlString(bodyText));
|
||||
}),
|
||||
ContentShape("Parts_Common_Body_Summary",
|
||||
() => {
|
||||
var bodyText = _htmlFilters.Aggregate(part.Text, (text, filter) => filter.ProcessContent(text, GetFlavor(part)));
|
||||
return shapeHelper.Parts_Common_Body_Summary(ContentPart: part, Html: new HtmlString(bodyText));
|
||||
return shapeHelper.Parts_Common_Body_Summary(Html: new HtmlString(bodyText));
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@@ -38,11 +38,11 @@ namespace Orchard.Core.Common.Drivers {
|
||||
protected override DriverResult Display(CommonPart part, string displayType, dynamic shapeHelper) {
|
||||
return Combined(
|
||||
ContentShape("Parts_Common_Metadata",
|
||||
() => shapeHelper.Parts_Common_Metadata(ContentPart: part)),
|
||||
() => shapeHelper.Parts_Common_Metadata()),
|
||||
ContentShape("Parts_Common_Metadata_Summary",
|
||||
() => shapeHelper.Parts_Common_Metadata_Summary(ContentPart: part)),
|
||||
() => shapeHelper.Parts_Common_Metadata_Summary()),
|
||||
ContentShape("Parts_Common_Metadata_SummaryAdmin",
|
||||
() => shapeHelper.Parts_Common_Metadata_SummaryAdmin(ContentPart: part))
|
||||
() => shapeHelper.Parts_Common_Metadata_SummaryAdmin())
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,7 @@ namespace Orchard.Core.Common.Drivers {
|
||||
|
||||
protected override DriverResult Display(ContentPart part, TextField field, string displayType, dynamic shapeHelper) {
|
||||
return ContentShape("Fields_Common_Text", GetDifferentiator(field, part),
|
||||
() => shapeHelper.Fields_Common_Text(ContentPart: part, ContentField: field, Name: field.Name, Value: field.Value));
|
||||
() => shapeHelper.Fields_Common_Text(Name: field.Name, Value: field.Value));
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(ContentPart part, TextField field, dynamic shapeHelper) {
|
||||
|
@@ -8,11 +8,11 @@ namespace Orchard.Core.Contents.Drivers {
|
||||
protected override DriverResult Display(ContentPart part, string displayType, dynamic shapeHelper) {
|
||||
return Combined(
|
||||
ContentShape("Parts_Contents_Publish",
|
||||
() => shapeHelper.Parts_Contents_Publish(ContentPart: part)),
|
||||
() => shapeHelper.Parts_Contents_Publish()),
|
||||
ContentShape("Parts_Contents_Publish_Summary",
|
||||
() => shapeHelper.Parts_Contents_Publish_Summary(ContentPart: part)),
|
||||
() => shapeHelper.Parts_Contents_Publish_Summary()),
|
||||
ContentShape("Parts_Contents_Publish_SummaryAdmin",
|
||||
() => shapeHelper.Parts_Contents_Publish_SummaryAdmin(ContentPart: part))
|
||||
() => shapeHelper.Parts_Contents_Publish_SummaryAdmin())
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -50,11 +50,11 @@ namespace Orchard.Core.Routable.Drivers {
|
||||
protected override DriverResult Display(RoutePart part, string displayType, dynamic shapeHelper) {
|
||||
return Combined(
|
||||
ContentShape("Parts_RoutableTitle",
|
||||
() => shapeHelper.Parts_RoutableTitle(ContentPart: part, Title: part.Title, Path: part.Path)),
|
||||
() => shapeHelper.Parts_RoutableTitle(Title: part.Title, Path: part.Path)),
|
||||
ContentShape("Parts_RoutableTitle_Summary",
|
||||
() => shapeHelper.Parts_RoutableTitle_Summary(ContentPart: part, Title: part.Title, Path: part.Path)),
|
||||
() => shapeHelper.Parts_RoutableTitle_Summary(Title: part.Title, Path: part.Path)),
|
||||
ContentShape("Parts_RoutableTitle_SummaryAdmin",
|
||||
() => shapeHelper.Parts_RoutableTitle_SummaryAdmin(ContentPart: part, Title: part.Title, Path: part.Path))
|
||||
() => shapeHelper.Parts_RoutableTitle_SummaryAdmin(Title: part.Title, Path: part.Path))
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -18,11 +18,11 @@ namespace Orchard.Core.Title.Drivers {
|
||||
protected override DriverResult Display(TitlePart part, string displayType, dynamic shapeHelper) {
|
||||
return Combined(
|
||||
ContentShape("Parts_Title",
|
||||
() => shapeHelper.Parts_Title(ContentPart: part, Title: part.Title)),
|
||||
() => shapeHelper.Parts_Title(Title: part.Title)),
|
||||
ContentShape("Parts_Title_Summary",
|
||||
() => shapeHelper.Parts_Title_Summary(ContentPart: part, Title: part.Title)),
|
||||
() => shapeHelper.Parts_Title_Summary(Title: part.Title)),
|
||||
ContentShape("Parts_Title_SummaryAdmin",
|
||||
() => shapeHelper.Parts_Title_SummaryAdmin(ContentPart: part, Title: part.Title))
|
||||
() => shapeHelper.Parts_Title_SummaryAdmin(Title: part.Title))
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user