/// <summary> /// Creates the HTML controls required to configure this type of field /// </summary> /// <returns></returns> public override List <Control> ConfigurationControls() { var controls = base.ConfigurationControls(); var tbName = new RockTextBox(); controls.Add(tbName); tbName.AutoPostBack = true; tbName.TextChanged += OnQualifierUpdated; tbName.Label = "Name"; tbName.Help = "The name of the socal media network."; var tbIconCssClass = new RockTextBox(); controls.Add(tbIconCssClass); tbIconCssClass.AutoPostBack = true; tbIconCssClass.TextChanged += OnQualifierUpdated; tbIconCssClass.Label = "IconCssClass"; tbIconCssClass.Help = "The icon that represents the social media network."; var cpColor = new ColorPicker(); controls.Add(cpColor); cpColor.AutoPostBack = true; cpColor.TextChanged += OnQualifierUpdated; cpColor.Label = "Color"; cpColor.Help = "The color to use for making buttons for the social media network."; var textTemplate = new CodeEditor(); controls.Add(textTemplate); textTemplate.Label = "Text Template"; textTemplate.AutoPostBack = true; textTemplate.TextChanged += OnQualifierUpdated; textTemplate.EditorMode = CodeEditorMode.Lava; textTemplate.Help = "Lava template to use to create a formatted version for the link. Primarily used for making the link text."; var ulBaseUrl = new UrlLinkBox(); controls.Add(ulBaseUrl); ulBaseUrl.Label = "BaseUrl"; textTemplate.AutoPostBack = true; textTemplate.TextChanged += OnQualifierUpdated; textTemplate.Help = "The base URL for the social media network. If the entry does not have a URL in it this base URL will be prepended to the entered string."; return(controls); }
/// <summary> /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering. /// </summary> protected override void CreateChildControls() { base.CreateChildControls(); Controls.Clear(); tbTitle = new RockTextBox { ID = string.Format("tbTextTitle_{0}", this.ID), TextMode = TextBoxMode.SingleLine, Required = false, Label = "Title", MaxLength = 100 }; Controls.Add(tbTitle); rcwMessage = new RockControlWrapper { ID = string.Format("rcwMessage_{0}", this.ID), Label = "Message", Help = "<span class='tip tip-lava'></span>" }; Controls.Add(rcwMessage); mfpMessage = new MergeFieldPicker { ID = string.Format("mfpMergeFields_{0}", this.ID) }; mfpMessage.MergeFields.Clear(); mfpMessage.MergeFields.Add("GlobalAttribute"); mfpMessage.MergeFields.Add("Rock.Model.Person"); mfpMessage.CssClass += " pull-right margin-b-sm"; mfpMessage.SelectItem += mfpMergeFields_SelectItem; rcwMessage.Controls.Add(mfpMessage); lblCount = new Label { CssClass = "badge margin-all-sm pull-right", ID = $"{nameof( lblCount )}_{ID}" }; rcwMessage.Controls.Add(lblCount); tbMessage = new RockTextBox { ID = string.Format("tbTextMessage_{0}", this.ID), TextMode = TextBoxMode.MultiLine, Rows = 3 }; rcwMessage.Controls.Add(tbMessage); iupPushImage = new ImageUploader { ID = $"{nameof( iupPushImage )}_{ID}", Label = "Image", Help = "We recommend an image size of 1038x520.", Visible = false // Images aren't used during push yet, so don't show. }; rcwMessage.Controls.Add(iupPushImage); rbOpenAction = CreateOpenActionRadioList(); rcwMessage.Controls.Add(rbOpenAction); ddlMobileApplications = CreateMobileApplicationDropDownList(); rcwMessage.Controls.Add(ddlMobileApplications); htmlAdditionalDetails = new HtmlEditor { ID = $"{nameof( htmlAdditionalDetails )}_{ID}", Label = "Additional Details", Height = 300 }; rcwMessage.Controls.Add(htmlAdditionalDetails); ppMobilePage = new PagePicker { ID = $"{nameof( ppMobilePage )}_{ID}", Label = "Mobile Page" }; rcwMessage.Controls.Add(ppMobilePage); kvlQuerystring = new KeyValueList { ID = $"{nameof( kvlQuerystring )}_{ID}", Label = "Mobile Page Query String", KeyPrompt = "Key", ValuePrompt = "Value" }; rcwMessage.Controls.Add(kvlQuerystring); urlLink = new UrlLinkBox { ID = $"{nameof( urlLink )}_{ID}", Label = "URL" }; rcwMessage.Controls.Add(urlLink); }