/// <summary> /// Initializes a new instance of the <see cref="Email" /> class. /// </summary> public Sms() { ddlFrom = new RockDropDownList(); ddlFrom.BindToDefinedType( DefinedTypeCache.Read( new Guid( Rock.SystemGuid.DefinedType.COMMUNICATION_SMS_FROM ) ) ); tbTextMessage = new RockTextBox(); }
/// <summary> /// Creates the child controls. /// </summary> /// <returns></returns> public override Control[] CreateChildControls(Type entityType, FilterField filterControl) { RockTextBox tbTicketClass = new RockTextBox(); tbTicketClass.ID = filterControl.ID + "_tbTicketClass"; tbTicketClass.Label = "Eventbrite Ticket Class"; filterControl.Controls.Add(tbTicketClass); return(new Control[] { tbTicketClass }); }
/// <summary> /// Gets the filter value control with the specified FilterMode /// </summary> /// <param name="configurationValues">The configuration values.</param> /// <param name="id">The identifier.</param> /// <param name="required">if set to <c>true</c> [required].</param> /// <param name="filterMode">The filter mode.</param> /// <returns></returns> public override Control FilterValueControl(Dictionary <string, ConfigurationValue> configurationValues, string id, bool required, FilterMode filterMode) { var control = new RockTextBox { ID = id }; control.ID = string.Format("{0}_ctlCompareValue", id); control.AddCssClass("js-filter-control"); return(control); }
/// <summary> /// Creates the child controls. /// </summary> /// <returns></returns> public override Control[] CreateChildControls(Type entityType, FilterField filterControl) { ddlInteractionChannel = new RockDropDownList(); ddlInteractionChannel.ID = filterControl.ID + "_ddlInteractionChannel"; ddlInteractionChannel.Label = "Interaction Channel"; ddlInteractionChannel.CssClass = "js-interaction-channel"; ddlInteractionChannel.Required = true; ddlInteractionChannel.AutoPostBack = true; ddlInteractionChannel.EnhanceForLongLists = true; ddlInteractionChannel.SelectedIndexChanged += ddlInteractionChannel_SelectedIndexChanged; filterControl.Controls.Add(ddlInteractionChannel); var interactionChannelService = new InteractionChannelService(new RockContext()); var interactionChannels = interactionChannelService.Queryable().OrderBy(a => a.Name).Select(a => new { a.Id, a.Name }).ToList(); ddlInteractionChannel.Items.Clear(); ddlInteractionChannel.Items.Add(new ListItem()); ddlInteractionChannel.Items.AddRange(interactionChannels.Select(a => new ListItem(a.Name, a.Id.ToString())).ToArray()); int?selectedInteractionChannelId = filterControl.Page.Request.Params[ddlInteractionChannel.UniqueID].AsIntegerOrNull(); ddlInteractionChannel.SetValue(selectedInteractionChannelId); ddlInteractionComponent = new RockDropDownList(); ddlInteractionComponent.ID = filterControl.ID + "_ddlInteractionComponent"; ddlInteractionComponent.Label = "Interaction Component"; ddlInteractionComponent.CssClass = "js-interaction-component"; ddlInteractionComponent.EnhanceForLongLists = true; filterControl.Controls.Add(ddlInteractionComponent); PopulateInteractionComponent(selectedInteractionChannelId, ddlInteractionComponent); RockTextBox tbOperation = new RockTextBox(); tbOperation.Label = "Operation"; tbOperation.ID = filterControl.ID + "_tbOperation"; tbOperation.CssClass = "js-tbOperation"; filterControl.Controls.Add(tbOperation); SlidingDateRangePicker slidingDateRangePicker = new SlidingDateRangePicker(); slidingDateRangePicker.ID = filterControl.ID + "_slidingDateRangePicker"; slidingDateRangePicker.AddCssClass("js-sliding-date-range"); slidingDateRangePicker.Label = "Date Range"; slidingDateRangePicker.Help = "The date range of the interactions"; filterControl.Controls.Add(slidingDateRangePicker); return(new Control[4] { ddlInteractionChannel, ddlInteractionComponent, tbOperation, slidingDateRangePicker }); }
/// <summary> /// Creates the child controls. /// </summary> /// <returns></returns> public override Control[] CreateChildControls(Type entityType, FilterField filterControl) { var gtpGroupType = new GroupTypePicker(); gtpGroupType.ID = filterControl.ID + "_0"; gtpGroupType.AddCssClass("js-group-type"); filterControl.Controls.Add(gtpGroupType); gtpGroupType.UseGuidAsValue = true; gtpGroupType.GroupTypes = new GroupTypeService(new RockContext()).Queryable().OrderBy(a => a.Name).ToList(); var cbChildGroupTypes = new RockCheckBox(); cbChildGroupTypes.ID = filterControl.ID + "_cbChildGroupTypes"; cbChildGroupTypes.AddCssClass("js-child-group-types"); cbChildGroupTypes.Text = "Include Child Group Types(s)"; filterControl.Controls.Add(cbChildGroupTypes); var ddlIntegerCompare = ComparisonHelper.ComparisonControl(ComparisonHelper.NumericFilterComparisonTypes); ddlIntegerCompare.Label = "Attendance Count"; ddlIntegerCompare.ID = filterControl.ID + "_ddlIntegerCompare"; ddlIntegerCompare.AddCssClass("js-filter-compare"); filterControl.Controls.Add(ddlIntegerCompare); var tbAttendedCount = new RockTextBox(); tbAttendedCount.ID = filterControl.ID + "_2"; tbAttendedCount.Label = " "; // give it whitespace label so it lines up nicely tbAttendedCount.AddCssClass("js-attended-count"); filterControl.Controls.Add(tbAttendedCount); var slidingDateRangePicker = new SlidingDateRangePicker(); slidingDateRangePicker.Label = "Date Range"; slidingDateRangePicker.ID = filterControl.ID + "_slidingDateRangePicker"; slidingDateRangePicker.AddCssClass("js-sliding-date-range"); filterControl.Controls.Add(slidingDateRangePicker); var controls = new Control[5] { gtpGroupType, cbChildGroupTypes, ddlIntegerCompare, tbAttendedCount, slidingDateRangePicker }; // convert pipe to comma delimited var defaultDelimitedValues = slidingDateRangePicker.DelimitedValues.Replace("|", ","); var defaultCount = 4; // set the default values in case this is a newly added filter SetSelection( entityType, controls, string.Format("{0}|{1}|{2}|{3}|false", gtpGroupType.Items.Count > 0 ? gtpGroupType.Items[0].Value : "0", ComparisonType.GreaterThanOrEqualTo.ConvertToInt().ToString(), defaultCount, defaultDelimitedValues)); return(controls); }
/// <summary> /// Reads new values entered by the user for the field (as guid) /// </summary> /// <param name="control">Parent control that controls were added to in the CreateEditControl() method</param> /// <param name="configurationValues">The configuration values.</param> /// <returns></returns> public override string GetEditValue(System.Web.UI.Control control, Dictionary <string, ConfigurationValue> configurationValues) { RockTextBox picker = control as RockTextBox; if (picker != null) { return(picker.Text ?? string.Empty); } return(null); }
/// <summary> /// Initializes a new instance of the <see cref="Email" /> class. /// </summary> public Email() { tbFromName = new RockTextBox(); tbFromAddress = new RockTextBox(); tbReplyToAddress = new RockTextBox(); tbSubject = new RockTextBox(); htmlMessage = new HtmlEditor(); tbTextMessage = new RockTextBox(); hfAttachments = new HiddenField(); fuAttachments = new FileUploader(); }
/// <summary> /// Gets the selection. /// </summary> /// <param name="entityType">Type of the entity.</param> /// <param name="controls">The controls.</param> /// <returns></returns> public override string GetSelection(Type entityType, Control[] controls) { if (controls.Count() >= 2) { RockDropDownList ddlNoteType = controls[0] as RockDropDownList; RockTextBox tbContains = controls[1] as RockTextBox; return($"{ddlNoteType.SelectedValue}|{tbContains.Text}"); } return(string.Empty); }
/// <summary> /// Creates the child controls. /// </summary> /// <returns></returns> public override Control[] CreateChildControls(Type entityType, FilterField filterControl) { var pGroupPicker = new GroupPicker(); pGroupPicker.AllowMultiSelect = true; pGroupPicker.ID = filterControl.ID + "_pGroupPicker"; pGroupPicker.AddCssClass("js-group-picker"); filterControl.Controls.Add(pGroupPicker); var cbChildGroups = new RockCheckBox(); cbChildGroups.ID = filterControl.ID + "_cbChildGroups"; cbChildGroups.AddCssClass("js-child-groups"); cbChildGroups.Text = "Include Child Groups"; filterControl.Controls.Add(cbChildGroups); var ddlIntegerCompare = ComparisonHelper.ComparisonControl(ComparisonHelper.NumericFilterComparisonTypes); ddlIntegerCompare.Label = "Attendance Count"; ddlIntegerCompare.ID = filterControl.ID + "_ddlIntegerCompare"; ddlIntegerCompare.AddCssClass("js-filter-compare"); filterControl.Controls.Add(ddlIntegerCompare); var tbAttendedCount = new RockTextBox(); tbAttendedCount.ID = filterControl.ID + "_2"; tbAttendedCount.Label = " "; // give it whitespace label so it lines up nicely tbAttendedCount.AddCssClass("js-attended-count"); filterControl.Controls.Add(tbAttendedCount); var slidingDateRangePicker = new SlidingDateRangePicker(); slidingDateRangePicker.Label = "Date Range"; slidingDateRangePicker.ID = filterControl.ID + "_slidingDateRangePicker"; slidingDateRangePicker.AddCssClass("js-sliding-date-range"); filterControl.Controls.Add(slidingDateRangePicker); var controls = new Control[5] { pGroupPicker, cbChildGroups, ddlIntegerCompare, tbAttendedCount, slidingDateRangePicker }; // convert pipe to comma delimited var defaultDelimitedValues = slidingDateRangePicker.DelimitedValues.Replace("|", ","); var defaultCount = 4; // set the default values in case this is a newly added filter SetSelection( entityType, controls, string.Format("{0}|{1}|{2}|{3}|false", string.Empty, ComparisonType.GreaterThanOrEqualTo.ConvertToInt().ToString(), defaultCount, defaultDelimitedValues)); return(controls); }
/// <summary>Displays the configuration.</summary> /// <param name="parentControl">The parent control.</param> /// <returns></returns> public virtual List <Control> DisplayConfiguration(Control parentControl) { var controls = new List <Control>(); var textbox = new RockTextBox { Label = "Test" }; parentControl.Controls.Add(textbox); controls.Add(textbox); return(controls); }
/// <summary> /// Creates the HTML controls required to configure this type of field /// </summary> /// <returns></returns> public override List <Control> ConfigurationControls() { List <Control> controls = new List <Control>(); var textBoxGroupPickerLabel = new RockTextBox(); controls.Add(textBoxGroupPickerLabel); textBoxGroupPickerLabel.Label = "Group Picker Label"; textBoxGroupPickerLabel.Help = "The label for the group picker"; return(controls); }
/// <summary> /// Creates the HTML controls required to configure this type of field /// </summary> /// <returns></returns> public override List <Control> ConfigurationControls() { List <Control> controls = new List <Control>(); var tbHelpText = new RockTextBox(); controls.Add(tbHelpText); tbHelpText.Label = "Entity Control Help Text Format"; tbHelpText.Help = "Include a {0} in places where you want the EntityType name (Campus, Group, etc) to be included and a {1} in places where you want the pluralized EntityType name (Campuses, Groups, etc) to be included."; return(controls); }
/// <summary> /// Creates the child controls. /// </summary> /// <param name="parentControl"></param> /// <returns></returns> public override System.Web.UI.Control[] CreateChildControls(System.Web.UI.Control parentControl) { RockDropDownList ddlInteractionChannel = new RockDropDownList(); ddlInteractionChannel.ID = parentControl.ID + "_ddlInteractionChannel"; ddlInteractionChannel.Label = "Interaction Channel"; ddlInteractionChannel.Required = true; ddlInteractionChannel.AutoPostBack = true; ddlInteractionChannel.SelectedIndexChanged += ddlInteractionChannel_SelectedIndexChanged; parentControl.Controls.Add(ddlInteractionChannel); var interactionChannelService = new InteractionChannelService(new RockContext()); var noteTypes = interactionChannelService.Queryable().OrderBy(a => a.Name).Select(a => new { a.Id, a.Name }).ToList(); ddlInteractionChannel.Items.Clear(); ddlInteractionChannel.Items.Add(new ListItem()); ddlInteractionChannel.Items.AddRange(noteTypes.Select(a => new ListItem(a.Name, a.Id.ToString())).ToArray()); int?selectedInteractionChannelId = parentControl.Page.Request.Params[ddlInteractionChannel.UniqueID].AsIntegerOrNull(); ddlInteractionChannel.SetValue(selectedInteractionChannelId); RockDropDownList ddlInteractionComponent = new RockDropDownList(); ddlInteractionComponent.ID = parentControl.ID + "_ddlInteractionComponent"; ddlInteractionComponent.Label = "Interaction Component"; ddlInteractionComponent.EnhanceForLongLists = true; parentControl.Controls.Add(ddlInteractionComponent); PopulateInteractionComponent(selectedInteractionChannelId, ddlInteractionComponent); RockTextBox tbOperation = new RockTextBox(); tbOperation.Label = "Operation"; tbOperation.ID = parentControl.ID + "_tbOperation"; parentControl.Controls.Add(tbOperation); RockRadioButtonList rblSelectionMode = new RockRadioButtonList(); rblSelectionMode.ID = parentControl.ID + "rblSelectionMode"; rblSelectionMode.Label = "Selection Mode"; rblSelectionMode.BindToEnum <FirstLastInteraction>(); rblSelectionMode.SetValue(FirstLastInteraction.First.ConvertToInt()); parentControl.Controls.Add(rblSelectionMode); return(new System.Web.UI.Control[] { ddlInteractionChannel, ddlInteractionComponent, tbOperation, rblSelectionMode }); }
/// <summary> /// Creates the control(s) necessary for prompting user for a new value /// </summary> /// <param name="configurationValues">The configuration values.</param> /// <param name="id">The id.</param> /// <returns> /// The control /// </returns> public override Control EditControl( Dictionary<string, ConfigurationValue> configurationValues, string id ) { RockTextBox tb = base.EditControl( configurationValues, id ) as RockTextBox; if ( configurationValues != null && configurationValues.ContainsKey( IS_PASSWORD_KEY ) && configurationValues[IS_PASSWORD_KEY].Value.AsBoolean() ) { tb.TextMode = TextBoxMode.Password; } return tb; }
public override void ConfigureCoursePage(CoursePage coursePage, List <Control> controls) { if (controls.Count > 0) { RockTextBox embedCode = ( RockTextBox )controls[0]; coursePage.Configuration = embedCode.Text; } if (controls.Count > 1) { RockTextBox percentRequired = ( RockTextBox )controls[1]; coursePage.PassingScore = percentRequired.Text.AsInteger(); } }
/// <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 tb = new RockTextBox(); controls.Add(tb); tb.AutoPostBack = true; tb.TextChanged += OnQualifierUpdated; tb.Label = "Container Assembly Name"; tb.Help = "The assembly name of the MEF container to show components of."; return(controls); }
public override void ConfigureControls(CoursePage coursePage, List <Control> controls) { if (controls.Count > 0) { RockTextBox embedCode = ( RockTextBox )controls[0]; embedCode.Text = coursePage.Configuration; } if (controls.Count > 1) { RockTextBox percentRequired = ( RockTextBox )controls[1]; percentRequired.Text = coursePage.PassingScore.ToString(); } }
/// <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 tbKeyPrompt = new RockTextBox(); controls.Insert(0, tbKeyPrompt); tbKeyPrompt.AutoPostBack = true; tbKeyPrompt.TextChanged += OnQualifierUpdated; tbKeyPrompt.Label = "Key Prompt"; tbKeyPrompt.Help = "The text to display as a prompt in the key textbox."; return(controls); }
public void InstantiateIn(Control container) { switch (_type) { case ListItemType.Item: case ListItemType.AlternatingItem: HiddenField hfBucketId = new HiddenField(); hfBucketId.ID = "hfBucketId"; HiddenField hfSortOrder = new HiddenField(); hfSortOrder.ID = "hfSortOrder"; Panel bucketPanel = new Panel(); bucketPanel.ID = "pnlBucket"; bucketPanel.AddCssClass("sccDvvFilterSection"); bucketPanel.Attributes.Add("ondragover", "dragover_handler(event)"); bucketPanel.Attributes.Add("ondrop", "drop_handler(event)"); bucketPanel.Controls.Add(hfBucketId); bucketPanel.Controls.Add(hfSortOrder); // Title Bar bucketPanel.Controls.Add(new LiteralControl(@"<div class='sccDvvFilterSection_title'> <div class='reorder' draggable='true' ondragstart='dragstart_handler(event)' style='padding-right: 15px;'> <i class='fa fa-bars'></i> </div>")); Literal lBucketName = new Literal(); lBucketName.ID = "lBucketName"; bucketPanel.Controls.Add(lBucketName); bucketPanel.Controls.Add(new LiteralControl("</div>")); bucketPanel.Controls.Add(new LiteralControl(@"<div class='row js-filterconfig-row'> <div class='col-md-4'>")); // Content RockTextBox tbDisplayName = new RockTextBox(); tbDisplayName.ID = "tbDisplayName"; tbDisplayName.Label = "DisplayAs"; tbDisplayName.CssClass = "js-settings-pre-html"; tbDisplayName.Help = "The name to show for the bucket"; tbDisplayName.ValidateRequestMode = ValidateRequestMode.Disabled; bucketPanel.Controls.Add(tbDisplayName); bucketPanel.Controls.Add(new LiteralControl("</div></div>")); container.Controls.Add(bucketPanel); break; } }
private void LoadValuesFromPage() { foreach (var item in rptBucketRepeater.Items.OfType <RepeaterItem>()) { HiddenField BucketId = item.FindControl("hfBucketId") as HiddenField; HiddenField BucketOrder = item.FindControl("hfSortOrder") as HiddenField; RockTextBox tbDisplayName = item.FindControl("tbDisplayName") as RockTextBox; Bucket thisBucket = _buckets.Find((b) => b.Id == BucketId.ValueAsInt()); thisBucket.DisplayAs = tbDisplayName.Text; thisBucket.Order = Int32.Parse(BucketOrder.Value); } }
/// <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(); RockControlHelper.CreateChildControls(this, Controls); EnsureChildControls(); ddlActionList = new RockDropDownList(); ddlActionList.Label = "Action"; ddlActionList.AutoPostBack = true; ddlActionList.Items.Add(new ListItem("Do Nothing", "0")); ddlActionList.Items.Add(new ListItem("Push New Page", "1")); ddlActionList.Items.Add(new ListItem("Replace Current Page", "2")); ddlActionList.Items.Add(new ListItem("Pop Curent Page", "3")); ddlActionList.Items.Add(new ListItem("Open Browser", "4")); ddlActionList.SelectedIndexChanged += DdlActionList_SelectedIndexChanged; ddlActionList.CssClass = "col-md-12"; ddlActionList.ID = "ddlActionList_" + this.ID; ppPage = new PagePicker() { Label = "Page", ID = "ppPage_" + this.ID }; tbTarget = new RockTextBox() { Label = "Target", ID = "tbTarget_" + this.ID }; tbParameter = new RockTextBox() { Label = "Parameter", ID = "tbParameter_" + this.ID }; ddlRckipid = new RockDropDownList(); ddlRckipid.ID = "ddlRckipid_" + this.ID; ddlRckipid.Label = "Send Impersonation Id"; ddlRckipid.Items.Add(new ListItem("No", "0")); ddlRckipid.Items.Add(new ListItem("Yes", "1")); Controls.Add(ddlActionList); Controls.Add(ppPage); Controls.Add(tbTarget); Controls.Add(tbParameter); Controls.Add(ddlRckipid); EnsureChildControls(); }
/// <summary> /// Creates the HTML controls required to configure this type of field /// </summary> /// <returns></returns> public override List <Control> ConfigurationControls() { List <Control> controls = new List <Control>(); var mpMedia = new MediaElementPicker(); mpMedia.Label = "Media"; mpMedia.Help = "The media file that will be watched by the individual."; mpMedia.Required = true; controls.Add(mpMedia); var nbCompletionPercentage = new NumberBox(); nbCompletionPercentage.NumberType = System.Web.UI.WebControls.ValidationDataType.Double; nbCompletionPercentage.Label = "Completion Percentage"; nbCompletionPercentage.Help = "The percentage of the video that the individual must view in order for the video to be considered watched. Instead of setting this to 100% you probably want a few points below that."; nbCompletionPercentage.AppendText = "%"; nbCompletionPercentage.MaximumValue = 100.ToString(); nbCompletionPercentage.MinimumValue = 0.ToString(); nbCompletionPercentage.CssClass = "input-width-sm"; controls.Add(nbCompletionPercentage); var nbAutoResume = new NumberBox(); nbAutoResume.NumberType = System.Web.UI.WebControls.ValidationDataType.Integer; nbAutoResume.Label = "Auto Resume In Days"; nbAutoResume.Help = "The video player will look back this many days for a previous watch session and attempt to auto-resume from that point."; nbAutoResume.MaximumValue = 3650.ToString(); nbAutoResume.MinimumValue = (-1).ToString(); nbAutoResume.CssClass = "input-width-sm"; controls.Add(nbAutoResume); var tbMaxWidth = new RockTextBox(); tbMaxWidth.Label = "Maximum Video Width"; tbMaxWidth.Help = "The maximum width of the video. This unit can be expressed in pixels (e.g. 250px) or percent (e.g. 75%). If no unit is provided pixels is assumed."; tbMaxWidth.CssClass = "input-width-sm"; controls.Add(tbMaxWidth); var tbValidationMessage = new RockTextBox(); tbValidationMessage.Label = "Validation Message"; tbValidationMessage.Help = "The message that should be show when the individual does not watch the required amount of the video."; tbValidationMessage.TextMode = System.Web.UI.WebControls.TextBoxMode.MultiLine; tbValidationMessage.Rows = 3; controls.Add(tbValidationMessage); return(controls); }
/// <summary> /// Sets the selection. /// </summary> /// <param name="entityType">Type of the entity.</param> /// <param name="controls">The controls.</param> /// <param name="selection">The selection.</param> public override void SetSelection(Type entityType, Control[] controls, string selection) { SelectionConfig selectionConfig = SelectionConfig.Parse(selection); if (selectionConfig != null) { RockDropDownList ddlNoteType = controls[0] as RockDropDownList; RockTextBox tbContains = controls[1] as RockTextBox; SlidingDateRangePicker slidingDateRange = controls[2] as SlidingDateRangePicker; ddlNoteType.SelectedValue = selectionConfig.NoteTypeId.HasValue ? selectionConfig.NoteTypeId.ToString() : ""; tbContains.Text = selectionConfig.NoteContains; slidingDateRange.DelimitedValues = selectionConfig.DelimitedValues; } }
/// <summary> /// Sets the selection. /// </summary> /// <param name="entityType">Type of the entity.</param> /// <param name="controls">The controls.</param> /// <param name="selection">The selection.</param> public override void SetSelection(Type entityType, Control[] controls, string selection) { if (controls.Count() >= 2) { RockDropDownList ddlNoteType = controls[0] as RockDropDownList; RockTextBox tbContains = controls[1] as RockTextBox; string[] selectionValues = selection.Split('|'); if (selectionValues.Length >= 2) { ddlNoteType.SelectedValue = selectionValues[0]; tbContains.Text = selectionValues[1]; } } }
/// <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 tbCustomValues = new RockTextBox(); controls.Add( tbCustomValues ); tbCustomValues.TextMode = TextBoxMode.MultiLine; tbCustomValues.Rows = 3; tbCustomValues.AutoPostBack = true; tbCustomValues.TextChanged += OnQualifierUpdated; tbCustomValues.Label = "Limit Attributes by Field Type"; tbCustomValues.Help = "Optional list of field type classes for limiting selection to attributes using those field types (e.g. 'Rock.Field.Types.PersonFieldType|Rock.Field.Types.GroupFieldType')."; return controls; }
/// <summary> /// Creates the HTML controls required to configure this type of field /// </summary> /// <returns></returns> public override List <Control> ConfigurationControls() { List <Control> controls = new List <Control>(); var tb = new RockTextBox(); controls.Add(tb); tb.TextMode = TextBoxMode.MultiLine; tb.Rows = 3; tb.AutoPostBack = true; tb.TextChanged += OnQualifierUpdated; tb.Label = "Values"; tb.Help = "The source of the values to display in a list. Format is either 'value1,value2,value3,...', 'value1^text1,value2^text2,value3^text3,...', or a SQL Select statement that returns result set with a 'Value' and 'Text' column."; return(controls); }
/// <summary> /// Creates the child controls. /// </summary> /// <param name="entityType">The System Type of the entity to which the filter will be applied.</param> /// <param name="filterControl">The control that serves as the container for the filter controls.</param> /// <returns> /// The array of new controls created to implement the filter. /// </returns> public override Control[] CreateChildControls(Type entityType, FilterField filterControl) { var campusesPicker = new CampusesPicker(); campusesPicker.Label = "Campuses"; campusesPicker.ID = filterControl.ID + "_0"; campusesPicker.Label = string.Empty; campusesPicker.CssClass = "js-campuses-picker campuses-picker"; campusesPicker.Campuses = CampusCache.All(); filterControl.Controls.Add(campusesPicker); var ddlIntegerCompare = ComparisonHelper.ComparisonControl(ComparisonHelper.NumericFilterComparisonTypes); ddlIntegerCompare.Label = "Attendance Count"; ddlIntegerCompare.ID = filterControl.ID + "_ddlIntegerCompare"; ddlIntegerCompare.AddCssClass("js-filter-compare"); filterControl.Controls.Add(ddlIntegerCompare); var tbAttendedCount = new RockTextBox(); tbAttendedCount.ID = filterControl.ID + "_2"; tbAttendedCount.Label = " "; // give it whitespace label so it lines up nicely tbAttendedCount.AddCssClass("js-attended-count"); filterControl.Controls.Add(tbAttendedCount); var slidingDateRangePicker = new SlidingDateRangePicker(); slidingDateRangePicker.Label = "Date Range"; slidingDateRangePicker.ID = filterControl.ID + "_slidingDateRangePicker"; slidingDateRangePicker.AddCssClass("js-sliding-date-range"); filterControl.Controls.Add(slidingDateRangePicker); var controls = new Control[4] { campusesPicker, ddlIntegerCompare, tbAttendedCount, slidingDateRangePicker }; // convert pipe to comma delimited var defaultDelimitedValues = slidingDateRangePicker.DelimitedValues.Replace("|", ","); var defaultCount = 4; // set the default values in case this is a newly added filter SetSelection( entityType, controls, string.Format("{0}|{1}|{2}|{3}|false", campusesPicker.Items.Count > 0 ? campusesPicker.Items[0].Value : "0", ComparisonType.GreaterThanOrEqualTo.ConvertToInt().ToString(), defaultCount, defaultDelimitedValues)); return(controls); }
/// <summary> /// Creates the HTML controls required to configure this type of field /// </summary> /// <returns></returns> public override List <Control> ConfigurationControls() { var controls = base.ConfigurationControls(); // build a drop down list of enity types (the one that gets selected is // used to build a list of attributes) var etp = new EntityTypePicker(); controls.Add(etp); etp.AutoPostBack = true; etp.SelectedIndexChanged += OnQualifierUpdated; etp.Label = "Entity Type"; etp.Help = "The Entity Type to select attributes for."; var entityTypeList = new Model.EntityTypeService(new RockContext()).GetEntities().ToList(); etp.EntityTypes = entityTypeList; // Add checkbox for deciding if the defined values list is renedered as a drop // down list or a checkbox list. var cb = new RockCheckBox(); controls.Add(cb); cb.AutoPostBack = true; cb.CheckedChanged += OnQualifierUpdated; cb.Label = "Allow Multiple Values"; cb.Text = "Yes"; cb.Help = "When set, allows multiple attributes to be selected."; // Add textbox for the qualifier column var tbColumn = new RockTextBox(); controls.Add(tbColumn); tbColumn.AutoPostBack = true; tbColumn.TextChanged += OnQualifierUpdated; tbColumn.Label = "Qualifier Column"; tbColumn.Help = "Entity column qualifier."; // Add textbox for the qualifier value var tbValue = new RockTextBox(); controls.Add(tbValue); tbValue.AutoPostBack = true; tbValue.TextChanged += OnQualifierUpdated; tbValue.Label = "Qualifier Value"; tbValue.Help = "Entity column value."; return(controls); }
/// <summary> /// Sets the selection. /// </summary> /// <param name="entityType">Type of the entity.</param> /// <param name="controls">The controls.</param> /// <param name="selection">The selection.</param> public override void SetSelection(Type entityType, Control[] controls, string selection) { string[] selectionValues = selection.Split('|'); if (selectionValues.Length >= 3) { RockDropDownList ddlCourseRequirement = controls[0] as RockDropDownList; ddlCourseRequirement.SetValue(selectionValues[0]); RockTextBox tbDays = controls[1] as RockTextBox; tbDays.Text = selectionValues[1]; RockCheckBox cbIncludeExpired = controls[2] as RockCheckBox; cbIncludeExpired.Checked = selectionValues[2].AsBoolean(); } }
protected void gCounts_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { string rowId = gCounts.DataKeys[e.Row.RowIndex].Value.ToString(); RockTextBox textBox = new RockTextBox(); textBox.Width = 60; textBox.Text = ""; textBox.ID = "tb" + e.Row.ID; if (Counts.ContainsKey(rowId)) { textBox.Text = Counts[rowId]; } e.Row.Cells[gCounts.Columns.Count - 1].Controls.Add(textBox); } }
private void LoadValuesFromPage() { foreach (var item in rptDataFilters.Items.OfType <RepeaterItem>()) { HiddenField FilterId = item.FindControl("hfFilterId") as HiddenField; HiddenField FilterOrder = item.FindControl("hfSortOrder") as HiddenField; RockTextBox tbDisplayName = item.FindControl("tbDisplayName") as RockTextBox; RockTextBox tbCSS = item.FindControl("tbCSS") as RockTextBox; RockCheckBox cbActiveByDefault = item.FindControl("cbActiveByDefault") as RockCheckBox; _filters[FilterId.Value].DisplayAs = tbDisplayName.Text; _filters[FilterId.Value].CSS = tbCSS.Text; _filters[FilterId.Value].Order = Int32.Parse(FilterOrder.Value); _filters[FilterId.Value].ActiveByDefault = cbActiveByDefault.Checked; } }
/// <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(); tbFromName = new RockTextBox(); tbFromName.ID = string.Format( "tbFromName_{0}", this.ID ); tbFromName.Label = "From Name"; Controls.Add( tbFromName ); tbFromAddress = new RockTextBox(); tbFromAddress.ID = string.Format( "tbFromAddress_{0}", this.ID ); tbFromAddress.Label = "From Address"; Controls.Add( tbFromAddress ); tbReplyToAddress = new RockTextBox(); tbReplyToAddress.ID = string.Format( "tbReplyToAddress_{0}", this.ID ); tbReplyToAddress.Label = "Reply To Address"; Controls.Add( tbReplyToAddress ); tbSubject = new RockTextBox(); tbSubject.ID = string.Format( "tbSubject_{0}", this.ID ); tbSubject.Label = "Subject"; Controls.Add( tbSubject ); htmlMessage = new HtmlEditor(); htmlMessage.ID = string.Format( "htmlMessage_{0}", this.ID ); htmlMessage.AdditionalConfigurations = "autoParagraph: false,"; htmlMessage.MergeFields.Clear(); htmlMessage.MergeFields.Add( "GlobalAttribute" ); htmlMessage.MergeFields.Add( "Rock.Model.Person" ); htmlMessage.MergeFields.Add( "UnsubscribeOption" ); this.AdditionalMergeFields.ForEach( m => htmlMessage.MergeFields.Add( m ) ); htmlMessage.Label = "Message"; htmlMessage.Height = 600; Controls.Add( htmlMessage ); tbTextMessage = new RockTextBox(); tbTextMessage.ID = string.Format( "tbTextMessage_{0}", this.ID ); tbTextMessage.Label = "Message (Text Version)"; tbTextMessage.TextMode = TextBoxMode.MultiLine; tbTextMessage.Rows = 5; tbTextMessage.CssClass = "span12"; Controls.Add( tbTextMessage ); hfAttachments = new HiddenField(); hfAttachments.ID = string.Format( "hfAttachments_{0}", this.ID ); Controls.Add( hfAttachments ); fuAttachments = new FileUploader(); fuAttachments.ID = string.Format( "fuAttachments_{0}", this.ID ); fuAttachments.Label = "Attachments"; fuAttachments.FileUploaded += fuAttachments_FileUploaded; Controls.Add( fuAttachments ); }
/// <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(); tbFromName = new RockTextBox(); tbFromName.ID = string.Format( "tbFromName_{0}", this.ID ); tbFromName.Label = "From Name"; Controls.Add( tbFromName ); lFromName = new RockLiteral(); lFromName.ID = string.Format( "lFromName_{0}", this.ID ); lFromName.Label = "From Name"; Controls.Add( lFromName ); ebFromAddress = new EmailBox(); ebFromAddress.ID = string.Format( "ebFromAddress_{0}", this.ID ); ebFromAddress.Label = "From Address"; Controls.Add( ebFromAddress ); lFromAddress = new RockLiteral(); lFromAddress.ID = string.Format( "lFromAddress_{0}", this.ID ); lFromAddress.Label = "From Address"; Controls.Add( lFromAddress ); ebReplyToAddress = new EmailBox(); ebReplyToAddress.ID = string.Format( "ebReplyToAddress_{0}", this.ID ); ebReplyToAddress.Label = "Reply To Address"; Controls.Add( ebReplyToAddress ); tbSubject = new RockTextBox(); tbSubject.ID = string.Format( "tbSubject_{0}", this.ID ); tbSubject.Label = "Subject"; tbSubject.Help = "<span class='tip tip-lava'></span>"; Controls.Add( tbSubject ); htmlMessage = new HtmlEditor(); htmlMessage.ID = string.Format( "htmlMessage_{0}", this.ID ); //htmlMessage.AdditionalConfigurations = "autoParagraph: false,"; htmlMessage.Help = "<span class='tip tip-lava'></span> <span class='tip tip-html'>"; this.AdditionalMergeFields.ForEach( m => htmlMessage.MergeFields.Add( m ) ); htmlMessage.Label = "Message"; htmlMessage.Height = 600; Controls.Add( htmlMessage ); tbTextMessage = new RockTextBox(); tbTextMessage.ID = string.Format( "tbTextMessage_{0}", this.ID ); tbTextMessage.Label = "Message (Text Version)"; tbTextMessage.TextMode = TextBoxMode.MultiLine; tbTextMessage.Rows = 5; tbTextMessage.CssClass = "span12"; Controls.Add( tbTextMessage ); hfAttachments = new HiddenField(); hfAttachments.ID = string.Format( "hfAttachments_{0}", this.ID ); Controls.Add( hfAttachments ); fuAttachments = new FileUploader(); fuAttachments.ID = string.Format( "fuAttachments_{0}", this.ID ); fuAttachments.Label = "Attachments"; fuAttachments.FileUploaded += fuAttachments_FileUploaded; Controls.Add( fuAttachments ); }
/// <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(); ddlFrom = new RockDropDownList(); ddlFrom.ID = string.Format( "ddlFrom_{0}", this.ID ); ddlFrom.Label = "From"; ddlFrom.Help = "The number to originate message from (configured under Admin Tools > General Settings > Defined Types > SMS From Values)."; ddlFrom.BindToDefinedType( DefinedTypeCache.Read( new Guid( Rock.SystemGuid.DefinedType.COMMUNICATION_SMS_FROM ) ), false, true ); Controls.Add( ddlFrom ); rcwMessage = new RockControlWrapper(); rcwMessage.ID = string.Format( "rcwMessage_{0}", this.ID ); rcwMessage.Label = "Message"; Controls.Add( rcwMessage ); mfpMessage = new MergeFieldPicker(); mfpMessage.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 ); tbMessage = new RockTextBox(); tbMessage.ID = string.Format( "tbTextMessage_{0}", this.ID ); tbMessage.TextMode = TextBoxMode.MultiLine; tbMessage.Rows = 3; rcwMessage.Controls.Add( tbMessage ); }