mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Remove unused legacy code
--HG-- branch : dev
This commit is contained in:
@@ -24,7 +24,7 @@ namespace Orchard.Blogs.Drivers {
|
||||
return null;
|
||||
|
||||
return shapeHelper.Parts_Blogs_BlogArchives(ContentItem: part.ContentItem, Blog: blog, Archives: _blogPostService.GetArchives(blog));
|
||||
}).Location("Content");
|
||||
});
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(BlogArchivesPart part, dynamic shapeHelper) {
|
||||
|
@@ -7,7 +7,7 @@ namespace Orchard.Search.Drivers {
|
||||
|
||||
protected override DriverResult Display(SearchFormPart part, string displayType, dynamic shapeHelper) {
|
||||
var model = new SearchViewModel();
|
||||
return ContentShape("Parts_Search_SearchForm", "Content:1",
|
||||
return ContentShape("Parts_Search_SearchForm",
|
||||
() => {
|
||||
var shape = shapeHelper.Parts_Search_SearchForm();
|
||||
shape.ContentPart = part;
|
||||
|
@@ -1,3 +1,4 @@
|
||||
<Placement>
|
||||
<Place Parts_Search_SiteSettings="Content:1"/>
|
||||
<Place Parts_Search_SearchForm="Content:1"/>
|
||||
</Placement>
|
||||
|
@@ -49,23 +49,15 @@ namespace Orchard.ContentManagement.Drivers {
|
||||
protected virtual DriverResult Editor(ContentPart part, TField field, IUpdateModel updater, dynamic shapeHelper) { return null; }
|
||||
|
||||
public ContentShapeResult ContentShape(string shapeType, Func<dynamic> factory) {
|
||||
return ContentShapeImplementation(shapeType, null, ctx => factory());
|
||||
}
|
||||
|
||||
public ContentShapeResult ContentShape(string shapeType, string defaultLocation, Func<dynamic> factory) {
|
||||
return ContentShapeImplementation(shapeType, defaultLocation, ctx => factory());
|
||||
return ContentShapeImplementation(shapeType, ctx => factory());
|
||||
}
|
||||
|
||||
public ContentShapeResult ContentShape(string shapeType, Func<dynamic, dynamic> factory) {
|
||||
return ContentShapeImplementation(shapeType, null, ctx=>factory(CreateShape(ctx, shapeType)));
|
||||
return ContentShapeImplementation(shapeType, ctx=>factory(CreateShape(ctx, shapeType)));
|
||||
}
|
||||
|
||||
public ContentShapeResult ContentShape(string shapeType, string defaultLocation, Func<dynamic, dynamic> factory) {
|
||||
return ContentShapeImplementation(shapeType, defaultLocation, factory);
|
||||
}
|
||||
|
||||
private ContentShapeResult ContentShapeImplementation(string shapeType, string defaultLocation, Func<BuildShapeContext, object> shapeBuilder) {
|
||||
return new ContentShapeResult(shapeType, Prefix, shapeBuilder).Location(defaultLocation);
|
||||
private ContentShapeResult ContentShapeImplementation(string shapeType, Func<BuildShapeContext, object> shapeBuilder) {
|
||||
return new ContentShapeResult(shapeType, Prefix, shapeBuilder);
|
||||
}
|
||||
|
||||
private object CreateShape(BuildShapeContext context, string shapeType) {
|
||||
|
@@ -7,7 +7,6 @@ using Orchard.DisplayManagement;
|
||||
namespace Orchard.ContentManagement.Drivers {
|
||||
public abstract class ContentPartDriver<TContent> : IContentPartDriver where TContent : ContentPart, new() {
|
||||
protected virtual string Prefix { get { return ""; } }
|
||||
protected virtual string Zone { get { return "Content"; } }
|
||||
|
||||
DriverResult IContentPartDriver.BuildDisplay(BuildDisplayContext context) {
|
||||
var part = context.ContentItem.As<TContent>();
|
||||
@@ -30,27 +29,19 @@ namespace Orchard.ContentManagement.Drivers {
|
||||
|
||||
[Obsolete("Provided while transitioning to factory variations")]
|
||||
public ContentShapeResult ContentShape(IShape shape) {
|
||||
return ContentShapeImplementation(shape.Metadata.Type, Zone, ctx => shape);
|
||||
return ContentShapeImplementation(shape.Metadata.Type, ctx => shape).Location("Content");
|
||||
}
|
||||
|
||||
public ContentShapeResult ContentShape(string shapeType, Func<dynamic> factory) {
|
||||
return ContentShapeImplementation(shapeType, null, ctx => factory());
|
||||
}
|
||||
|
||||
public ContentShapeResult ContentShape(string shapeType, string defaultLocation, Func<dynamic> factory) {
|
||||
return ContentShapeImplementation(shapeType, defaultLocation, ctx => factory());
|
||||
return ContentShapeImplementation(shapeType, ctx => factory());
|
||||
}
|
||||
|
||||
public ContentShapeResult ContentShape(string shapeType, Func<dynamic, dynamic> factory) {
|
||||
return ContentShapeImplementation(shapeType, null, ctx => factory(CreateShape(ctx, shapeType)));
|
||||
return ContentShapeImplementation(shapeType, ctx => factory(CreateShape(ctx, shapeType)));
|
||||
}
|
||||
|
||||
public ContentShapeResult ContentShape(string shapeType, string defaultLocation, Func<dynamic, dynamic> factory) {
|
||||
return ContentShapeImplementation(shapeType, defaultLocation, ctx => factory(CreateShape(ctx, shapeType)));
|
||||
}
|
||||
|
||||
private ContentShapeResult ContentShapeImplementation(string shapeType, string defaultLocation, Func<BuildShapeContext, object> shapeBuilder) {
|
||||
return new ContentShapeResult(shapeType, Prefix, shapeBuilder).Location(defaultLocation);
|
||||
private ContentShapeResult ContentShapeImplementation(string shapeType, Func<BuildShapeContext, object> shapeBuilder) {
|
||||
return new ContentShapeResult(shapeType, Prefix, shapeBuilder);
|
||||
}
|
||||
|
||||
private object CreateShape(BuildShapeContext context, string shapeType) {
|
||||
|
@@ -49,16 +49,5 @@ namespace Orchard.ContentManagement.Drivers {
|
||||
_defaultLocation = zone;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ContentShapeResult Location(string zone, string position) {
|
||||
_defaultLocation = zone + ":" + position;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ContentShapeResult Location(ContentLocation location) {
|
||||
return location.Position == null
|
||||
? Location(location.Zone)
|
||||
: Location(location.Zone, location.Position);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user