public static OrchardTagBuilder AddCommonElementAttributes(this OrchardTagBuilder tagBuilder, dynamic shape) { var attributes = GetCommonElementAttributes(shape); tagBuilder.MergeAttributes(attributes); return(tagBuilder); }
public static void AddClientValidationAttributes(this OrchardTagBuilder tagBuilder, IDictionary <string, string> clientAttributes) { foreach (var attribute in clientAttributes) { tagBuilder.Attributes[attribute.Key] = attribute.Value; } }
public void Form(HtmlHelper Html, Action <object> Output, dynamic Display, dynamic Shape, string Method, string Action) { // (todo) design markup OrchardTagBuilder tag = _tagBuilderFactory.Create(Shape, "form"); tag.MergeAttribute("action", Action ?? Html.ViewContext.HttpContext.Request.Url.PathAndQuery); tag.MergeAttribute("method", Method ?? "POST"); Output(tag.ToString(TagRenderMode.StartTag)); foreach (var item in Ordered(Shape.Items)) { Output(Display(item)); } Output(tag.ToString(TagRenderMode.EndTag)); }
public OrchardTagBuilder Create(dynamic shape, string tagName) { // Identical to supressed version except following line looks for a tag name in the shape: var tagBuilder = new OrchardTagBuilder(shape.TagName == null ? tagName : (string)shape.TagName); tagBuilder.MergeAttributes(shape.Attributes, false); foreach (var cssClass in shape.Classes ?? Enumerable.Empty <string>()) { tagBuilder.AddCssClass(cssClass); } if (!string.IsNullOrEmpty(shape.Id)) { tagBuilder.GenerateId(shape.Id); } return(tagBuilder); }
public void Fieldset(Action <object> Output, dynamic Display, dynamic Shape, object Title) { // (todo) design markup OrchardTagBuilder tag = _tagBuilderFactory.Create(Shape, "fieldset"); Output(tag.ToString(TagRenderMode.StartTag)); if (Title != null) { Output("<legend>"); Output(Display(Title)); Output("</legend>"); } foreach (var item in Ordered(Shape.Items)) { Output(Display(item)); } Output(tag.ToString(TagRenderMode.EndTag)); }