mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 19:44:02 +08:00
Adding Raw and Shape layouts
--HG-- branch : 1.x
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Localization;
|
||||
|
||||
namespace Orchard.Projections.Providers.Layouts {
|
||||
|
||||
public class ShapeLayoutForms : IFormProvider {
|
||||
protected dynamic Shape { get; set; }
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public ShapeLayoutForms(
|
||||
IShapeFactory shapeFactory) {
|
||||
Shape = shapeFactory;
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
public void Describe(DescribeContext context) {
|
||||
Func<IShapeFactory, object> form =
|
||||
shape => {
|
||||
|
||||
var f = Shape.Form(
|
||||
Id: "ShapeLayout",
|
||||
_Options: Shape.Fieldset(
|
||||
Title: T("Shape options"),
|
||||
_ShapeType: Shape.TextBox(
|
||||
Id: "shape-type", Name: "ShapeType",
|
||||
Title: T("Shape type"),
|
||||
Description: T("The type of the shape which is used for rendering content items."),
|
||||
Classes: new[] { "textMedium", "tokenized" }
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
return f;
|
||||
};
|
||||
|
||||
context.Form("ShapeLayout", form);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user