Adding Raw and Shape layouts

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2013-06-13 10:29:55 +02:00
parent 0318475c49
commit 715e4935e9
6 changed files with 326 additions and 0 deletions

View File

@@ -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);
}
}
}