/// <summary> /// Page load /// </summary> protected override void OnInit(EventArgs e) { FormEngineUserControl label = LoadUserControl("~/CMSFormControls/Basic/LabelControl.ascx") as FormEngineUserControl; if (label != null) { label.Value = GetString("validation.accessibility.standard"); } // Add validation standard FormEngineUserControl standard = LoadUserControl("~/CMSFormControls/Basic/DropDownListControl.ascx") as FormEngineUserControl; if (standard != null) { mStandardList = standard.FindControl(standard.InputControlID) as DropDownList; } DataHelper.FillListControlWithEnum(typeof(AccessibilityStandardEnum), mStandardList, "validation.accessibility.standard.", null); // Set default standard value if (!RequestHelper.IsPostBack() && (standard != null)) { standard.Value = AccessibilityStandardCode.FromEnum(AccessibilityStandardEnum.WCAG2_0A); } HeaderActions.AdditionalControls.Add(label); HeaderActions.AdditionalControls.Add(standard); HeaderActions.AdditionalControlsCssClass = "HeaderActionsLabel"; HeaderActions.ReloadAdditionalControls(); }
/// <summary> /// Page load /// </summary> protected override void OnInit(EventArgs e) { FormEngineUserControl label = LoadUserControl("~/CMSFormControls/Basic/LabelControl.ascx") as FormEngineUserControl; if (label != null) { label.Value = GetString("validation.accessibility.standard"); } // Add validation standard FormEngineUserControl standard = LoadUserControl("~/CMSFormControls/Basic/DropDownListControl.ascx") as FormEngineUserControl; if (standard != null) { mStandardList = standard.FindControl(standard.InputControlID) as CMSDropDownList; mStandardList.Attributes.Add("class", "form-control input-width-60"); } ControlsHelper.FillListControlWithEnum <AccessibilityStandardEnum>(mStandardList, "validation.accessibility.standard"); // Set default standard value if (!RequestHelper.IsPostBack() && (standard != null)) { standard.Value = AccessibilityStandardCode.FromEnum(AccessibilityStandardEnum.WCAG2_0A); } HeaderActions.AdditionalControls.Add(label); HeaderActions.AdditionalControls.Add(standard); HeaderActions.AdditionalControlsCssClass = "HeaderActionsLabel control-group-inline"; HeaderActions.ReloadAdditionalControls(); }
/// <summary> /// Add style to the control defined by id. /// </summary> /// <param name="sourceControl">Source control containing the target control</param> /// <param name="id">Id of the target control</param> /// <param name="type">Type of the target control</param> /// <param name="styles">Style of the target control</param> private void SetStyle(FormEngineUserControl sourceControl, string id, string type, string styles) { if (type == "panel") { Panel p = sourceControl.FindControl(id) as Panel; if (p != null) { foreach (string style in styles.Split(';')) { p.Style[style.Split(':')[0].Trim()] = style.Split(':')[1].Trim(); } } } else if (type == "htmlcontrol") { HtmlControl p = sourceControl.FindControl(id) as HtmlControl; if (p != null) { foreach (string style in styles.Split(';')) { p.Style[style.Split(':')[0].Trim()] = style.Split(':')[1].Trim(); } } } }