mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
commit
bade5cc81c
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using System.Web.Routing;
|
||||
using ClaySharp.Implementation;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
@ -100,6 +101,7 @@ namespace Orchard.ContentManagement {
|
||||
//var theme = workContext.CurrentTheme;
|
||||
var theme = _themeService.Value.GetRequestTheme(_requestContext);
|
||||
var shapeTable = _shapeTableManager.GetShapeTable(theme.Id);
|
||||
var request = _requestContext.HttpContext.Request;
|
||||
|
||||
ShapeDescriptor descriptor;
|
||||
if (shapeTable.Descriptors.TryGetValue(partShapeType, out descriptor)) {
|
||||
@ -107,6 +109,7 @@ namespace Orchard.ContentManagement {
|
||||
ContentType = context.ContentItem.ContentType,
|
||||
DisplayType = displayType,
|
||||
Differentiator = differentiator,
|
||||
Path = request.Path.Substring((request.ApplicationPath ?? "").Length)
|
||||
};
|
||||
var location = descriptor.Placement(placementContext);
|
||||
return location ?? defaultLocation;
|
||||
|
@ -111,5 +111,6 @@ namespace Orchard.DisplayManagement.Descriptors {
|
||||
public string ContentType { get; set; }
|
||||
public string DisplayType { get; set; }
|
||||
public string Differentiator { get; set; }
|
||||
public string Path { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -98,6 +98,12 @@ namespace Orchard.DisplayManagement.Descriptors.ShapePlacementStrategy {
|
||||
return ctx => (ctx.DisplayType ?? "").StartsWith(prefix) && predicate(ctx);
|
||||
}
|
||||
return ctx => (ctx.DisplayType == expression) && predicate(ctx);
|
||||
case "Path":
|
||||
if (expression.EndsWith("*")) {
|
||||
var prefix = expression.Substring(0, expression.Length - 1);
|
||||
return ctx => (ctx.Path ?? "").StartsWith(prefix, StringComparison.OrdinalIgnoreCase) && predicate(ctx);
|
||||
}
|
||||
return ctx => (ctx.Path.Equals(expression, StringComparison.OrdinalIgnoreCase)) && predicate(ctx);
|
||||
}
|
||||
return predicate;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user