mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +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 null;
|
||||||
|
|
||||||
return shapeHelper.Parts_Blogs_BlogArchives(ContentItem: part.ContentItem, Blog: blog, Archives: _blogPostService.GetArchives(blog));
|
return shapeHelper.Parts_Blogs_BlogArchives(ContentItem: part.ContentItem, Blog: blog, Archives: _blogPostService.GetArchives(blog));
|
||||||
}).Location("Content");
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override DriverResult Editor(BlogArchivesPart part, dynamic shapeHelper) {
|
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) {
|
protected override DriverResult Display(SearchFormPart part, string displayType, dynamic shapeHelper) {
|
||||||
var model = new SearchViewModel();
|
var model = new SearchViewModel();
|
||||||
return ContentShape("Parts_Search_SearchForm", "Content:1",
|
return ContentShape("Parts_Search_SearchForm",
|
||||||
() => {
|
() => {
|
||||||
var shape = shapeHelper.Parts_Search_SearchForm();
|
var shape = shapeHelper.Parts_Search_SearchForm();
|
||||||
shape.ContentPart = part;
|
shape.ContentPart = part;
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
<Placement>
|
<Placement>
|
||||||
<Place Parts_Search_SiteSettings="Content:1"/>
|
<Place Parts_Search_SiteSettings="Content:1"/>
|
||||||
|
<Place Parts_Search_SearchForm="Content:1"/>
|
||||||
</Placement>
|
</Placement>
|
||||||
|
@@ -49,23 +49,15 @@ namespace Orchard.ContentManagement.Drivers {
|
|||||||
protected virtual DriverResult Editor(ContentPart part, TField field, IUpdateModel updater, dynamic shapeHelper) { return null; }
|
protected virtual DriverResult Editor(ContentPart part, TField field, IUpdateModel updater, dynamic shapeHelper) { return null; }
|
||||||
|
|
||||||
public ContentShapeResult ContentShape(string shapeType, Func<dynamic> factory) {
|
public ContentShapeResult ContentShape(string shapeType, Func<dynamic> factory) {
|
||||||
return ContentShapeImplementation(shapeType, null, ctx => factory());
|
return ContentShapeImplementation(shapeType, ctx => factory());
|
||||||
}
|
|
||||||
|
|
||||||
public ContentShapeResult ContentShape(string shapeType, string defaultLocation, Func<dynamic> factory) {
|
|
||||||
return ContentShapeImplementation(shapeType, defaultLocation, ctx => factory());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContentShapeResult ContentShape(string shapeType, Func<dynamic, dynamic> 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) {
|
private ContentShapeResult ContentShapeImplementation(string shapeType, Func<BuildShapeContext, object> shapeBuilder) {
|
||||||
return ContentShapeImplementation(shapeType, defaultLocation, factory);
|
return new ContentShapeResult(shapeType, Prefix, shapeBuilder);
|
||||||
}
|
|
||||||
|
|
||||||
private ContentShapeResult ContentShapeImplementation(string shapeType, string defaultLocation, Func<BuildShapeContext, object> shapeBuilder) {
|
|
||||||
return new ContentShapeResult(shapeType, Prefix, shapeBuilder).Location(defaultLocation);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private object CreateShape(BuildShapeContext context, string shapeType) {
|
private object CreateShape(BuildShapeContext context, string shapeType) {
|
||||||
|
@@ -7,7 +7,6 @@ using Orchard.DisplayManagement;
|
|||||||
namespace Orchard.ContentManagement.Drivers {
|
namespace Orchard.ContentManagement.Drivers {
|
||||||
public abstract class ContentPartDriver<TContent> : IContentPartDriver where TContent : ContentPart, new() {
|
public abstract class ContentPartDriver<TContent> : IContentPartDriver where TContent : ContentPart, new() {
|
||||||
protected virtual string Prefix { get { return ""; } }
|
protected virtual string Prefix { get { return ""; } }
|
||||||
protected virtual string Zone { get { return "Content"; } }
|
|
||||||
|
|
||||||
DriverResult IContentPartDriver.BuildDisplay(BuildDisplayContext context) {
|
DriverResult IContentPartDriver.BuildDisplay(BuildDisplayContext context) {
|
||||||
var part = context.ContentItem.As<TContent>();
|
var part = context.ContentItem.As<TContent>();
|
||||||
@@ -30,27 +29,19 @@ namespace Orchard.ContentManagement.Drivers {
|
|||||||
|
|
||||||
[Obsolete("Provided while transitioning to factory variations")]
|
[Obsolete("Provided while transitioning to factory variations")]
|
||||||
public ContentShapeResult ContentShape(IShape shape) {
|
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) {
|
public ContentShapeResult ContentShape(string shapeType, Func<dynamic> factory) {
|
||||||
return ContentShapeImplementation(shapeType, null, ctx => factory());
|
return ContentShapeImplementation(shapeType, ctx => factory());
|
||||||
}
|
|
||||||
|
|
||||||
public ContentShapeResult ContentShape(string shapeType, string defaultLocation, Func<dynamic> factory) {
|
|
||||||
return ContentShapeImplementation(shapeType, defaultLocation, ctx => factory());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContentShapeResult ContentShape(string shapeType, Func<dynamic, dynamic> 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) {
|
private ContentShapeResult ContentShapeImplementation(string shapeType, Func<BuildShapeContext, object> shapeBuilder) {
|
||||||
return ContentShapeImplementation(shapeType, defaultLocation, ctx => factory(CreateShape(ctx, shapeType)));
|
return new ContentShapeResult(shapeType, Prefix, shapeBuilder);
|
||||||
}
|
|
||||||
|
|
||||||
private ContentShapeResult ContentShapeImplementation(string shapeType, string defaultLocation, Func<BuildShapeContext, object> shapeBuilder) {
|
|
||||||
return new ContentShapeResult(shapeType, Prefix, shapeBuilder).Location(defaultLocation);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private object CreateShape(BuildShapeContext context, string shapeType) {
|
private object CreateShape(BuildShapeContext context, string shapeType) {
|
||||||
|
@@ -49,16 +49,5 @@ namespace Orchard.ContentManagement.Drivers {
|
|||||||
_defaultLocation = zone;
|
_defaultLocation = zone;
|
||||||
return this;
|
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