mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
#5847: Fixed CssClasses import/export.
This commit is contained in:
@@ -80,30 +80,15 @@ namespace Orchard.Widgets.Drivers {
|
||||
return;
|
||||
}
|
||||
|
||||
var title = context.Attribute(part.PartDefinition.Name, "Title");
|
||||
if (title != null) {
|
||||
part.Title = title;
|
||||
}
|
||||
|
||||
var position = context.Attribute(part.PartDefinition.Name, "Position");
|
||||
if (position != null) {
|
||||
part.Position = position;
|
||||
}
|
||||
|
||||
var zone = context.Attribute(part.PartDefinition.Name, "Zone");
|
||||
if (zone != null) {
|
||||
part.Zone = zone;
|
||||
}
|
||||
|
||||
var renderTitle = context.Attribute(part.PartDefinition.Name, "RenderTitle");
|
||||
if (!string.IsNullOrWhiteSpace(renderTitle)) {
|
||||
part.RenderTitle = Convert.ToBoolean(renderTitle);
|
||||
}
|
||||
|
||||
var name = context.Attribute(part.PartDefinition.Name, "Name");
|
||||
if (name != null) {
|
||||
part.Name = name;
|
||||
}
|
||||
context.ImportAttribute(part.PartDefinition.Name, "Title", x => part.Title = x);
|
||||
context.ImportAttribute(part.PartDefinition.Name, "Position", x => part.Position = x);
|
||||
context.ImportAttribute(part.PartDefinition.Name, "Zone", x => part.Zone = x);
|
||||
context.ImportAttribute(part.PartDefinition.Name, "Name", x => part.Name = x);
|
||||
context.ImportAttribute(part.PartDefinition.Name, "Title", x => {
|
||||
if (!String.IsNullOrWhiteSpace(x))
|
||||
part.Title = x;
|
||||
});
|
||||
context.ImportAttribute(part.PartDefinition.Name, "CssClasses", x => part.CssClasses = x);
|
||||
}
|
||||
|
||||
protected override void Exporting(WidgetPart part, ContentManagement.Handlers.ExportContentContext context) {
|
||||
@@ -112,6 +97,7 @@ namespace Orchard.Widgets.Drivers {
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("Zone", part.Zone);
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("RenderTitle", part.RenderTitle);
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("Name", part.Name);
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("CssClasses", part.CssClasses);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user