mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Update ShapePlacementParsingStrategy.cs
This commit is contained in:
@@ -107,13 +107,24 @@ namespace Orchard.DisplayManagement.Descriptors.ShapePlacementStrategy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GetShapeType(PlacementShapeLocation shapeLocation, out string shapeType, out string differentiator) {
|
private void GetShapeType(PlacementShapeLocation shapeLocation, out string shapeType, out string differentiator)
|
||||||
|
{
|
||||||
differentiator = "";
|
differentiator = "";
|
||||||
shapeType = shapeLocation.ShapeType;
|
shapeType = shapeLocation.ShapeType;
|
||||||
var dashIndex = shapeType.LastIndexOf("__");
|
var separatorLengh = 2;
|
||||||
if (dashIndex > 0 && dashIndex < shapeType.Length - 2) {
|
var separatorIndex = shapeType.LastIndexOf("__");
|
||||||
differentiator = shapeType.Substring(dashIndex + 2);
|
|
||||||
shapeType = shapeType.Substring(0, dashIndex);
|
var dashIndex = shapeType.LastIndexOf('-');
|
||||||
|
if (dashIndex > separatorIndex)
|
||||||
|
{
|
||||||
|
separatorIndex = dashIndex;
|
||||||
|
separatorLengh = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (separatorIndex > 0 && separatorIndex < shapeType.Length - separatorLengh)
|
||||||
|
{
|
||||||
|
differentiator = shapeType.Substring(separatorIndex + separatorLengh);
|
||||||
|
shapeType = shapeType.Substring(0, separatorIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user