mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-26 12:03:16 +08:00
Implemented collapsible columns.
This commit is contained in:
@@ -41,7 +41,7 @@ namespace Orchard.Layouts.Providers {
|
||||
EnableEditorDialog = false,
|
||||
IsSystemElement = false,
|
||||
CreatingDisplay = creatingDisplayContext => CreatingDisplay(creatingDisplayContext, blueprint),
|
||||
Display = displayContext => Displaying(displayContext, baseElement),
|
||||
Displaying = displayContext => Displaying(displayContext, baseElement),
|
||||
StateBag = new Dictionary<string, object> {
|
||||
{"Blueprint", true},
|
||||
{"ElementTypeName", baseElement.Descriptor.TypeName}
|
||||
@@ -62,7 +62,7 @@ namespace Orchard.Layouts.Providers {
|
||||
context.Element.Data = bluePrintState;
|
||||
}
|
||||
|
||||
private void Displaying(ElementDisplayContext context, Element element) {
|
||||
private void Displaying(ElementDisplayingContext context, Element element) {
|
||||
var drivers = _elementManager.Value.GetDrivers(element);
|
||||
|
||||
foreach (var driver in drivers) {
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Orchard.Layouts.Providers {
|
||||
var name = String.Format("{0}.{1}", part.Name, field.Name);
|
||||
var displayName = field.DisplayName;
|
||||
yield return new ElementDescriptor(elementType, name, T(displayName), T(field.DisplayName), contentFieldElement.Category) {
|
||||
Display = displayContext => Displaying(displayContext),
|
||||
Displaying = displayContext => Displaying(displayContext),
|
||||
ToolboxIcon = "\uf1b2"
|
||||
};
|
||||
}
|
||||
@@ -68,7 +68,7 @@ namespace Orchard.Layouts.Providers {
|
||||
return fields.Where(t => blackList.All(x => t.Item2.FieldDefinition.Name != x));
|
||||
}
|
||||
|
||||
private void Displaying(ElementDisplayContext context) {
|
||||
private void Displaying(ElementDisplayingContext context) {
|
||||
var contentItem = context.Content.ContentItem;
|
||||
var typeName = context.Element.Descriptor.TypeName;
|
||||
var contentField = contentItem.GetContentField(typeName);
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Orchard.Layouts.Providers {
|
||||
var partDescription = partSettings != null ? partSettings.Description : null;
|
||||
var description = T(!String.IsNullOrWhiteSpace(partDescription) ? partDescription : contentPart.Name);
|
||||
return new ElementDescriptor(elementType, contentPart.Name, T(contentPart.Name.CamelFriendly()), description, contentPartElement.Category) {
|
||||
Display = displayContext => Displaying(displayContext),
|
||||
Displaying = displayContext => Displaying(displayContext),
|
||||
ToolboxIcon = "\uf1b2",
|
||||
StateBag = new Dictionary<string, object> {
|
||||
{"ElementTypeName", contentPart.Name}
|
||||
@@ -60,7 +60,7 @@ namespace Orchard.Layouts.Providers {
|
||||
return parts.Where(p => p.Settings.GetModel<ContentPartLayoutSettings>().Placable);
|
||||
}
|
||||
|
||||
private void Displaying(ElementDisplayContext context) {
|
||||
private void Displaying(ElementDisplayingContext context) {
|
||||
var drivers = _elementManager.Value.GetDrivers(context.Element);
|
||||
|
||||
foreach (var driver in drivers) {
|
||||
|
||||
@@ -49,13 +49,13 @@ namespace Orchard.Layouts.Providers {
|
||||
var elementName = GetDisplayName(shapeDescriptor.Value.BindingSource);
|
||||
var closureDescriptor = shapeDescriptor;
|
||||
yield return new ElementDescriptor(elementType, shapeType, T(elementName), T("An element that renders the {0} shape.", shapeType), snippetElement.Category) {
|
||||
Display = displayContext => Displaying(displayContext, closureDescriptor.Value),
|
||||
Displaying = displayContext => Displaying(displayContext, closureDescriptor.Value),
|
||||
ToolboxIcon = "\uf10c"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private void Displaying(ElementDisplayContext context, ShapeDescriptor shapeDescriptor) {
|
||||
private void Displaying(ElementDisplayingContext context, ShapeDescriptor shapeDescriptor) {
|
||||
var shapeType = shapeDescriptor.ShapeType;
|
||||
var shape = _shapeFactory.Value.Create(shapeType);
|
||||
context.ElementShape.Snippet = shape;
|
||||
|
||||
Reference in New Issue
Block a user