from http://stackoverflow.com/a/8761161/1755417
상속: System.Web.UI.WebControls.HiddenField
예제 #1
0
        /// <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);

            _childControlWrapper = new HtmlGenericControl("div");

            _hfSelectedItemId          = new HiddenFieldWithClass();
            _hfSelectedItemId.CssClass = "js-buttondropdown-selected-id";
            _hfSelectedItemId.ID       = "_hfSelectedItemId";


            _btnSelect = new HtmlGenericControl("button");
            _childControlWrapper.Controls.Add(_btnSelect);
            _btnSelect.ID = "_btnSelect";
            _btnSelect.Attributes["type"]        = "button";
            _btnSelect.Attributes["class"]       = "btn btn-default dropdown-toggle js-buttondropdown-btn-select " + this.CssClass;
            _btnSelect.Attributes["data-toggle"] = "dropdown";

            _listControl = new HtmlGenericControl("ul");
            _childControlWrapper.Controls.Add(_listControl);
            _listControl.Attributes["class"] = "dropdown-menu";

            _childControlWrapper.Controls.Add(_hfSelectedItemId);

            Controls.Add(_childControlWrapper);

            RequiredFieldValidator.InitialValue      = string.Empty;
            RequiredFieldValidator.ControlToValidate = _hfSelectedItemId.ID;
        }
예제 #2
0
        /// <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);

            _hfDisableVrm       = new HiddenField();
            _hfDisableVrm.ID    = this.ID + "_dvrm";
            _hfDisableVrm.Value = "True";
            Controls.Add(_hfDisableVrm);

            _hfInCodeEditorMode          = new HiddenFieldWithClass();
            _hfInCodeEditorMode.CssClass = "js-incodeeditormode";
            _hfInCodeEditorMode.ID       = this.ID + "_hfInCodeEditorMode";
            Controls.Add(_hfInCodeEditorMode);

            _ceEditor              = new CodeEditor();
            _ceEditor.ID           = this.ID + "_codeEditor";
            _ceEditor.CssClass     = "html-editor-code-editor";
            _ceEditor.EditorMode   = CodeEditorMode.Lava;
            _ceEditor.EditorHeight = this.Height.Value.ToString();
            if (!string.IsNullOrEmpty(this.CallbackOnChangeScript))
            {
                _ceEditor.OnChangeScript = this.CallbackOnChangeScript;
            }

            Controls.Add(_ceEditor);
        }
예제 #3
0
        /// <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();

            _hfExpanded    = new HiddenField();
            _hfExpanded.ID = "_hfExpanded";
            Controls.Add(_hfExpanded);
            _hfExpanded.Value = "False";

            _hfTitle = new HiddenFieldWithClass();
            _hfTitle.ValidateRequestMode = System.Web.UI.ValidateRequestMode.Disabled;
            _hfTitle.ID       = "_hfTitle";
            _hfTitle.CssClass = "js-header-title-hidden";
            Controls.Add(_hfTitle);

            _hfTitleDisableVrm       = new HiddenField();
            _hfTitleDisableVrm.ID    = _hfTitle.ID + "_dvrm";
            _hfTitleDisableVrm.Value = "True";
            Controls.Add(_hfTitleDisableVrm);

            _lbDelete    = new LinkButton();
            _lbDelete.ID = "_lbDelete";
            Controls.Add(_lbDelete);
            _lbDelete.CausesValidation = false;
            _lbDelete.CssClass         = "btn btn-xs btn-danger js-stop-immediate-propagation";
            _lbDelete.Click           += lbDelete_Click;
            _lbDelete.Controls.Add(new LiteralControl {
                Text = "<i class='fa fa fa-times'></i>"
            });
        }
        /// <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()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add(_hfExpanded);
            _hfExpanded.ID       = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "group-expanded";
            _hfExpanded.Value    = "False";

            _hfGroupGuid    = new HiddenField();
            _hfGroupGuid.ID = this.ID + "_hfGroupGuid";
            Controls.Add(_hfGroupGuid);

            _lblGroupRowName = new Label();
            _lblGroupRowName.ClientIDMode = ClientIDMode.Static;
            _lblGroupRowName.ID           = this.ID + "_lblGroupRowName";
            Controls.Add(_lblGroupRowName);


            _lbAddGroup                  = new LinkButton();
            _lbAddGroup.ID               = this.ID + "_lbAddGroup";
            _lbAddGroup.CssClass         = "btn btn-xs btn-default checkin-group-add-group";
            _lbAddGroup.Click           += lbAddGroup_Click;
            _lbAddGroup.CausesValidation = false;
            _lbAddGroup.ToolTip          = "Add New Group";
            _lbAddGroup.Controls.Add(new LiteralControl {
                Text = "<i class='fa fa-plus'></i> <i class='fa fa-check-circle'></i>"
            });
            Controls.Add(_lbAddGroup);
        }
예제 #5
0
        /// <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);

            _hfMin          = new HiddenFieldWithClass();
            _hfMin.ID       = string.Format("{0}_hfMin", this.ID);
            _hfMin.CssClass = "js-number-up-down-min";
            _hfMin.Value    = int.MinValue.ToString();
            Controls.Add(_hfMin);

            _hfMax          = new HiddenFieldWithClass();
            _hfMax.ID       = string.Format("{0}_hfMax", this.ID);
            _hfMax.CssClass = "js-number-up-down-max";
            _hfMax.Value    = int.MaxValue.ToString();
            Controls.Add(_hfMax);

            _hfNumber          = new HiddenFieldWithClass();
            _hfNumber.ID       = string.Format("{0}_hfNumber", this.ID);
            _hfNumber.CssClass = "js-number-up-down-value";
            _hfNumber.Value    = "0";
            Controls.Add(_hfNumber);

            _lblNumber    = new Label();
            _lblNumber.ID = string.Format("{0}_lblNumber", this.ID);
            Controls.Add(_lblNumber);

            RequiredFieldValidator.InitialValue      = string.Empty;
            RequiredFieldValidator.ControlToValidate = _hfNumber.ID;
        }
예제 #6
0
        /// <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()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add(_hfExpanded);
            _hfExpanded.ID       = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "filter-expanded";
            _hfExpanded.Value    = "False";

            _hfGroupGuid    = new HiddenField();
            _hfGroupGuid.ID = this.ID + "_hfGroupGuid";

            _hfGroupId    = new HiddenField();
            _hfGroupId.ID = this.ID + "_hfGroupId";

            _hfGroupTypeId    = new HiddenField();
            _hfGroupTypeId.ID = this.ID + "_hfGroupTypeId";

            _lblGroupName    = new Literal();
            _lblGroupName.ID = this.ID + "_lblGroupName";

            _lbDeleteGroup = new LinkButton();
            _lbDeleteGroup.CausesValidation = false;
            _lbDeleteGroup.ID       = this.ID + "_lbDeleteGroup";
            _lbDeleteGroup.CssClass = "btn btn-xs btn-danger";
            _lbDeleteGroup.Click   += lbDeleteGroup_Click;
            _lbDeleteGroup.Attributes["onclick"] = string.Format("javascript: return Rock.dialogs.confirmDelete(event, '{0}', '{1}');", "group", "Once saved, you will lose all attendance data.");

            var iDelete = new HtmlGenericControl("i");

            _lbDeleteGroup.Controls.Add(iDelete);
            iDelete.AddCssClass("fa fa-times");

            _tbGroupName       = new DataTextBox();
            _tbGroupName.ID    = this.ID + "_tbGroupName";
            _tbGroupName.Label = "Check-in Group Name";

            // set label when they exit the edit field
            _tbGroupName.Attributes["onblur"] = string.Format("javascript: $('#{0}').text($(this).val());", _lblGroupName.ID);
            _tbGroupName.SourceTypeName       = "Rock.Model.Group, Rock";
            _tbGroupName.PropertyName         = "Name";

            _phGroupAttributes    = new PlaceHolder();
            _phGroupAttributes.ID = this.ID + "_phGroupAttributes";

            Controls.Add(_hfGroupGuid);
            Controls.Add(_hfGroupId);
            Controls.Add(_hfGroupTypeId);
            Controls.Add(_lblGroupName);
            Controls.Add(_tbGroupName);
            Controls.Add(_phGroupAttributes);

            // Locations Grid
            CreateLocationsGrid();

            Controls.Add(_lbDeleteGroup);
        }
예제 #7
0
        /// <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()
        {
            Controls.Clear();

            _noteEditor = new NoteEditor();
            _noteEditor.SetNoteOptions(this.NoteOptions);
            _noteEditor.ID       = this.ID + "_noteEditor";
            _noteEditor.CssClass = "note-new";

            _noteEditor.CreatedByPersonAlias = (this.Page as RockPage)?.CurrentPersonAlias;
            _noteEditor.SaveButtonClick     += note_SaveButtonClick;

            Controls.Add(_noteEditor);

            // Create a hidden field that javascript will populate with the selected note
            _hfCurrentNoteId          = new HiddenFieldWithClass();
            _hfCurrentNoteId.ID       = this.ID + "_hfCurrentNoteId";
            _hfCurrentNoteId.CssClass = "js-currentnoteid";
            Controls.Add(_hfCurrentNoteId);

            _hfExpandedNoteIds          = new HiddenFieldWithClass();
            _hfExpandedNoteIds.ID       = this.ID + "_hfExpandedNoteIds";
            _hfExpandedNoteIds.CssClass = "js-expandednoteids";
            Controls.Add(_hfExpandedNoteIds);

            // Create a hidden DeleteNote linkbutton that will hookup to the Lava'd Delete button
            _lbDeleteNote          = new LinkButton();
            _lbDeleteNote.ID       = this.ID + "_lbDeleteNote";
            _lbDeleteNote.CssClass = "js-delete-postback";
            _lbDeleteNote.Click   += _lbDeleteNote_Click;
            _lbDeleteNote.Style[HtmlTextWriterStyle.Display] = "none";
            Controls.Add(_lbDeleteNote);

            _mdDeleteWarning    = new ModalAlert();
            _mdDeleteWarning.ID = this.ID + "_mdDeleteWarning";
            Controls.Add(_mdDeleteWarning);

            _lbShowMore        = new LinkButton();
            _lbShowMore.ID     = "lbShowMore";
            _lbShowMore.Click += _lbShowMore_Click;
            _lbShowMore.AddCssClass("load-more btn btn-xs btn-action");
            Controls.Add(_lbShowMore);

            var iDownPre = new HtmlGenericControl("i");

            iDownPre.Attributes.Add("class", "fa fa-angle-down");
            _lbShowMore.Controls.Add(iDownPre);

            var spanDown = new HtmlGenericControl("span");

            spanDown.InnerHtml = " Load More ";
            _lbShowMore.Controls.Add(spanDown);

            var iDownPost = new HtmlGenericControl("i");

            iDownPost.Attributes.Add("class", "fa fa-angle-down");
            _lbShowMore.Controls.Add(iDownPost);
        }
예제 #8
0
        /// <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();

            _hfTemplateKey          = new HiddenFieldWithClass();
            _hfTemplateKey.ID       = this.ID + "_hfValue";
            _hfTemplateKey.CssClass = "js-template-id";
            this.Controls.Add(_hfTemplateKey);

            _pnlStandard          = new Panel();
            _pnlStandard.ID       = this.ID + "_pnlOption";
            _pnlStandard.CssClass = "js-template-option-panel";
            this.Controls.Add(_pnlStandard);

            _btnCustomize                  = new LinkButton();
            _btnCustomize.CssClass         = "btn btn-xs btn-link";
            _btnCustomize.ID               = string.Format("{0}_btnCustomize", this.ID);
            _btnCustomize.Text             = "Customize";
            _btnCustomize.CausesValidation = false;
            _btnCustomize.Click           += btnCustomize_Click;
            this.Controls.Add(_btnCustomize);

            _pnlCustom          = new Panel();
            _pnlCustom.ID       = this.ID + "pnlCustom";
            _pnlCustom.CssClass = "js-template-custom-panel";
            this.Controls.Add(_pnlCustom);

            _rbbCustom         = new RockRadioButton();
            _rbbCustom.Checked = true;
            _rbbCustom.Text    = "<b>Custom</b>";
            _pnlCustom.Controls.Add(_rbbCustom);

            _actionDiv = new HtmlGenericControl("div");
            _pnlCustom.Controls.Add(_actionDiv);
            _actionDiv.Attributes["class"] = "actions clearfix";

            _btnStandard                  = new LinkButton();
            _btnStandard.CssClass         = "btn btn-xs btn-link pull-right";
            _btnStandard.ID               = string.Format("{0}_btnStandard", this.ID);
            _btnStandard.Text             = "Use Standard Templates";
            _btnStandard.CausesValidation = false;
            _btnStandard.Click           += btnStandard_Click;
            _actionDiv.Controls.Add(_btnStandard);

            _ceLavaTemplate          = new CodeEditor();
            _ceLavaTemplate.ID       = this.ID + "_ceLavaTemplate";
            _ceLavaTemplate.CssClass = "js-template-lava-field";
            _pnlCustom.Controls.Add(_ceLavaTemplate);

            RockControlHelper.CreateChildControls(this, Controls);
        }
예제 #9
0
        /// <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();

            _hfMetricId    = new HiddenField();
            _hfMetricId.ID = string.Format("hfMetricId_{0}", this.ID);

            _hfXAxisLabel          = new HiddenFieldWithClass();
            _hfXAxisLabel.ID       = string.Format("hfXAxisLabel_{0}", this.ID);
            _hfXAxisLabel.CssClass = "js-xaxis-value";

            _hfYAxisLabel          = new HiddenFieldWithClass();
            _hfYAxisLabel.ID       = string.Format("hfYAxisLabel_{0}", this.ID);
            _hfYAxisLabel.CssClass = "js-yaxis-value";

            _hfRestUrlParams          = new HiddenFieldWithClass();
            _hfRestUrlParams.ID       = string.Format("hfRestUrlParams_{0}", this.ID);
            _hfRestUrlParams.CssClass = "js-rest-url-params";

            _hfRestUrl          = new HiddenFieldWithClass();
            _hfRestUrl.ID       = string.Format("hfRestUrl_{0}", this.ID);
            _hfRestUrl.CssClass = "js-rest-url";

            _hfSeriesPartitionNameUrl          = new HiddenFieldWithClass();
            _hfSeriesPartitionNameUrl.ID       = string.Format("hfSeriesPartitionNameUrl_{0}", this.ID);
            _hfSeriesPartitionNameUrl.CssClass = "js-seriesname-url";

            _lblChartTitle    = new Label();
            _lblChartTitle.ID = string.Format("lblChartTitle_{0}", this.ID);

            _lblChartSubtitle    = new Label();
            _lblChartSubtitle.ID = string.Format("lblChartSubtitle_{0}", this.ID);

            _pnlChartPlaceholder          = new Panel();
            _pnlChartPlaceholder.CssClass = "chart-placeholder js-chart-placeholder";
            _pnlChartPlaceholder.ID       = string.Format("pnlChartPlaceholder_{0}", this.ID);

            _hbChartOptions    = new HelpBlock();
            _hbChartOptions.ID = string.Format("hbChartOptions_{0}", this.ID);

            Controls.Add(_hfMetricId);
            Controls.Add(_hfXAxisLabel);
            Controls.Add(_hfYAxisLabel);
            Controls.Add(_hfRestUrlParams);
            Controls.Add(_hfRestUrl);
            Controls.Add(_hfSeriesPartitionNameUrl);
            Controls.Add(_lblChartTitle);
            Controls.Add(_lblChartSubtitle);
            Controls.Add(_pnlChartPlaceholder);
            Controls.Add(_hbChartOptions);
        }
예제 #10
0
        /// <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()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add(_hfExpanded);
            _hfExpanded.ID       = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "area-expanded";
            _hfExpanded.Value    = "False";

            _hfGroupTypeGuid    = new HiddenField();
            _hfGroupTypeGuid.ID = this.ID + "_hfGroupTypeGuid";

            _lblAreaRowName = new Label();
            _lblAreaRowName.ClientIDMode = ClientIDMode.Static;
            _lblAreaRowName.ID           = this.ID + "_lblAreaRowName";

            _lbAddArea                  = new LinkButton();
            _lbAddArea.ID               = this.ID + "_lblbAddArea";
            _lbAddArea.CssClass         = "btn btn-xs btn-default checkin-area-add-area";
            _lbAddArea.Click           += lbAddArea_Click;
            _lbAddArea.CausesValidation = false;
            _lbAddArea.Controls.Add(new LiteralControl {
                Text = "<i class='fa fa-plus'></i> <i class='fa fa-folder-open'></i>"
            });

            _lbAddGroup                  = new LinkButton();
            _lbAddGroup.ID               = this.ID + "_lbAddGroup";
            _lbAddGroup.CssClass         = "btn btn-xs btn-default checkin-area-add-group";
            _lbAddGroup.Click           += lbAddGroup_Click;
            _lbAddGroup.CausesValidation = false;
            _lbAddGroup.Controls.Add(new LiteralControl {
                Text = "<i class='fa fa-plus'></i> <i class='fa fa-check-circle'></i>"
            });

            _lblDeleteArea = new LinkButton();
            _lblDeleteArea.CausesValidation = false;
            _lblDeleteArea.ID       = this.ID + "_lblDeleteArea";
            _lblDeleteArea.CssClass = "btn btn-xs btn-danger";
            _lblDeleteArea.Click   += lblDeleteArea_Click;
            _lblDeleteArea.Controls.Add(new LiteralControl {
                Text = "<i class='fa fa-times'></i>"
            });
            _lblDeleteArea.Attributes["onclick"] = string.Format("javascript: return Rock.dialogs.confirmDelete(event, '{0}', '{1}');", "check-in area", "Once saved, you will lose all attendance data.");

            Controls.Add(_hfGroupTypeGuid);
            Controls.Add(_lblAreaRowName);

            Controls.Add(_lbAddArea);
            Controls.Add(_lbAddGroup);
            Controls.Add(_lblDeleteArea);
        }
예제 #11
0
        /// <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();

            _btnSelectAll = new HyperLink
            {
                ID       = this.ID + "_btnSelectAll",
                CssClass = "btn btn-link btn-xs js-select-all",
                Text     = "Select All"
            };

            this.Controls.Add(_btnSelectAll);


            _cbShowInactiveAccounts = new RockCheckBox
            {
                ID                     = this.ID + "_cbShowInactiveAccounts",
                Text                   = "Show Inactive",
                CssClass               = "picker-show-inactive",
                ContainerCssClass      = "js-picker-show-inactive",
                SelectedIconCssClass   = "fa fa-check-square-o",
                UnSelectedIconCssClass = "fa fa-square-o",
                CausesValidation       = false,
                AutoPostBack           = true,
            };
            _cbShowInactiveAccounts.CheckedChanged += _cbShowInactiveAccounts_CheckedChanged;
            this.Controls.Add(_cbShowInactiveAccounts);

            _hfSearchValue = new HiddenFieldWithClass
            {
                ID       = this.ID + "_hfSearchValue",
                CssClass = "js-existing-search-value"
            };

            this.Controls.Add(_hfSearchValue);

            _hfPickerShowActive = new HiddenFieldWithClass
            {
                ID       = this.ID + "_hfPickerShowActive",
                CssClass = "js-picker-showactive-value"
            };
            this.Controls.Add(_hfPickerShowActive);

            _hfViewMode = new HiddenFieldWithClass
            {
                ID       = this.ID + "_hfViewMode",
                CssClass = "js-picker-view-mode"
            };

            this.Controls.Add(_hfViewMode);
        }
예제 #12
0
파일: SSNBox.cs 프로젝트: waldo2590/Rock
        /// <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);

            hfSSN          = new HiddenFieldWithClass();
            hfSSN.ID       = string.Format("hfSSN_{0}", this.ID);
            hfSSN.CssClass = "js-ssn";

            this.RegularExpressionValidator.ID                   = ID + "_rev";
            this.RegularExpressionValidator.CssClass             = "validation-error help-inline";
            this.RegularExpressionValidator.ValidationExpression = @"\d{3}-\d{2}-\d{4}";
            this.RegularExpressionValidator.ControlToValidate    = hfSSN.ID;
            this.RegularExpressionValidator.ErrorMessage         = (this.Label != string.Empty ? this.Label : "SSN") + " is invalid.";
            this.RegularExpressionValidator.Enabled              = true;
            this.RegularExpressionValidator.Display              = ValidatorDisplay.Dynamic;
            this.RegularExpressionValidator.ValidationGroup      = ValidationGroup;
            Controls.Add(this.RegularExpressionValidator);

            this.RequiredFieldValidator.InitialValue      = string.Empty;
            this.RequiredFieldValidator.ControlToValidate = hfSSN.ID;

            ssnArea          = new TextBox();
            ssnArea.CssClass = "form-control ssn-part ssn-area";
            ssnArea.ID       = "ssnArea_" + this.ID;
            ssnArea.TextMode = TextBoxMode.Password;
            ssnArea.Attributes["pattern"] = "[0-9]*";
            ssnArea.MaxLength             = 3;

            ssnGroup          = new TextBox();
            ssnGroup.CssClass = "form-control ssn-part ssn-group";
            ssnGroup.ID       = "ssnGroup_" + this.ID;
            ssnGroup.TextMode = TextBoxMode.Password;
            ssnGroup.Attributes["pattern"] = "[0-9]*";
            ssnGroup.MaxLength             = 2;

            ssnSerial                      = new TextBox();
            ssnSerial.CssClass             = "form-control ssn-part ssn-serial";
            ssnSerial.ID                   = "ssnSerial_" + this.ID;
            ssnGroup.Attributes["pattern"] = "[0-9]*";
            ssnSerial.MaxLength            = 4;

            Controls.Add(hfSSN);
            Controls.Add(ssnArea);
            Controls.Add(ssnGroup);
            Controls.Add(ssnSerial);
        }
예제 #13
0
        /// <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();

            _hfPersonId          = new HiddenFieldWithClass();
            _hfPersonId.CssClass = "js-person-id";
            Controls.Add(_hfPersonId);
            _hfPersonId.ID    = "hfPersonId";
            _hfPersonId.Value = "0";

            _hfPersonName          = new HiddenFieldWithClass();
            _hfPersonName.CssClass = "js-person-name";
            Controls.Add(_hfPersonName);
            _hfPersonName.ID = "hfPersonName";

            _hfIncludeBusinesses          = new HiddenFieldWithClass();
            _hfIncludeBusinesses.CssClass = "js-include-businesses";
            Controls.Add(_hfIncludeBusinesses);
            _hfIncludeBusinesses.ID = "hfIncludeBusinesses";

            _btnSelect = new HtmlAnchor();
            Controls.Add(_btnSelect);
            _btnSelect.Attributes["class"] = "btn btn-xs btn-primary";
            _btnSelect.ID               = "btnSelect";
            _btnSelect.InnerText        = "Select";
            _btnSelect.CausesValidation = false;
            _btnSelect.ServerClick     += btnSelect_Click;

            _btnSelectNone = new HtmlAnchor();
            Controls.Add(_btnSelectNone);
            _btnSelectNone.Attributes["class"] = "picker-select-none";
            _btnSelectNone.ID               = "btnSelectNone";
            _btnSelectNone.InnerHtml        = "<i class='fa fa-times'></i>";
            _btnSelectNone.CausesValidation = false;
            _btnSelectNone.Style[HtmlTextWriterStyle.Display] = "none";
            _btnSelectNone.ServerClick += btnSelect_Click;

            RockControlHelper.CreateChildControls(this, Controls);

            // override a couple of property values on RequiredFieldValidator so that Validation works correctly
            RequiredFieldValidator.InitialValue      = "0";
            RequiredFieldValidator.ControlToValidate = _hfPersonId.ID;
        }
예제 #14
0
        /// <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()
        {
            Controls.Clear();

            _hfChecked          = new HiddenFieldWithClass();
            _hfChecked.CssClass = "js-toggle-checked";
            _hfChecked.ID       = this.ID + "_hfChecked";

            _btnOn    = new HtmlAnchor();
            _btnOn.ID = this.ID + "_btnOn";

            _btnOff    = new HtmlAnchor();
            _btnOff.ID = this.ID + "_btnOff";

            Controls.Add(_hfChecked);
            Controls.Add(_btnOn);
            Controls.Add(_btnOff);
        }
예제 #15
0
        /// <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);

            _hfDisableVrm       = new HiddenField();
            _hfDisableVrm.ID    = this.ID + "_dvrm";
            _hfDisableVrm.Value = "True";
            Controls.Add(_hfDisableVrm);

            _hfInCodeEditorMode          = new HiddenFieldWithClass();
            _hfInCodeEditorMode.CssClass = "js-incodeeditormode";
            _hfInCodeEditorMode.ID       = this.ID + "_hfInCodeEditorMode";
            Controls.Add(_hfInCodeEditorMode);

            _ceEditor            = new CodeEditor();
            _ceEditor.ID         = this.ID + "_codeEditor";
            _ceEditor.EditorMode = CodeEditorMode.Html;
            Controls.Add(_ceEditor);
        }
예제 #16
0
파일: SSNBox.cs 프로젝트: kra3889/rockrms
        /// <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);

            hfSSN          = new HiddenFieldWithClass();
            hfSSN.ID       = string.Format("hfSSN_{0}", this.ID);
            hfSSN.CssClass = "js-ssn";

            this.RequiredFieldValidator.InitialValue      = string.Empty;
            this.RequiredFieldValidator.ControlToValidate = hfSSN.ID;

            ssnArea          = new TextBox();
            ssnArea.CssClass = "form-control ssn-part ssn-area";
            ssnArea.ID       = "ssnArea_" + this.ID;
            ssnArea.TextMode = TextBoxMode.Password;
            ssnArea.Attributes["pattern"] = "[0-9]*";
            ssnArea.MaxLength             = 3;

            ssnGroup          = new TextBox();
            ssnGroup.CssClass = "form-control ssn-part ssn-group";
            ssnGroup.ID       = "ssnGroup_" + this.ID;
            ssnGroup.TextMode = TextBoxMode.Password;
            ssnGroup.Attributes["pattern"] = "[0-9]*";
            ssnGroup.MaxLength             = 2;

            ssnSerial                      = new TextBox();
            ssnSerial.CssClass             = "form-control ssn-part ssn-serial";
            ssnSerial.ID                   = "ssnSerial_" + this.ID;
            ssnGroup.Attributes["pattern"] = "[0-9]*";
            ssnSerial.MaxLength            = 4;

            Controls.Add(hfSSN);
            Controls.Add(ssnArea);
            Controls.Add(ssnGroup);
            Controls.Add(ssnSerial);
        }
예제 #17
0
        /// <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()
        {
            Controls.Clear();

            _hfChecked          = new HiddenFieldWithClass();
            _hfChecked.CssClass = "js-toggle-checked";
            _hfChecked.ID       = this.ID + "_hfChecked";

            _btnOn    = new HtmlAnchor();
            _btnOn.ID = this.ID + "_btnOn";
            _btnOn.Attributes["class"] = "btn btn-default js-toggle-on " + this.ButtonSizeCssClass;
            _btnOn.InnerText           = this.OnText;

            _btnOff    = new HtmlAnchor();
            _btnOff.ID = this.ID + "_btnOff";
            _btnOff.Attributes["class"] = "btn btn-default js-toggle-off " + this.ButtonSizeCssClass;
            _btnOff.InnerText           = this.OffText;

            Controls.Add(_hfChecked);
            Controls.Add(_btnOn);
            Controls.Add(_btnOff);
        }
        /// <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()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add( _hfExpanded );
            _hfExpanded.ID = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "filter-expanded";
            _hfExpanded.Value = "False";

            _hfFormGuid = new HiddenField();
            Controls.Add( _hfFormGuid );
            _hfFormGuid.ID = this.ID + "_hfFormGuid";

            _hfFormId = new HiddenField();
            Controls.Add( _hfFormId );
            _hfFormId.ID = this.ID + "_hfFormId";

            _lblFormName = new Label();
            Controls.Add( _lblFormName );
            _lblFormName.ClientIDMode = ClientIDMode.Static;
            _lblFormName.ID = this.ID + "_lblFormName";

            _lbDeleteForm = new LinkButton();
            Controls.Add( _lbDeleteForm );
            _lbDeleteForm.CausesValidation = false;
            _lbDeleteForm.ID = this.ID + "_lbDeleteForm";
            _lbDeleteForm.CssClass = "btn btn-xs btn-danger js-activity-delete";
            _lbDeleteForm.Click += lbDeleteForm_Click;
            _lbDeleteForm.Controls.Add( new LiteralControl { Text = "<i class='fa fa-times'></i>" } );

            _tbFormName = new RockTextBox();
            Controls.Add( _tbFormName );
            _tbFormName.ID = this.ID + "_tbFormName";
            _tbFormName.Label = "Form Name";
            _tbFormName.Required = true;
            _tbFormName.Attributes["onblur"] = string.Format( "javascript: $('#{0}').text($(this).val());", _lblFormName.ID );

            _gFields = new Grid();
            Controls.Add( _gFields );
            _gFields.ID = this.ID + "_gFields";
            _gFields.AllowPaging = false;
            _gFields.DisplayType = GridDisplayType.Light;
            _gFields.RowItemText = "Field";
            _gFields.AddCssClass( "field-grid" );
            _gFields.DataKeyNames = new string[] { "Guid" };
            _gFields.Actions.ShowAdd = true;
            _gFields.Actions.AddClick += gFields_Add;
            _gFields.GridRebind += gFields_Rebind;
            _gFields.GridReorder += gFields_Reorder;

            var reorderField = new ReorderField();
            _gFields.Columns.Add( reorderField );

            var nameField = new BoundField();
            nameField.DataField = "Name";
            nameField.HeaderText = "Field";
            _gFields.Columns.Add( nameField );

            var sourceField = new EnumField();
            sourceField.DataField = "FieldSource";
            sourceField.HeaderText = "Source";
            _gFields.Columns.Add( sourceField );

            var typeField = new FieldTypeField();
            typeField.DataField = "FieldType";
            typeField.HeaderText = "Type";
            _gFields.Columns.Add( typeField );

            var isInternalField = new BoolField();
            isInternalField.DataField = "IsInternal";
            isInternalField.HeaderText = "Internal";
            _gFields.Columns.Add( isInternalField );

            var isSharedValueField = new BoolField();
            isSharedValueField.DataField = "IsSharedValue";
            isSharedValueField.HeaderText = "Common";
            _gFields.Columns.Add( isSharedValueField );

            var showCurrentValueField = new BoolField();
            showCurrentValueField.DataField = "ShowCurrentValue";
            showCurrentValueField.HeaderText = "Use Current Value";
            _gFields.Columns.Add( showCurrentValueField );

            var isRequiredField = new BoolField();
            isRequiredField.DataField = "IsRequired";
            isRequiredField.HeaderText = "Required";
            _gFields.Columns.Add( isRequiredField );

            var isGridField = new BoolField();
            isGridField.DataField = "IsGridField";
            isGridField.HeaderText = "Show on Grid";
            _gFields.Columns.Add( isGridField );

            var editField = new EditField();
            editField.Click += gFields_Edit;
            _gFields.Columns.Add( editField );

            var delField = new DeleteField();
            delField.Click += gFields_Delete;
            _gFields.Columns.Add( delField );
        }
예제 #19
0
        /// <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();

            _hfItemId          = new HiddenFieldWithClass();
            _hfItemId.ID       = this.ID + "_hfItemId";
            _hfItemId.CssClass = "js-item-id-value";
            _hfItemId.Value    = "0";

            _hfInitialItemParentIds          = new HiddenFieldWithClass();
            _hfInitialItemParentIds.ID       = this.ID + "_hfInitialItemParentIds";
            _hfInitialItemParentIds.CssClass = "js-initial-item-parent-ids-value";

            _hfItemName          = new HiddenFieldWithClass();
            _hfItemName.ID       = this.ID + "_hfItemName";
            _hfItemName.CssClass = "js-item-name-value";

            _hfItemRestUrlExtraParams          = new HiddenFieldWithClass();
            _hfItemRestUrlExtraParams.ID       = this.ID + "_hfItemRestUrlExtraParams";
            _hfItemRestUrlExtraParams.CssClass = "js-item-rest-url-extra-params-value";

            if (ModePanel != null)
            {
                this.Controls.Add(ModePanel);
            }

            _btnSelect = new HtmlAnchor();
            _btnSelect.Attributes["class"] = "btn btn-xs btn-primary picker-btn";
            _btnSelect.ID               = this.ID + "_btnSelect";
            _btnSelect.InnerText        = "Select";
            _btnSelect.CausesValidation = false;

            // make sure PagePicker always does a postback, even if _selectItem is not assigned
            if (_selectItem == null && (this is PagePicker))
            {
                _btnSelect.ServerClick += btnSelect_Click;
            }

            _btnSelectNone = new HtmlAnchor();
            _btnSelectNone.Attributes["class"] = "picker-select-none";
            _btnSelectNone.ID               = this.ID + "_btnSelectNone";
            _btnSelectNone.InnerHtml        = "<i class='fa fa-times'></i>";
            _btnSelectNone.CausesValidation = false;
            _btnSelectNone.Style[HtmlTextWriterStyle.Display] = "none";

            // make sure PagePicker always does a postback, even if _selectItem is not assigned
            if (_selectItem == null && (this is PagePicker))
            {
                _btnSelectNone.ServerClick += btnSelect_Click;
            }

            Controls.Add(_hfItemId);
            Controls.Add(_hfInitialItemParentIds);
            Controls.Add(_hfItemName);
            Controls.Add(_hfItemRestUrlExtraParams);
            Controls.Add(_btnSelect);
            Controls.Add(_btnSelectNone);

            RockControlHelper.CreateChildControls(this, Controls);

            RequiredFieldValidator.InitialValue      = "0";
            RequiredFieldValidator.ControlToValidate = _hfItemId.ID;
            RequiredFieldValidator.Display           = ValidatorDisplay.Dynamic;
        }
예제 #20
0
        /// <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()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add(_hfExpanded);
            _hfExpanded.ID       = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "filter-expanded";
            _hfExpanded.Value    = "False";

            _hfFormGuid = new HiddenField();
            Controls.Add(_hfFormGuid);
            _hfFormGuid.ID = this.ID + "_hfFormGuid";

            _hfFormId = new HiddenField();
            Controls.Add(_hfFormId);
            _hfFormId.ID = this.ID + "_hfFormId";

            _lblFormName = new Label();
            Controls.Add(_lblFormName);
            _lblFormName.ClientIDMode = ClientIDMode.Static;
            _lblFormName.ID           = this.ID + "_lblFormName";

            _lbDeleteForm = new LinkButton();
            Controls.Add(_lbDeleteForm);
            _lbDeleteForm.CausesValidation = false;
            _lbDeleteForm.ID       = this.ID + "_lbDeleteForm";
            _lbDeleteForm.CssClass = "btn btn-xs btn-danger js-activity-delete";
            _lbDeleteForm.Click   += lbDeleteForm_Click;
            _lbDeleteForm.Controls.Add(new LiteralControl {
                Text = "<i class='fa fa-times'></i>"
            });

            _tbFormName = new RockTextBox();
            Controls.Add(_tbFormName);
            _tbFormName.ID                   = this.ID + "_tbFormName";
            _tbFormName.Label                = "Form Name";
            _tbFormName.Required             = true;
            _tbFormName.Attributes["onblur"] = string.Format("javascript: $('#{0}').text($(this).val());", _lblFormName.ID);

            _gFields = new Grid();
            Controls.Add(_gFields);
            _gFields.ID          = this.ID + "_gFields";
            _gFields.AllowPaging = false;
            _gFields.DisplayType = GridDisplayType.Light;
            _gFields.RowItemText = "Field";
            _gFields.AddCssClass("field-grid");
            _gFields.DataKeyNames      = new string[] { "Guid" };
            _gFields.Actions.ShowAdd   = true;
            _gFields.Actions.AddClick += gFields_Add;
            _gFields.GridRebind       += gFields_Rebind;
            _gFields.GridReorder      += gFields_Reorder;

            var reorderField = new ReorderField();

            _gFields.Columns.Add(reorderField);

            var nameField = new BoundField();

            nameField.DataField  = "Name";
            nameField.HeaderText = "Field";
            _gFields.Columns.Add(nameField);

            var sourceField = new EnumField();

            sourceField.DataField  = "FieldSource";
            sourceField.HeaderText = "Source";
            _gFields.Columns.Add(sourceField);

            var typeField = new FieldTypeField();

            typeField.DataField  = "FieldType";
            typeField.HeaderText = "Type";
            _gFields.Columns.Add(typeField);

            var isInternalField = new BoolField();

            isInternalField.DataField  = "IsInternal";
            isInternalField.HeaderText = "Internal";
            _gFields.Columns.Add(isInternalField);

            var isSharedValueField = new BoolField();

            isSharedValueField.DataField  = "IsSharedValue";
            isSharedValueField.HeaderText = "Common";
            _gFields.Columns.Add(isSharedValueField);

            var showCurrentValueField = new BoolField();

            showCurrentValueField.DataField  = "ShowCurrentValue";
            showCurrentValueField.HeaderText = "Use Current Value";
            _gFields.Columns.Add(showCurrentValueField);

            var isRequiredField = new BoolField();

            isRequiredField.DataField  = "IsRequired";
            isRequiredField.HeaderText = "Required";
            _gFields.Columns.Add(isRequiredField);

            var isGridField = new BoolField();

            isGridField.DataField  = "IsGridField";
            isGridField.HeaderText = "Show on Grid";
            _gFields.Columns.Add(isGridField);

            var showOnWaitListField = new BoolField();

            showOnWaitListField.DataField  = "ShowOnWaitlist";
            showOnWaitListField.HeaderText = "Show on Wait List";
            _gFields.Columns.Add(showOnWaitListField);

            var editField = new EditField();

            editField.Click += gFields_Edit;
            _gFields.Columns.Add(editField);

            var delField = new DeleteField();

            delField.Click += gFields_Delete;
            _gFields.Columns.Add(delField);
        }
        /// <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()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add(_hfExpanded);
            _hfExpanded.ID       = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "filter-expanded";
            _hfExpanded.Value    = "False";

            _hfActionTypeGuid = new HiddenField();
            Controls.Add(_hfActionTypeGuid);
            _hfActionTypeGuid.ID = this.ID + "_hfActionTypeGuid";

            _lblActionTypeName = new Label();
            Controls.Add(_lblActionTypeName);
            _lblActionTypeName.ClientIDMode = ClientIDMode.Static;
            _lblActionTypeName.ID           = this.ID + "_lblActionTypeName";

            _lbDeleteActionType = new LinkButton();
            Controls.Add(_lbDeleteActionType);
            _lbDeleteActionType.CausesValidation = false;
            _lbDeleteActionType.ID       = this.ID + "_lbDeleteActionType";
            _lbDeleteActionType.CssClass = "btn btn-xs btn-danger js-action-delete";
            _lbDeleteActionType.Click   += lbDeleteActionType_Click;

            var iDelete = new HtmlGenericControl("i");

            _lbDeleteActionType.Controls.Add(iDelete);
            iDelete.AddCssClass("fa fa-times");

            _ddlCriteriaAttribute = new RockDropDownList();
            Controls.Add(_ddlCriteriaAttribute);
            _ddlCriteriaAttribute.ID       = this.ID + "_ddlCriteriaAttribute";
            _ddlCriteriaAttribute.CssClass = "js-conditional-run-criteria";
            _ddlCriteriaAttribute.Label    = "Run If";
            _ddlCriteriaAttribute.Help     = "Optional criteria to prevent the action from running.  If the criteria is not met, this action will be skipped when this activity is processed.";

            _ddlCriteriaComparisonType = new RockDropDownList();
            Controls.Add(_ddlCriteriaComparisonType);
            _ddlCriteriaComparisonType.ID       = this.ID + "_ddlCriteriaComparisonType";
            _ddlCriteriaComparisonType.CssClass = "js-action-criteria-comparison";
            _ddlCriteriaComparisonType.BindToEnum <ComparisonType>();
            _ddlCriteriaComparisonType.Label = "&nbsp;";

            _tbddlCriteriaValue = new RockTextOrDropDownList();
            Controls.Add(_tbddlCriteriaValue);
            _tbddlCriteriaValue.ID                 = this.ID + "_tbddlCriteriaValue";
            _tbddlCriteriaValue.TextBox.Label      = "Text Value";
            _tbddlCriteriaValue.DropDownList.Label = "Attribute Value";

            _tbActionTypeName = new RockTextBox();
            Controls.Add(_tbActionTypeName);
            _tbActionTypeName.ID                   = this.ID + "_tbActionTypeName";
            _tbActionTypeName.Label                = "Name";
            _tbActionTypeName.Required             = true;
            _tbActionTypeName.Attributes["onblur"] = string.Format("javascript: $('#{0}').text($(this).val());", _lblActionTypeName.ID);

            _ddlEntityType = new RockDropDownList();
            Controls.Add(_ddlEntityType);
            _ddlEntityType.ID    = this.ID + "_ddlEntityType";
            _ddlEntityType.Label = "Action Type";

            // make it autopostback since Attributes are dependant on which EntityType is selected
            _ddlEntityType.AutoPostBack          = true;
            _ddlEntityType.SelectedIndexChanged += ddlEntityType_SelectedIndexChanged;

            foreach (var item in ActionContainer.Instance.Components.Values.OrderBy(a => a.Value.EntityType.FriendlyName))
            {
                var type = item.Value.GetType();
                if (type != null)
                {
                    var entityType = EntityTypeCache.Read(type);
                    var li         = new ListItem(entityType.FriendlyName, entityType.Id.ToString());

                    // Get description
                    string description    = string.Empty;
                    var    descAttributes = type.GetCustomAttributes(typeof(System.ComponentModel.DescriptionAttribute), false);
                    if (descAttributes != null)
                    {
                        foreach (System.ComponentModel.DescriptionAttribute descAttribute in descAttributes)
                        {
                            description = descAttribute.Description;
                        }
                    }
                    if (!string.IsNullOrWhiteSpace(description))
                    {
                        li.Attributes.Add("title", description);
                    }

                    _ddlEntityType.Items.Add(li);
                }
            }

            _cbIsActionCompletedOnSuccess = new RockCheckBox {
                Text = "Action is Completed on Success"
            };
            Controls.Add(_cbIsActionCompletedOnSuccess);
            _cbIsActionCompletedOnSuccess.ID = this.ID + "_cbIsActionCompletedOnSuccess";

            _cbIsActivityCompletedOnSuccess = new RockCheckBox {
                Text = "Activity is Completed on Success"
            };
            Controls.Add(_cbIsActivityCompletedOnSuccess);
            _cbIsActivityCompletedOnSuccess.ID = this.ID + "_cbIsActivityCompletedOnSuccess";

            _formEditor = new WorkflowFormEditor();
            Controls.Add(_formEditor);
            _formEditor.ID = this.ID + "_formEditor";

            _phActionAttributes = new PlaceHolder();
            Controls.Add(_phActionAttributes);
            _phActionAttributes.ID = this.ID + "_phActionAttributes";
        }
예제 #22
0
        /// <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 );

            _hfMin = new HiddenFieldWithClass();
            _hfMin.ID = string.Format( "{0}_hfMin", this.ID );
            _hfMin.CssClass = "js-number-up-down-min";
            _hfMin.Value = int.MinValue.ToString();
            Controls.Add( _hfMin );

            _hfMax = new HiddenFieldWithClass();
            _hfMax.ID = string.Format( "{0}_hfMax", this.ID );
            _hfMax.CssClass = "js-number-up-down-max";
            _hfMax.Value = int.MaxValue.ToString();
            Controls.Add( _hfMax );

            _hfNumber = new HiddenFieldWithClass();
            _hfNumber.ID = string.Format( "{0}_hfNumber", this.ID );
            _hfNumber.CssClass = "js-number-up-down-value";
            _hfNumber.Value = "0";
            Controls.Add( _hfNumber );

            _lblNumber = new Label();
            _lblNumber.ID = string.Format( "{0}_lblNumber", this.ID );
            Controls.Add( _lblNumber );

            RequiredFieldValidator.InitialValue = string.Empty;
            RequiredFieldValidator.ControlToValidate = _hfNumber.ID;
        }
예제 #23
0
        /// <summary>
        /// Adds the field panel widget.
        /// </summary>
        /// <param name="reportFieldGuid">The report field unique identifier.</param>
        /// <param name="reportFieldType">Type of the report field.</param>
        /// <param name="fieldSelection">The field selection.</param>
        /// <param name="showExpanded">if set to <c>true</c> [show expanded].</param>
        /// <param name="rockContext">The rock context.</param>
        /// <param name="setReportFieldValues">if set to <c>true</c> [set report field values].</param>
        /// <param name="reportField">The report field.</param>
        private void AddFieldPanelWidget( Guid reportFieldGuid, ReportFieldType reportFieldType, string fieldSelection, bool showExpanded, RockContext rockContext, bool setReportFieldValues = false, ReportField reportField = null )
        {
            PanelWidget panelWidget = new PanelWidget();
            panelWidget.ID = string.Format( "reportFieldWidget_{0}", reportFieldGuid.ToString( "N" ) );

            panelWidget.ShowDeleteButton = true;
            panelWidget.DeleteClick += FieldsPanelWidget_DeleteClick;
            panelWidget.ShowReorderIcon = true;
            panelWidget.Expanded = showExpanded;

            HiddenFieldWithClass hfReportFieldGuid = new HiddenFieldWithClass();
            hfReportFieldGuid.CssClass = "js-report-field-guid";
            hfReportFieldGuid.ID = panelWidget.ID + "_hfReportFieldGuid";
            hfReportFieldGuid.Value = reportFieldGuid.ToString();
            panelWidget.Controls.Add( hfReportFieldGuid );

            Label lbFields = new Label();
            lbFields.Text = "Field Type";

            RockDropDownList ddlFields = new RockDropDownList();
            panelWidget.Controls.Add( ddlFields );
            ddlFields.ID = panelWidget.ID + "_ddlFields";
            ddlFields.AutoPostBack = true;
            ddlFields.SelectedIndexChanged += ddlFields_SelectedIndexChanged;

            panelWidget.HeaderControls = new Control[2] { lbFields, ddlFields };
            this.LoadFieldsDropDown( ddlFields );

            RockCheckBox showInGridCheckBox = new RockCheckBox();
            showInGridCheckBox.ID = panelWidget.ID + "_showInGridCheckBox";
            showInGridCheckBox.Text = "Show in Grid";

            panelWidget.Controls.Add( showInGridCheckBox );

            RockTextBox columnHeaderTextTextBox = new RockTextBox();
            columnHeaderTextTextBox.ID = panelWidget.ID + "_columnHeaderTextTextBox";
            columnHeaderTextTextBox.Label = "Column Label";
            columnHeaderTextTextBox.CssClass = "js-column-header-textbox";
            panelWidget.Controls.Add( columnHeaderTextTextBox );

            phReportFields.Controls.Add( panelWidget );

            CreateFieldTypeSpecificControls( reportFieldType, fieldSelection, panelWidget, rockContext );

            if ( setReportFieldValues )
            {
                PopulateFieldPanelWidget( panelWidget, reportField, reportFieldType, fieldSelection, rockContext );
            }
        }
        /// <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()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add( _hfExpanded );
            _hfExpanded.ID = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "filter-expanded";
            _hfExpanded.Value = "False";

            _hfActivityTypeGuid = new HiddenField();
            Controls.Add( _hfActivityTypeGuid );
            _hfActivityTypeGuid.ID = this.ID + "_hfActivityTypeGuid";

            _lblActivityTypeName = new Label();
            Controls.Add( _lblActivityTypeName );
            _lblActivityTypeName.ClientIDMode = ClientIDMode.Static;
            _lblActivityTypeName.ID = this.ID + "_lblActivityTypeName";

            _lblActivityTypeDescription = new Label();
            Controls.Add( _lblActivityTypeDescription );
            _lblActivityTypeDescription.ClientIDMode = ClientIDMode.Static;
            _lblActivityTypeDescription.ID = this.ID + "_lblActivityTypeDescription";

            _lblInactive = new Label();
            Controls.Add( _lblInactive );
            _lblInactive.ClientIDMode = ClientIDMode.Static;
            _lblInactive.ID = this.ID + "_lblInactive";
            _lblInactive.CssClass = "pull-right";
            _lblInactive.Text = "<span class='label label-danger'>Inactive</span>";

            _lbDeleteActivityType = new LinkButton();
            Controls.Add( _lbDeleteActivityType );
            _lbDeleteActivityType.CausesValidation = false;
            _lbDeleteActivityType.ID = this.ID + "_lbDeleteActivityType";
            _lbDeleteActivityType.CssClass = "btn btn-xs btn-danger js-activity-delete";
            _lbDeleteActivityType.Click += lbDeleteActivityType_Click;
            _lbDeleteActivityType.Controls.Add( new LiteralControl { Text = "<i class='fa fa-times'></i>" } );

            _sbSecurity = new SecurityButton();
            Controls.Add( _sbSecurity );
            _sbSecurity.ID = this.ID + "_sbSecurity";
            _sbSecurity.Attributes["class"] = "btn btn-security btn-xs security pull-right";
            _sbSecurity.EntityTypeId = EntityTypeCache.Read( typeof( Rock.Model.WorkflowActivityType ) ).Id;

            _cbActivityTypeIsActive = new RockCheckBox { Text = "Active" };
            Controls.Add( _cbActivityTypeIsActive );
            _cbActivityTypeIsActive.ID = this.ID + "_cbActivityTypeIsActive";
            string checkboxScriptFormat = @"
            javascript:
            if ($(this).is(':checked')) {{
            $('#{0}').hide();
            $('#{1}').removeClass('workflow-activity-inactive');
            }}
            else {{
            $('#{0}').show();
            $('#{1}').addClass('workflow-activity-inactive');
            }}
            ";

            _cbActivityTypeIsActive.InputAttributes.Add( "onclick", string.Format( checkboxScriptFormat, _lblInactive.ID, this.ID + "_section" ) );

            _tbActivityTypeName = new RockTextBox();
            Controls.Add( _tbActivityTypeName );
            _tbActivityTypeName.ID = this.ID + "_tbActivityTypeName";
            _tbActivityTypeName.Label = "Name";
            _tbActivityTypeName.Required = true;
            _tbActivityTypeName.Attributes["onblur"] = string.Format( "javascript: $('#{0}').text($(this).val());", _lblActivityTypeName.ID );

            _tbActivityTypeDescription = new RockTextBox();
            Controls.Add( _tbActivityTypeDescription );
            _tbActivityTypeDescription.ID = this.ID + "_tbActivityTypeDescription";
            _tbActivityTypeDescription.Label = "Description";
            _tbActivityTypeDescription.TextMode = TextBoxMode.MultiLine;
            _tbActivityTypeDescription.Rows = 2;
            _tbActivityTypeDescription.Attributes["onblur"] = string.Format( "javascript: $('#{0}').text($(this).val());", _lblActivityTypeDescription.ID );

            _cbActivityTypeIsActivatedWithWorkflow = new RockCheckBox { Text = "Activated with Workflow" };
            Controls.Add( _cbActivityTypeIsActivatedWithWorkflow );
            _cbActivityTypeIsActivatedWithWorkflow.ID = this.ID + "_cbActivityTypeIsActivatedWithWorkflow";
            checkboxScriptFormat = @"
            javascript:
            if ($(this).is(':checked')) {{
            $('#{0}').addClass('activated-with-workflow');
            }}
            else {{
            $('#{0}').removeClass('activated-with-workflow');
            }}
            ";
            _cbActivityTypeIsActivatedWithWorkflow.InputAttributes.Add( "onclick", string.Format( checkboxScriptFormat, this.ID + "_section" ) );

            _lbAddActionType = new LinkButton();
            Controls.Add( _lbAddActionType );
            _lbAddActionType.ID = this.ID + "_lbAddAction";
            _lbAddActionType.CssClass = "btn btn-xs btn-action";
            _lbAddActionType.Click += lbAddActionType_Click;
            _lbAddActionType.CausesValidation = false;
            _lbAddActionType.Controls.Add( new LiteralControl { Text = "<i class='fa fa-plus'></i> Add Action" } );

            _pwAttributes = new PanelWidget();
            Controls.Add( _pwAttributes );
            _pwAttributes.ID = this.ID + "_pwAttributes";
            _pwAttributes.Title = "Activity Attributes";
            _pwAttributes.CssClass = "attribute-panel";

            _gAttributes = new Grid();
            _pwAttributes.Controls.Add( _gAttributes );
            _gAttributes.ID = this.ID + "_gAttributes";
            _gAttributes.AllowPaging = false;
            _gAttributes.DisplayType = GridDisplayType.Light;
            _gAttributes.RowItemText = "Activity Attribute";
            _gAttributes.AddCssClass( "attribute-grid" );
            _gAttributes.DataKeyNames = new string[] { "Guid" };
            _gAttributes.Actions.ShowAdd = true;
            _gAttributes.Actions.AddClick += gAttributes_Add;
            _gAttributes.GridRebind += gAttributes_Rebind;
            _gAttributes.GridReorder += gAttributes_Reorder;

            var reorderField = new ReorderField();
            _gAttributes.Columns.Add( reorderField );

            var nameField = new BoundField();
            nameField.DataField = "Name";
            nameField.HeaderText = "Attribute";
            _gAttributes.Columns.Add( nameField );

            var descField = new BoundField();
            descField.DataField = "Description";
            descField.HeaderText = "Description";
            _gAttributes.Columns.Add( descField );

            var fieldTypeField = new BoundField();
            fieldTypeField.DataField = "FieldType";
            fieldTypeField.HeaderText = "Field Type";
            _gAttributes.Columns.Add( fieldTypeField );

            var reqField = new BoolField();
            reqField.DataField = "IsRequired";
            reqField.HeaderText = "Required";
            _gAttributes.Columns.Add( reqField );

            var editField = new EditField();
            editField.Click += gAttributes_Edit;
            _gAttributes.Columns.Add( editField );

            var delField = new DeleteField();
            delField.Click += gAttributes_Delete;
            _gAttributes.Columns.Add( delField );
        }
예제 #25
0
        /// <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()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add(_hfExpanded);
            _hfExpanded.ID       = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "filter-expanded";
            _hfExpanded.Value    = "False";

            _hfActionTypeGuid = new HiddenField();
            Controls.Add(_hfActionTypeGuid);
            _hfActionTypeGuid.ID = this.ID + "_hfActionTypeGuid";

            _lblActionTypeName = new Label();
            Controls.Add(_lblActionTypeName);
            _lblActionTypeName.ClientIDMode = ClientIDMode.Static;
            _lblActionTypeName.ID           = this.ID + "_lblActionTypeName";

            _lbDeleteActionType = new LinkButton();
            Controls.Add(_lbDeleteActionType);
            _lbDeleteActionType.CausesValidation = false;
            _lbDeleteActionType.ID       = this.ID + "_lbDeleteActionType";
            _lbDeleteActionType.CssClass = "btn btn-xs btn-square btn-danger js-action-delete";
            _lbDeleteActionType.Click   += lbDeleteActionType_Click;

            var iDelete = new HtmlGenericControl("i");

            _lbDeleteActionType.Controls.Add(iDelete);
            iDelete.AddCssClass("fa fa-times");

            _ddlCriteriaAttribute = new RockDropDownList();
            Controls.Add(_ddlCriteriaAttribute);
            _ddlCriteriaAttribute.ID = this.ID + "_ddlCriteriaAttribute";
            _ddlCriteriaAttribute.EnableViewState = false;
            _ddlCriteriaAttribute.CssClass        = "js-conditional-run-criteria";
            _ddlCriteriaAttribute.Label           = "Run If";
            _ddlCriteriaAttribute.Help            = "Optional criteria to prevent the action from running.  If the criteria is not met, this action will be skipped when this activity is processed.";

            _ddlCriteriaComparisonType = new RockDropDownList();
            Controls.Add(_ddlCriteriaComparisonType);
            _ddlCriteriaComparisonType.ID = this.ID + "_ddlCriteriaComparisonType";
            _ddlCriteriaComparisonType.EnableViewState = false;
            _ddlCriteriaComparisonType.CssClass        = "js-action-criteria-comparison";
            _ddlCriteriaComparisonType.BindToEnum <ComparisonType>();
            _ddlCriteriaComparisonType.Label = "&nbsp;";

            _tbddlCriteriaValue = new RockTextOrDropDownList();
            Controls.Add(_tbddlCriteriaValue);
            _tbddlCriteriaValue.ID = this.ID + "_tbddlCriteriaValue";
            _tbddlCriteriaValue.EnableViewState    = false;
            _tbddlCriteriaValue.TextBox.Label      = "Text Value";
            _tbddlCriteriaValue.DropDownList.Label = "Attribute Value";

            _tbActionTypeName = new RockTextBox();
            Controls.Add(_tbActionTypeName);
            _tbActionTypeName.ID                   = this.ID + "_tbActionTypeName";
            _tbActionTypeName.Label                = "Name";
            _tbActionTypeName.Required             = true;
            _tbActionTypeName.Attributes["onblur"] = string.Format("javascript: $('#{0}').text($(this).val());", _lblActionTypeName.ID);

            _wfatpEntityType             = new WorkflowActionTypePicker();
            _wfatpEntityType.SelectItem += wfatpEntityType_SelectItem;
            Controls.Add(_wfatpEntityType);
            _wfatpEntityType.ID    = this.ID + "_wfatpEntityType";
            _wfatpEntityType.Label = "Action Type";

            _rlEntityTypeOverview = new RockLiteral();
            Controls.Add(_rlEntityTypeOverview);
            _rlEntityTypeOverview.ID    = this.ID + "";
            _rlEntityTypeOverview.Label = "Action Type Overview";

            _cbIsActionCompletedOnSuccess = new RockCheckBox {
                Text = "Action is Completed on Success"
            };
            Controls.Add(_cbIsActionCompletedOnSuccess);
            _cbIsActionCompletedOnSuccess.ID = this.ID + "_cbIsActionCompletedOnSuccess";

            _cbIsActivityCompletedOnSuccess = new RockCheckBox {
                Text = "Activity is Completed on Success"
            };
            Controls.Add(_cbIsActivityCompletedOnSuccess);
            _cbIsActivityCompletedOnSuccess.ID = this.ID + "_cbIsActivityCompletedOnSuccess";

            _formEditor = new WorkflowFormEditor();
            Controls.Add(_formEditor);
            _formEditor.ID = this.ID + "_formEditor";

            _phActionAttributes = new PlaceHolder();
            Controls.Add(_phActionAttributes);
            _phActionAttributes.ID = this.ID + "_phActionAttributes";
        }
예제 #26
0
        /// <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();

            _hfMetricId = new HiddenField();
            _hfMetricId.ID = string.Format( "hfMetricId_{0}", this.ID );

            _hfXAxisLabel = new HiddenFieldWithClass();
            _hfXAxisLabel.ID = string.Format( "hfXAxisLabel_{0}", this.ID );
            _hfXAxisLabel.CssClass = "js-xaxis-value";

            _hfYAxisLabel = new HiddenFieldWithClass();
            _hfYAxisLabel.ID = string.Format( "hfYAxisLabel_{0}", this.ID );
            _hfYAxisLabel.CssClass = "js-yaxis-value";

            _hfRestUrlParams = new HiddenFieldWithClass();
            _hfRestUrlParams.ID = string.Format( "hfRestUrlParams_{0}", this.ID );
            _hfRestUrlParams.CssClass = "js-rest-url-params";

            _hfRestUrl = new HiddenFieldWithClass();
            _hfRestUrl.ID = string.Format( "hfRestUrl_{0}", this.ID );
            _hfRestUrl.CssClass = "js-rest-url";

            _hfSeriesNameUrl = new HiddenFieldWithClass();
            _hfSeriesNameUrl.ID = string.Format( "hfSeriesNameUrl_{0}", this.ID );
            _hfSeriesNameUrl.CssClass = "js-seriesname-url";

            _lblChartTitle = new Label();
            _lblChartTitle.ID = string.Format( "lblChartTitle_{0}", this.ID );

            _lblChartSubtitle = new Label();
            _lblChartSubtitle.ID = string.Format( "lblChartSubtitle_{0}", this.ID );

            _pnlChartPlaceholder = new Panel();
            _pnlChartPlaceholder.CssClass = "chart-placeholder js-chart-placeholder";
            _pnlChartPlaceholder.ID = string.Format( "pnlChartPlaceholder_{0}", this.ID );

            _hbChartOptions = new HelpBlock();
            _hbChartOptions.ID = string.Format( "hbChartOptions_{0}", this.ID );

            Controls.Add( _hfMetricId );
            Controls.Add( _hfXAxisLabel );
            Controls.Add( _hfYAxisLabel );
            Controls.Add( _hfRestUrlParams );
            Controls.Add( _hfRestUrl );
            Controls.Add( _hfSeriesNameUrl );
            Controls.Add( _lblChartTitle );
            Controls.Add( _lblChartSubtitle );
            Controls.Add( _pnlChartPlaceholder );
            Controls.Add( _hbChartOptions );
        }
예제 #27
0
        /// <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()
        {
            Controls.Clear();

            _hfChecked = new HiddenFieldWithClass();
            _hfChecked.CssClass = "js-toggle-checked";
            _hfChecked.ID = this.ID + "_hfChecked";

            _btnOn = new HtmlAnchor();
            _btnOn.ID = this.ID + "_btnOn";

            _btnOff = new HtmlAnchor();
            _btnOff.ID = this.ID + "_btnOff";

            Controls.Add( _hfChecked );
            Controls.Add( _btnOn );
            Controls.Add( _btnOff );
        }
예제 #28
0
        /// <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();

            _tbNote                    = new RockTextBox();
            _hfNoteId                  = new HiddenFieldWithClass();
            _tbNote.Placeholder        = "Write a note...";
            _ddlNoteType               = new DropDownList();
            _hfHasUnselectableNoteType = new HiddenFieldWithClass();
            _cbAlert                   = new CheckBox();
            _cbPrivate                 = new CheckBox();
            _lbSaveNote                = new LinkButton();
            _aSecurity                 = new HtmlAnchor();
            _dtCreateDate              = new DateTimePicker();
            _hfParentNoteId            = new HiddenFieldWithClass();
            _mdEditWarning             = new ModalAlert();

            _hfNoteId.ID       = this.ID + "_hfNoteId";
            _hfNoteId.CssClass = "js-noteid";
            Controls.Add(_hfNoteId);

            _hfParentNoteId.ID       = this.ID + "_hfParentNoteId";
            _hfParentNoteId.CssClass = "js-parentnoteid";
            Controls.Add(_hfParentNoteId);

            _tbNote.ID                  = this.ID + "_tbNewNote";
            _tbNote.TextMode            = TextBoxMode.MultiLine;
            _tbNote.Rows                = 3;
            _tbNote.CssClass            = "js-notetext";
            _tbNote.ValidateRequestMode = ValidateRequestMode.Disabled;
            Controls.Add(_tbNote);

            _ddlNoteType.ID             = this.ID + "_ddlNoteType";
            _ddlNoteType.CssClass       = "form-control input-sm input-width-lg noteentry-notetype js-notenotetype";
            _ddlNoteType.DataValueField = "Id";
            _ddlNoteType.DataTextField  = "Name";
            Controls.Add(_ddlNoteType);

            _hfHasUnselectableNoteType.ID       = this.ID + "_hfHasUnselectableNoteType";
            _hfHasUnselectableNoteType.CssClass = "js-has-unselectable-notetype";
            Controls.Add(_hfHasUnselectableNoteType);

            _cbAlert.ID       = this.ID + "_cbAlert";
            _cbAlert.Text     = "Alert";
            _cbAlert.CssClass = "js-notealert";
            Controls.Add(_cbAlert);

            _cbPrivate.ID       = this.ID + "_cbPrivate";
            _cbPrivate.Text     = "Private";
            _cbPrivate.CssClass = "js-noteprivate";
            Controls.Add(_cbPrivate);

            _mdEditWarning.ID = this.ID + "_mdEditWarning";
            Controls.Add(_mdEditWarning);

            _lbSaveNote.ID = this.ID + "_lbSaveNote";
            _lbSaveNote.Attributes["class"] = "btn btn-primary btn-xs";
            _lbSaveNote.CausesValidation    = false;
            _lbSaveNote.Click += lbSaveNote_Click;

            Controls.Add(_lbSaveNote);

            _aSecurity.ID = "_aSecurity";
            _aSecurity.Attributes["class"] = "btn btn-security btn-xs btn-square security js-notesecurity";
            _aSecurity.Attributes["data-entitytype-id"] = EntityTypeCache.Get(typeof(Rock.Model.Note)).Id.ToString();
            _aSecurity.InnerHtml = "<i class='fa fa-lock'></i>";
            Controls.Add(_aSecurity);

            _dtCreateDate.ID    = this.ID + "_tbCreateDate";
            _dtCreateDate.Label = "Note Created Date";
            Controls.Add(_dtCreateDate);
        }
        /// <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()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add( _hfExpanded );
            _hfExpanded.ID = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "filter-expanded";
            _hfExpanded.Value = "False";

            _hfActionTypeGuid = new HiddenField();
            Controls.Add( _hfActionTypeGuid );
            _hfActionTypeGuid.ID = this.ID + "_hfActionTypeGuid";

            _lblActionTypeName = new Label();
            Controls.Add( _lblActionTypeName );
            _lblActionTypeName.ClientIDMode = ClientIDMode.Static;
            _lblActionTypeName.ID = this.ID + "_lblActionTypeName";

            _lbDeleteActionType = new LinkButton();
            Controls.Add( _lbDeleteActionType );
            _lbDeleteActionType.CausesValidation = false;
            _lbDeleteActionType.ID = this.ID + "_lbDeleteActionType";
            _lbDeleteActionType.CssClass = "btn btn-xs btn-danger js-action-delete";
            _lbDeleteActionType.Click += lbDeleteActionType_Click;

            var iDelete = new HtmlGenericControl( "i" );
            _lbDeleteActionType.Controls.Add( iDelete );
            iDelete.AddCssClass( "fa fa-times" );

            _ddlCriteriaAttribute = new RockDropDownList();
            Controls.Add( _ddlCriteriaAttribute );
            _ddlCriteriaAttribute.ID = this.ID + "_ddlCriteriaAttribute";
            _ddlCriteriaAttribute.CssClass = "js-conditional-run-criteria";
            _ddlCriteriaAttribute.Label = "Run If";
            _ddlCriteriaAttribute.Help = "Optional criteria to prevent the action from running.  If the criteria is not met, this action will be skipped when this activity is processed.";

            _ddlCriteriaComparisonType = new RockDropDownList();
            Controls.Add( _ddlCriteriaComparisonType );
            _ddlCriteriaComparisonType.ID = this.ID + "_ddlCriteriaComparisonType";
            _ddlCriteriaComparisonType.CssClass = "js-action-criteria-comparison";
            _ddlCriteriaComparisonType.BindToEnum<ComparisonType>();
            _ddlCriteriaComparisonType.Label = "&nbsp;";

            _tbddlCriteriaValue = new RockTextOrDropDownList();
            Controls.Add( _tbddlCriteriaValue );
            _tbddlCriteriaValue.ID = this.ID + "_tbddlCriteriaValue";
            _tbddlCriteriaValue.TextBox.Label = "Text Value";
            _tbddlCriteriaValue.DropDownList.Label = "Attribute Value";

            _tbActionTypeName = new RockTextBox();
            Controls.Add( _tbActionTypeName );
            _tbActionTypeName.ID = this.ID + "_tbActionTypeName";
            _tbActionTypeName.Label = "Name";
            _tbActionTypeName.Required = true;
            _tbActionTypeName.Attributes["onblur"] = string.Format( "javascript: $('#{0}').text($(this).val());", _lblActionTypeName.ID );

            _ddlEntityType = new RockDropDownList();
            Controls.Add( _ddlEntityType );
            _ddlEntityType.ID = this.ID + "_ddlEntityType";
            _ddlEntityType.Label = "Action Type";

            // make it autopostback since Attributes are dependant on which EntityType is selected
            _ddlEntityType.AutoPostBack = true;
            _ddlEntityType.SelectedIndexChanged += ddlEntityType_SelectedIndexChanged;

            foreach ( var item in ActionContainer.Instance.Components.Values.OrderBy( a => a.Value.EntityType.FriendlyName ) )
            {
                var type = item.Value.GetType();
                if (type != null)
                {
                    var entityType = EntityTypeCache.Read( type );
                    var li = new ListItem( entityType.FriendlyName, entityType.Id.ToString() );

                    // Get description
                    string description = string.Empty;
                    var descAttributes = type.GetCustomAttributes( typeof( System.ComponentModel.DescriptionAttribute ), false );
                    if ( descAttributes != null )
                    {
                        foreach ( System.ComponentModel.DescriptionAttribute descAttribute in descAttributes )
                        {
                            description = descAttribute.Description;
                        }
                    }
                    if ( !string.IsNullOrWhiteSpace( description ) )
                    {
                        li.Attributes.Add( "title", description );
                    }

                    _ddlEntityType.Items.Add( li );
                }
            }

            _cbIsActionCompletedOnSuccess = new RockCheckBox { Text = "Action is Completed on Success" };
            Controls.Add( _cbIsActionCompletedOnSuccess );
            _cbIsActionCompletedOnSuccess.ID = this.ID + "_cbIsActionCompletedOnSuccess";

            _cbIsActivityCompletedOnSuccess = new RockCheckBox { Text = "Activity is Completed on Success" };
            Controls.Add( _cbIsActivityCompletedOnSuccess );
            _cbIsActivityCompletedOnSuccess.ID = this.ID + "_cbIsActivityCompletedOnSuccess";

            _formEditor = new WorkflowFormEditor();
            Controls.Add( _formEditor );
            _formEditor.ID = this.ID + "_formEditor";

            _phActionAttributes = new PlaceHolder();
            Controls.Add( _phActionAttributes );
            _phActionAttributes.ID = this.ID + "_phActionAttributes";
        }
예제 #30
0
        /// <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();

            // main container
            _dialogPanel = new Panel();
            Controls.Add(_dialogPanel);
            _dialogPanel.ID       = "modal_dialog_panel";
            _dialogPanel.CssClass = "modal container modal-content rock-modal rock-modal-frame";

            _hfModalVisible          = new HiddenFieldWithClass();
            _hfModalVisible.CssClass = "js-modal-visible";
            _dialogPanel.Controls.Add(_hfModalVisible);

            // modal-header
            _headerPanel = new Panel();
            _dialogPanel.Controls.Add(_headerPanel);
            _headerPanel.CssClass = "modal-header";

            _closeLink = new HtmlGenericControl("button");
            _headerPanel.Controls.Add(_closeLink);
            _closeLink.ID = "closeLink";
            _closeLink.Attributes.Add("class", "close js-modaldialog-close-link");
            _closeLink.Attributes.Add("aria-hidden", "true");
            _closeLink.Attributes.Add("type", "button");
            _closeLink.Attributes.Add("data-dismiss", "modal");
            _closeLink.InnerHtml = "&times;";

            _titleH3 = new HtmlGenericControl("h3");
            _titleH3.AddCssClass("modal-title");
            _headerPanel.Controls.Add(_titleH3);

            // _title control for public this.Title
            _title      = new Literal();
            _title.Text = string.Empty;
            _titleH3.Controls.Add(_title);

            // _subtitle controls for public this.Subtitle
            _subtitleSmall = new HtmlGenericControl("small");
            _headerPanel.Controls.Add(_subtitleSmall);
            _subtitle      = new Literal();
            _subtitle.Text = string.Empty;
            _subtitleSmall.Controls.Add(_subtitle);

            // modal-body and content
            _bodyPanel          = new Panel();
            _bodyPanel.CssClass = "modal-body";
            _dialogPanel.Controls.Add(_bodyPanel);

            // for this.Content
            _contentPanel = new Panel();
            _bodyPanel.Controls.Add(_contentPanel);
            _contentPanel.ID = "contentPanel";

            // modal-footer
            _footerPanel = new Panel();
            _dialogPanel.Controls.Add(_footerPanel);
            _footerPanel.CssClass = "modal-footer";

            _cancelLink = new HtmlAnchor();
            _footerPanel.Controls.Add(_cancelLink);
            _cancelLink.ID = "cancelLink";
            _cancelLink.Attributes.Add("class", "btn btn-link js-modaldialog-cancel-link");
            _cancelLink.Attributes.Add("data-dismiss", "modal");
            _cancelLink.InnerText = "Cancel";

            _serverSaveLink = new HtmlAnchor();
            _footerPanel.Controls.Add(_serverSaveLink);
            _serverSaveLink.ID = "serverSaveLink";
            _serverSaveLink.Attributes.Add("class", "btn btn-primary");
            _serverSaveLink.ServerClick += SaveLink_ServerClick;

            _saveLink = new HtmlAnchor();
            _footerPanel.Controls.Add(_saveLink);
            _saveLink.ID = "saveLink";
            _saveLink.Attributes.Add("class", "btn btn-primary js-modaldialog-save-link");
        }
예제 #31
0
        /// <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();

            this.CssClass = "picker picker-select rollover-container";

            _hfLocationId = new HiddenField {
                ID = "hfLocationId"
            };
            this.Controls.Add(_hfLocationId);

            _btnPickerLabel = new HtmlAnchor {
                ID = "btnPickerLabel"
            };
            _btnPickerLabel.Attributes["class"] = "picker-label";
            this.Controls.Add(_btnPickerLabel);

            _btnSelectNone = new HtmlAnchor();
            _btnSelectNone.Attributes["class"] = "picker-select-none";
            _btnSelectNone.ID               = string.Format("btnSelectNone_{0}", this.ID);
            _btnSelectNone.InnerHtml        = "<i class='fa fa-times'></i>";
            _btnSelectNone.CausesValidation = false;
            _btnSelectNone.Style[HtmlTextWriterStyle.Display] = "none";
            _btnSelectNone.ServerClick += _btnSelectNone_ServerClick;
            this.Controls.Add(_btnSelectNone);

            _hfPanelIsVisible          = new HiddenFieldWithClass();
            _hfPanelIsVisible.CssClass = "js-picker-menu-is-visible";
            _hfPanelIsVisible.ID       = string.Format("hfPanelIsVisible_{0}", this.ID);
            this.Controls.Add(_hfPanelIsVisible);

            // PickerMenu (DropDown menu)
            _pnlPickerMenu = new Panel {
                ID = "pnlPickerMenu"
            };
            _pnlPickerMenu.CssClass = "picker-menu dropdown-menu";
            this.Controls.Add(_pnlPickerMenu);
            SetPickerOnClick();

            // Address Entry
            _pnlAddressEntry = new Panel {
                ID = "pnlAddressEntry"
            };
            _pnlAddressEntry.CssClass = "locationpicker-address-entry";
            _pnlPickerMenu.Controls.Add(_pnlAddressEntry);

            _acAddress = new AddressControl {
                ID = "acAddress"
            };
            _pnlAddressEntry.Controls.Add(_acAddress);

            // picker actions
            _pnlPickerActions = new Panel {
                ID = "pnlPickerActions", CssClass = "picker-actions"
            };
            _pnlPickerMenu.Controls.Add(_pnlPickerActions);
            _btnSelect = new LinkButton {
                ID = "btnSelect", CssClass = "btn btn-xs btn-primary", Text = "Select", CausesValidation = false
            };
            _btnSelect.Click += _btnSelect_Click;
            _pnlPickerActions.Controls.Add(_btnSelect);
            _btnCancel = new LinkButton {
                ID = "btnCancel", CssClass = "btn btn-xs btn-link", Text = "Cancel"
            };
            _btnCancel.OnClientClick = string.Format("$('#{0}').hide(); $('#{1}').val('false'); Rock.dialogs.updateModalScrollBar('{2}'); return false;", _pnlPickerMenu.ClientID, _hfPanelIsVisible.ClientID, this.ClientID);
            _pnlPickerActions.Controls.Add(_btnCancel);
        }
        /// <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()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add( _hfExpanded );
            _hfExpanded.ID = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "filter-expanded";
            _hfExpanded.Value = "False";

            _hfGroupGuid = new HiddenField();
            _hfGroupGuid.ID = this.ID + "_hfGroupGuid";

            _hfGroupId = new HiddenField();
            _hfGroupId.ID = this.ID + "_hfGroupId";

            _hfGroupTypeId = new HiddenField();
            _hfGroupTypeId.ID = this.ID + "_hfGroupTypeId";

            _lblGroupName = new Literal();
            _lblGroupName.ID = this.ID + "_lblGroupName";

            _lbDeleteGroup = new LinkButton();
            _lbDeleteGroup.CausesValidation = false;
            _lbDeleteGroup.ID = this.ID + "_lbDeleteGroup";
            _lbDeleteGroup.CssClass = "btn btn-xs btn-danger";
            _lbDeleteGroup.Click += lbDeleteGroup_Click;
            _lbDeleteGroup.Attributes["onclick"] = string.Format( "javascript: return Rock.dialogs.confirmDelete(event, '{0}', '{1}');", "group", "Once saved, you will lose all attendance data." );

            var iDelete = new HtmlGenericControl( "i" );
            _lbDeleteGroup.Controls.Add( iDelete );
            iDelete.AddCssClass( "fa fa-times" );

            _tbGroupName = new DataTextBox();
            _tbGroupName.ID = this.ID + "_tbGroupName";
            _tbGroupName.Label = "Check-in Group Name";

            // set label when they exit the edit field
            _tbGroupName.Attributes["onblur"] = string.Format( "javascript: $('#{0}').text($(this).val());", _lblGroupName.ID );
            _tbGroupName.SourceTypeName = "Rock.Model.Group, Rock";
            _tbGroupName.PropertyName = "Name";

            _phGroupAttributes = new PlaceHolder();
            _phGroupAttributes.ID = this.ID + "_phGroupAttributes";

            Controls.Add( _hfGroupGuid );
            Controls.Add( _hfGroupId );
            Controls.Add( _hfGroupTypeId );
            Controls.Add( _lblGroupName );
            Controls.Add( _tbGroupName );
            Controls.Add( _phGroupAttributes );

            // Locations Grid
            CreateLocationsGrid();

            Controls.Add( _lbDeleteGroup );
        }
예제 #33
0
        /// <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()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add( _hfExpanded );
            _hfExpanded.ID = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "filter-expanded";
            _hfExpanded.Value = "False";

            _hfActionTypeGuid = new HiddenField();
            Controls.Add( _hfActionTypeGuid );
            _hfActionTypeGuid.ID = this.ID + "_hfActionTypeGuid";

            _lblActionTypeName = new Label();
            Controls.Add( _lblActionTypeName );
            _lblActionTypeName.ClientIDMode = ClientIDMode.Static;
            _lblActionTypeName.ID = this.ID + "_lblActionTypeName";

            _lbDeleteActionType = new LinkButton();
            Controls.Add( _lbDeleteActionType );
            _lbDeleteActionType.CausesValidation = false;
            _lbDeleteActionType.ID = this.ID + "_lbDeleteActionType";
            _lbDeleteActionType.CssClass = "btn btn-xs btn-danger js-action-delete";
            _lbDeleteActionType.Click += lbDeleteActionType_Click;

            var iDelete = new HtmlGenericControl( "i" );
            _lbDeleteActionType.Controls.Add( iDelete );
            iDelete.AddCssClass( "fa fa-times" );

            _ddlCriteriaAttribute = new RockDropDownList();
            Controls.Add( _ddlCriteriaAttribute );
            _ddlCriteriaAttribute.ID = this.ID + "_ddlCriteriaAttribute";
            _ddlCriteriaAttribute.EnableViewState = false;
            _ddlCriteriaAttribute.CssClass = "js-conditional-run-criteria";
            _ddlCriteriaAttribute.Label = "Run If";
            _ddlCriteriaAttribute.Help = "Optional criteria to prevent the action from running.  If the criteria is not met, this action will be skipped when this activity is processed.";

            _ddlCriteriaComparisonType = new RockDropDownList();
            Controls.Add( _ddlCriteriaComparisonType );
            _ddlCriteriaComparisonType.ID = this.ID + "_ddlCriteriaComparisonType";
            _ddlCriteriaComparisonType.EnableViewState = false;
            _ddlCriteriaComparisonType.CssClass = "js-action-criteria-comparison";
            _ddlCriteriaComparisonType.BindToEnum<ComparisonType>();
            _ddlCriteriaComparisonType.Label = "&nbsp;";

            _tbddlCriteriaValue = new RockTextOrDropDownList();
            Controls.Add( _tbddlCriteriaValue );
            _tbddlCriteriaValue.ID = this.ID + "_tbddlCriteriaValue";
            _tbddlCriteriaValue.EnableViewState = false;
            _tbddlCriteriaValue.TextBox.Label = "Text Value";
            _tbddlCriteriaValue.DropDownList.Label = "Attribute Value";

            _tbActionTypeName = new RockTextBox();
            Controls.Add( _tbActionTypeName );
            _tbActionTypeName.ID = this.ID + "_tbActionTypeName";
            _tbActionTypeName.Label = "Name";
            _tbActionTypeName.Required = true;
            _tbActionTypeName.Attributes["onblur"] = string.Format( "javascript: $('#{0}').text($(this).val());", _lblActionTypeName.ID );

            _wfatpEntityType = new WorkflowActionTypePicker();
            _wfatpEntityType.SelectItem += wfatpEntityType_SelectItem;
            Controls.Add( _wfatpEntityType );
            _wfatpEntityType.ID = this.ID + "_wfatpEntityType";
            _wfatpEntityType.Label = "Action Type";

            _rlEntityTypeOverview = new RockLiteral();
            Controls.Add( _rlEntityTypeOverview );
            _rlEntityTypeOverview.ID = this.ID + "";
            _rlEntityTypeOverview.Label = "Action Type Overview";

            _cbIsActionCompletedOnSuccess = new RockCheckBox { Text = "Action is Completed on Success" };
            Controls.Add( _cbIsActionCompletedOnSuccess );
            _cbIsActionCompletedOnSuccess.ID = this.ID + "_cbIsActionCompletedOnSuccess";

            _cbIsActivityCompletedOnSuccess = new RockCheckBox { Text = "Activity is Completed on Success" };
            Controls.Add( _cbIsActivityCompletedOnSuccess );
            _cbIsActivityCompletedOnSuccess.ID = this.ID + "_cbIsActivityCompletedOnSuccess";

            _formEditor = new WorkflowFormEditor();
            Controls.Add( _formEditor );
            _formEditor.ID = this.ID + "_formEditor";

            _phActionAttributes = new PlaceHolder();
            Controls.Add( _phActionAttributes );
            _phActionAttributes.ID = this.ID + "_phActionAttributes";
        }
예제 #34
0
        /// <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();

            _hfItemId = new HiddenFieldWithClass();
            _hfItemId.ID = this.ID + "_hfItemId";
            _hfItemId.CssClass = "js-item-id-value";

            _hfInitialItemParentIds = new HiddenFieldWithClass();
            _hfInitialItemParentIds.ID = this.ID + "_hfInitialItemParentIds";
            _hfInitialItemParentIds.CssClass = "js-initial-item-parent-ids-value";

            _hfItemName = new HiddenFieldWithClass();
            _hfItemName.ID = this.ID + "_hfItemName";
            _hfItemName.CssClass = "js-item-name-value";

            _hfItemRestUrlExtraParams = new HiddenFieldWithClass();
            _hfItemRestUrlExtraParams.ID = this.ID + "_hfItemRestUrlExtraParams";
            _hfItemRestUrlExtraParams.CssClass = "js-item-rest-url-extra-params-value";

            if ( ModePanel != null )
            {
                this.Controls.Add( ModePanel );
            }

            _btnSelect = new HtmlAnchor();
            _btnSelect.Attributes["class"] = "btn btn-xs btn-primary picker-btn";
            _btnSelect.ID = this.ID + "_btnSelect";
            _btnSelect.InnerText = "Select";
            _btnSelect.CausesValidation = false;

            // we only need the postback on Select if SelectItem is assigned or if this is PagePicker
            if ( SelectItem != null || ( this is PagePicker ) )
            {
                _btnSelect.ServerClick += btnSelect_Click;
            }

            _btnSelectNone = new HtmlAnchor();
            _btnSelectNone.Attributes["class"] = "picker-select-none";
            _btnSelectNone.ID = this.ID + "_btnSelectNone";
            _btnSelectNone.InnerHtml = "<i class='fa fa-times'></i>";
            _btnSelectNone.CausesValidation = false;
            _btnSelectNone.Style[HtmlTextWriterStyle.Display] = "none";

            // we only need the postback on SelectNone if SelectItem is assigned or if this is PagePicker
            if ( SelectItem != null || ( this is PagePicker ) )
            {
                _btnSelectNone.ServerClick += btnSelect_Click;
            }

            Controls.Add( _hfItemId );
            Controls.Add( _hfInitialItemParentIds );
            Controls.Add( _hfItemName );
            Controls.Add( _hfItemRestUrlExtraParams );
            Controls.Add( _btnSelect );
            Controls.Add( _btnSelectNone );

            RequiredFieldValidator.InitialValue = "0";
            RockControlHelper.CreateChildControls( this, Controls );

            RequiredFieldValidator.Display = ValidatorDisplay.None;
        }
예제 #35
0
        /// <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()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add(_hfExpanded);
            _hfExpanded.ID       = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "filter-expanded";
            _hfExpanded.Value    = "False";

            _hfGroupTypeGuid    = new HiddenField();
            _hfGroupTypeGuid.ID = this.ID + "_hfGroupTypeGuid";

            _hfGroupTypeId    = new HiddenField();
            _hfGroupTypeId.ID = this.ID + "_hfGroupTypeId";

            _lblGroupTypeName = new Label();
            _lblGroupTypeName.ClientIDMode = ClientIDMode.Static;
            _lblGroupTypeName.ID           = this.ID + "_lblGroupTypeName";

            _lbDeleteGroupType = new LinkButton();
            _lbDeleteGroupType.CausesValidation = false;
            _lbDeleteGroupType.ID       = this.ID + "_lbDeleteGroupType";
            _lbDeleteGroupType.CssClass = "btn btn-xs btn-danger";
            _lbDeleteGroupType.Click   += lbDeleteGroupType_Click;
            _lbDeleteGroupType.Controls.Add(new LiteralControl {
                Text = "<i class='fa fa-times'></i>"
            });
            _lbDeleteGroupType.Attributes["onclick"] = string.Format("javascript: return Rock.dialogs.confirmDelete(event, '{0}', '{1}');", "check-in area", "Once saved, you will lose all attendance data.");

            _ddlGroupTypeInheritFrom                       = new RockDropDownList();
            _ddlGroupTypeInheritFrom.ID                    = this.ID + "_ddlGroupTypeInheritFrom";
            _ddlGroupTypeInheritFrom.Label                 = "Inherit from";
            _ddlGroupTypeInheritFrom.AutoPostBack          = true;
            _ddlGroupTypeInheritFrom.SelectedIndexChanged += ddlGroupTypeInheritFrom_SelectedIndexChanged;

            _ddlGroupTypeInheritFrom.Items.Add(Rock.Constants.None.ListItem);
            var groupTypeCheckinFilterList = new GroupTypeService(new RockContext()).Queryable()
                                             .Where(a => a.GroupTypePurposeValue.Guid == new Guid(Rock.SystemGuid.DefinedValue.GROUPTYPE_PURPOSE_CHECKIN_FILTER))
                                             .OrderBy(a => a.Order).ThenBy(a => a.Name)
                                             .Select(a => new { a.Id, a.Name }).ToList();

            foreach (var groupType in groupTypeCheckinFilterList)
            {
                _ddlGroupTypeInheritFrom.Items.Add(new ListItem(groupType.Name, groupType.Id.ToString()));
            }

            _tbGroupTypeName       = new DataTextBox();
            _tbGroupTypeName.ID    = this.ID + "_tbGroupTypeName";
            _tbGroupTypeName.Label = "Check-in Area Name";

            // set label when they exit the edit field
            _tbGroupTypeName.Attributes["onblur"] = string.Format("javascript: $('#{0}').text($(this).val());", _lblGroupTypeName.ClientID);
            _tbGroupTypeName.SourceTypeName       = "Rock.Model.GroupType, Rock";
            _tbGroupTypeName.PropertyName         = "Name";

            _phGroupTypeAttributes    = new PlaceHolder();
            _phGroupTypeAttributes.ID = this.ID + "_phGroupTypeAttributes";

            _lbAddCheckinGroupType                  = new LinkButton();
            _lbAddCheckinGroupType.ID               = this.ID + "_lblbAddCheckinGroupType";
            _lbAddCheckinGroupType.CssClass         = "btn btn-xs btn-action checkin-grouptype-add-sub-area";
            _lbAddCheckinGroupType.Click           += lbAddCheckinGroupType_Click;
            _lbAddCheckinGroupType.CausesValidation = false;
            _lbAddCheckinGroupType.Controls.Add(new LiteralControl {
                Text = "<i class='fa fa-plus'></i> Add Sub-Area"
            });

            _lbAddCheckinGroup                  = new LinkButton();
            _lbAddCheckinGroup.ID               = this.ID + "_lbAddCheckinGroup";
            _lbAddCheckinGroup.CssClass         = "btn btn-xs btn-action checkin-grouptype-add-checkin-group";
            _lbAddCheckinGroup.Click           += lbAddGroup_Click;
            _lbAddCheckinGroup.CausesValidation = false;
            _lbAddCheckinGroup.Controls.Add(new LiteralControl {
                Text = "<i class='fa fa-plus'></i> Add Check-in Group"
            });

            Controls.Add(_hfGroupTypeGuid);
            Controls.Add(_hfGroupTypeId);
            Controls.Add(_lblGroupTypeName);
            Controls.Add(_ddlGroupTypeInheritFrom);
            Controls.Add(_tbGroupTypeName);
            Controls.Add(_phGroupTypeAttributes);

            // Check-in Labels grid
            CreateCheckinLabelsGrid();

            Controls.Add(_lbDeleteGroupType);
            Controls.Add(_lbAddCheckinGroupType);
            Controls.Add(_lbAddCheckinGroup);
        }
예제 #36
0
        /// <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();

            _hfExpanded = new HiddenField();
            _hfExpanded.ID = "_hfExpanded";
            Controls.Add( _hfExpanded );
            _hfExpanded.Value = "False";

            _hfTitle = new HiddenFieldWithClass();
            _hfTitle.ValidateRequestMode = System.Web.UI.ValidateRequestMode.Disabled;
            _hfTitle.ID = "_hfTitle";
            _hfTitle.CssClass = "js-header-title-hidden";
            Controls.Add( _hfTitle );

            _hfTitleDisableVrm = new HiddenField();
            _hfTitleDisableVrm.ID = _hfTitle.ID + "_dvrm";
            _hfTitleDisableVrm.Value = "True";
            Controls.Add( _hfTitleDisableVrm );

            _lbDelete = new LinkButton();
            _lbDelete.ID = "_lbDelete";
            Controls.Add( _lbDelete );
            _lbDelete.CausesValidation = false;
            _lbDelete.CssClass = "btn btn-xs btn-danger js-stop-immediate-propagation";
            _lbDelete.Click += lbDelete_Click;
            _lbDelete.Controls.Add( new LiteralControl { Text = "<i class='fa fa fa-times'></i>" } );
        }
예제 #37
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScheduleBuilder"/> class.
        /// </summary>
        public ScheduleBuilderPopupContents()
        {
            // common
            _dpStartDateTime = new DateTimePicker();

            _tbDurationHours = new NumberBox();
            _tbDurationMinutes = new NumberBox();

            _radOneTime = new RockRadioButton();
            _radRecurring = new RockRadioButton();

            _radSpecificDates = new RockRadioButton();
            _radDaily = new RockRadioButton();
            _radWeekly = new RockRadioButton();
            _radMonthly = new RockRadioButton();

            // specific date
            _hfSpecificDateListValues = new HiddenFieldWithClass();
            _hfSpecificDateListValues.CssClass = "js-specific-datelist-values";

            _dpSpecificDate = new DatePicker();

            // daily
            _radDailyEveryXDays = new RockRadioButton();
            _tbDailyEveryXDays = new NumberBox();
            _radDailyEveryWeekday = new RockRadioButton();
            _radDailyEveryWeekendDay = new RockRadioButton();

            // weekly
            _tbWeeklyEveryX = new NumberBox();
            _cbWeeklySunday = new RockCheckBox();
            _cbWeeklyMonday = new RockCheckBox();
            _cbWeeklyTuesday = new RockCheckBox();
            _cbWeeklyWednesday = new RockCheckBox();
            _cbWeeklyThursday = new RockCheckBox();
            _cbWeeklyFriday = new RockCheckBox();
            _cbWeeklySaturday = new RockCheckBox();

            // monthly
            _radMonthlyDayX = new RockRadioButton();
            _tbMonthlyDayX = new NumberBox();
            _tbMonthlyXMonths = new NumberBox();
            _radMonthlyNth = new RockRadioButton();
            _ddlMonthlyNth = new RockDropDownList();
            _ddlMonthlyDayName = new RockDropDownList();

            // end date
            _radEndByNone = new RockRadioButton();
            _radEndByDate = new RockRadioButton();
            _dpEndBy = new DatePicker();
            _radEndByOccurrenceCount = new RockRadioButton();
            _tbEndByOccurrenceCount = new NumberBox();

            // exclusions
            _hfExclusionDateRangeListValues = new HiddenFieldWithClass();
            _hfExclusionDateRangeListValues.CssClass = "js-exclusion-daterange-list-values";
            _dpExclusionDateRange = new DateRangePicker();
        }
예제 #38
0
        /// <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();

            this.CssClass = "picker picker-select rollover-container";

            _hfLocationId = new HiddenField { ID = "hfLocationId" };
            this.Controls.Add( _hfLocationId );

            _btnPickerLabel = new HtmlAnchor { ID = "btnPickerLabel" };
            _btnPickerLabel.Attributes["class"] = "picker-label";
            this.Controls.Add( _btnPickerLabel );

            _btnSelectNone = new HtmlAnchor();
            _btnSelectNone.Attributes["class"] = "picker-select-none";
            _btnSelectNone.ID = string.Format( "btnSelectNone_{0}", this.ID );
            _btnSelectNone.InnerHtml = "<i class='fa fa-times'></i>";
            _btnSelectNone.CausesValidation = false;
            _btnSelectNone.Style[HtmlTextWriterStyle.Display] = "none";
            _btnSelectNone.ServerClick += _btnSelectNone_ServerClick;
            this.Controls.Add( _btnSelectNone );

            _hfPanelIsVisible = new HiddenFieldWithClass();
            _hfPanelIsVisible.CssClass = "js-picker-menu-is-visible";
            _hfPanelIsVisible.ID = string.Format( "hfPanelIsVisible_{0}", this.ID );
            this.Controls.Add( _hfPanelIsVisible );

            // PickerMenu (DropDown menu)
            _pnlPickerMenu = new Panel { ID = "pnlPickerMenu" };
            _pnlPickerMenu.CssClass = "picker-menu dropdown-menu";
            this.Controls.Add( _pnlPickerMenu );
            SetPickerOnClick();

            // Address Entry
            _pnlAddressEntry = new Panel { ID = "pnlAddressEntry" };
            _pnlAddressEntry.CssClass = "locationpicker-address-entry";
            _pnlPickerMenu.Controls.Add( _pnlAddressEntry );

            _acAddress = new AddressControl { ID = "acAddress" };
            _pnlAddressEntry.Controls.Add( _acAddress );

            // picker actions
            _pnlPickerActions = new Panel { ID = "pnlPickerActions", CssClass = "picker-actions" };
            _pnlPickerMenu.Controls.Add( _pnlPickerActions );
            _btnSelect = new LinkButton { ID = "btnSelect", CssClass = "btn btn-xs btn-primary", Text = "Select", CausesValidation = false };
            _btnSelect.Click += _btnSelect_Click;
            _pnlPickerActions.Controls.Add( _btnSelect );
            _btnCancel = new LinkButton { ID = "btnCancel", CssClass = "btn btn-xs btn-link", Text = "Cancel" };
            _btnCancel.OnClientClick = string.Format( "$('#{0}').hide(); $('#{1}').val('false'); Rock.dialogs.updateModalScrollBar('{0}'); return false;", _pnlPickerMenu.ClientID, _hfPanelIsVisible.ClientID );
            _pnlPickerActions.Controls.Add( _btnCancel );
        }
예제 #39
0
        /// <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 );

            _hfDisableVrm = new HiddenField();
            _hfDisableVrm.ID = this.ID + "_dvrm";
            _hfDisableVrm.Value = "True";
            Controls.Add( _hfDisableVrm );

            _hfInCodeEditorMode = new HiddenFieldWithClass();
            _hfInCodeEditorMode.CssClass = "js-incodeeditormode";
            _hfInCodeEditorMode.ID = this.ID + "_hfInCodeEditorMode";
            Controls.Add( _hfInCodeEditorMode );

            _ceEditor = new CodeEditor();
            _ceEditor.ID = this.ID + "_codeEditor";
            _ceEditor.EditorMode = CodeEditorMode.Html;
            Controls.Add( _ceEditor );
        }
예제 #40
0
        /// <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()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add(_hfExpanded);
            _hfExpanded.ID       = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "filter-expanded";
            _hfExpanded.Value    = "False";

            _hfActivityTypeGuid = new HiddenField();
            Controls.Add(_hfActivityTypeGuid);
            _hfActivityTypeGuid.ID = this.ID + "_hfActivityTypeGuid";

            _lblActivityTypeName = new Label();
            Controls.Add(_lblActivityTypeName);
            _lblActivityTypeName.ClientIDMode = ClientIDMode.Static;
            _lblActivityTypeName.ID           = this.ID + "_lblActivityTypeName";

            _lblActivityTypeDescription = new Label();
            Controls.Add(_lblActivityTypeDescription);
            _lblActivityTypeDescription.ClientIDMode = ClientIDMode.Static;
            _lblActivityTypeDescription.ID           = this.ID + "_lblActivityTypeDescription";

            _lblInactive = new Label();
            Controls.Add(_lblInactive);
            _lblInactive.ClientIDMode = ClientIDMode.Static;
            _lblInactive.ID           = this.ID + "_lblInactive";
            _lblInactive.CssClass     = "pull-right";
            _lblInactive.Text         = "<span class='label label-danger'>Inactive</span>";

            _lbDeleteActivityType = new LinkButton();
            Controls.Add(_lbDeleteActivityType);
            _lbDeleteActivityType.CausesValidation = false;
            _lbDeleteActivityType.ID       = this.ID + "_lbDeleteActivityType";
            _lbDeleteActivityType.CssClass = "btn btn-xs btn-square btn-danger js-activity-delete";
            _lbDeleteActivityType.Click   += lbDeleteActivityType_Click;
            _lbDeleteActivityType.Controls.Add(new LiteralControl {
                Text = "<i class='fa fa-times'></i>"
            });

            _sbSecurity = new SecurityButton();
            Controls.Add(_sbSecurity);
            _sbSecurity.ID = this.ID + "_sbSecurity";
            _sbSecurity.Attributes["class"] = "btn btn-security btn-xs security pull-right";
            _sbSecurity.EntityTypeId        = EntityTypeCache.Get(typeof(Rock.Model.WorkflowActivityType)).Id;

            _cbActivityTypeIsActive = new RockCheckBox {
                Text = "Active"
            };
            Controls.Add(_cbActivityTypeIsActive);
            _cbActivityTypeIsActive.ID = this.ID + "_cbActivityTypeIsActive";
            string checkboxScriptFormat = @"
javascript: 
    if ($(this).is(':checked')) {{ 
        $('#{0}').hide(); 
        $('#{1}').removeClass('workflow-activity-inactive'); 
    }} 
    else {{ 
        $('#{0}').show(); 
        $('#{1}').addClass('workflow-activity-inactive'); 
    }}
";

            _cbActivityTypeIsActive.InputAttributes.Add("onclick", string.Format(checkboxScriptFormat, _lblInactive.ID, this.ID + "_section"));

            _tbActivityTypeName = new RockTextBox();
            Controls.Add(_tbActivityTypeName);
            _tbActivityTypeName.ID                   = this.ID + "_tbActivityTypeName";
            _tbActivityTypeName.Label                = "Name";
            _tbActivityTypeName.Required             = true;
            _tbActivityTypeName.Attributes["onblur"] = string.Format("javascript: $('#{0}').text($(this).val());", _lblActivityTypeName.ID);

            _tbActivityTypeDescription = new RockTextBox();
            Controls.Add(_tbActivityTypeDescription);
            _tbActivityTypeDescription.ID                   = this.ID + "_tbActivityTypeDescription";
            _tbActivityTypeDescription.Label                = "Description";
            _tbActivityTypeDescription.TextMode             = TextBoxMode.MultiLine;
            _tbActivityTypeDescription.Rows                 = 2;
            _tbActivityTypeDescription.Attributes["onblur"] = string.Format("javascript: $('#{0}').text($(this).val());", _lblActivityTypeDescription.ID);

            _cbActivityTypeIsActivatedWithWorkflow = new RockCheckBox {
                Text = "Activated with Workflow"
            };
            Controls.Add(_cbActivityTypeIsActivatedWithWorkflow);
            _cbActivityTypeIsActivatedWithWorkflow.ID = this.ID + "_cbActivityTypeIsActivatedWithWorkflow";
            checkboxScriptFormat = @"
javascript: 
    if ($(this).is(':checked')) {{ 
        $('#{0}').addClass('activated-with-workflow'); 
    }} 
    else {{ 
        $('#{0}').removeClass('activated-with-workflow'); 
    }}
";
            _cbActivityTypeIsActivatedWithWorkflow.InputAttributes.Add("onclick", string.Format(checkboxScriptFormat, this.ID + "_section"));


            _lbAddActionType = new LinkButton();
            Controls.Add(_lbAddActionType);
            _lbAddActionType.ID               = this.ID + "_lbAddAction";
            _lbAddActionType.CssClass         = "btn btn-xs btn-action add-action";
            _lbAddActionType.Click           += lbAddActionType_Click;
            _lbAddActionType.CausesValidation = false;
            _lbAddActionType.Controls.Add(new LiteralControl {
                Text = "<i class='fa fa-plus'></i> Add Action"
            });

            _pwAttributes = new PanelWidget();
            Controls.Add(_pwAttributes);
            _pwAttributes.ID       = this.ID + "_pwAttributes";
            _pwAttributes.Title    = "Activity Attributes";
            _pwAttributes.CssClass = "attribute-panel";

            _gAttributes = new Grid();
            _pwAttributes.Controls.Add(_gAttributes);
            _gAttributes.ID          = this.ID + "_gAttributes";
            _gAttributes.AllowPaging = false;
            _gAttributes.DisplayType = GridDisplayType.Light;
            _gAttributes.RowItemText = "Activity Attribute";
            _gAttributes.AddCssClass("attribute-grid");
            _gAttributes.DataKeyNames        = new string[] { "Guid" };
            _gAttributes.Actions.ShowAdd     = true;
            _gAttributes.Actions.AddClick   += gAttributes_Add;
            _gAttributes.GridRebind         += gAttributes_Rebind;
            _gAttributes.GridReorder        += gAttributes_Reorder;
            _gAttributes.ShowActionsInHeader = false;

            var reorderField = new ReorderField();

            _gAttributes.Columns.Add(reorderField);

            var nameField = new BoundField();

            nameField.DataField  = "Name";
            nameField.HeaderText = "Attribute";
            _gAttributes.Columns.Add(nameField);

            var descField = new BoundField();

            descField.DataField  = "Description";
            descField.HeaderText = "Description";
            _gAttributes.Columns.Add(descField);

            var fieldTypeField = new BoundField();

            fieldTypeField.DataField  = "FieldType";
            fieldTypeField.HeaderText = "Field Type";
            _gAttributes.Columns.Add(fieldTypeField);

            var reqField = new BoolField();

            reqField.DataField  = "IsRequired";
            reqField.HeaderText = "Required";
            _gAttributes.Columns.Add(reqField);

            var editField = new EditField();

            editField.Click += gAttributes_Edit;
            _gAttributes.Columns.Add(editField);

            var delField = new DeleteField();

            delField.Click += gAttributes_Delete;
            _gAttributes.Columns.Add(delField);
        }
예제 #41
0
        /// <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()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add( _hfExpanded );
            _hfExpanded.ID = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "filter-expanded";
            _hfExpanded.Value = "False";

            _hfGroupTypeGuid = new HiddenField();
            _hfGroupTypeGuid.ID = this.ID + "_hfGroupTypeGuid";

            _hfGroupTypeId = new HiddenField();
            _hfGroupTypeId.ID = this.ID + "_hfGroupTypeId";

            _lblGroupTypeName = new Label();
            _lblGroupTypeName.ClientIDMode = ClientIDMode.Static;
            _lblGroupTypeName.ID = this.ID + "_lblGroupTypeName";

            _lbDeleteGroupType = new LinkButton();
            _lbDeleteGroupType.CausesValidation = false;
            _lbDeleteGroupType.ID = this.ID + "_lbDeleteGroupType";
            _lbDeleteGroupType.CssClass = "btn btn-xs btn-danger";
            _lbDeleteGroupType.Click += lbDeleteGroupType_Click;
            _lbDeleteGroupType.Controls.Add( new LiteralControl { Text = "<i class='fa fa-times'></i>" } );
            _lbDeleteGroupType.Attributes["onclick"] = string.Format( "javascript: return Rock.dialogs.confirmDelete(event, '{0}', '{1}');", "check-in area", "Once saved, you will lose all attendance data." );

            _ddlGroupTypeInheritFrom = new RockDropDownList();
            _ddlGroupTypeInheritFrom.ID = this.ID + "_ddlGroupTypeInheritFrom";
            _ddlGroupTypeInheritFrom.Label = "Inherit from";
            _ddlGroupTypeInheritFrom.AutoPostBack = true;
            _ddlGroupTypeInheritFrom.SelectedIndexChanged += ddlGroupTypeInheritFrom_SelectedIndexChanged;

            _ddlGroupTypeInheritFrom.Items.Add( Rock.Constants.None.ListItem );
            var groupTypeCheckinFilterList = new GroupTypeService( new RockContext() ).Queryable()
                .Where( a => a.GroupTypePurposeValue.Guid == new Guid( Rock.SystemGuid.DefinedValue.GROUPTYPE_PURPOSE_CHECKIN_FILTER ) )
                .OrderBy( a => a.Order ).ThenBy( a => a.Name )
                .Select( a => new { a.Id, a.Name } ).ToList();

            foreach ( var groupType in groupTypeCheckinFilterList )
            {
                _ddlGroupTypeInheritFrom.Items.Add( new ListItem( groupType.Name, groupType.Id.ToString() ) );
            }

            _tbGroupTypeName = new DataTextBox();
            _tbGroupTypeName.ID = this.ID + "_tbGroupTypeName";
            _tbGroupTypeName.Label = "Check-in Area Name";

            // set label when they exit the edit field
            _tbGroupTypeName.Attributes["onblur"] = string.Format( "javascript: $('#{0}').text($(this).val());", _lblGroupTypeName.ClientID );
            _tbGroupTypeName.SourceTypeName = "Rock.Model.GroupType, Rock";
            _tbGroupTypeName.PropertyName = "Name";

            _phGroupTypeAttributes = new PlaceHolder();
            _phGroupTypeAttributes.ID = this.ID + "_phGroupTypeAttributes";

            _lbAddCheckinGroupType = new LinkButton();
            _lbAddCheckinGroupType.ID = this.ID + "_lblbAddCheckinGroupType";
            _lbAddCheckinGroupType.CssClass = "btn btn-xs btn-action checkin-grouptype-add-sub-area";
            _lbAddCheckinGroupType.Click += lbAddCheckinGroupType_Click;
            _lbAddCheckinGroupType.CausesValidation = false;
            _lbAddCheckinGroupType.Controls.Add( new LiteralControl { Text = "<i class='fa fa-plus'></i> Add Sub-Area" } );

            _lbAddCheckinGroup = new LinkButton();
            _lbAddCheckinGroup.ID = this.ID + "_lbAddCheckinGroup";
            _lbAddCheckinGroup.CssClass = "btn btn-xs btn-action checkin-grouptype-add-checkin-group";
            _lbAddCheckinGroup.Click += lbAddGroup_Click;
            _lbAddCheckinGroup.CausesValidation = false;
            _lbAddCheckinGroup.Controls.Add( new LiteralControl { Text = "<i class='fa fa-plus'></i> Add Check-in Group" } );

            Controls.Add( _hfGroupTypeGuid );
            Controls.Add( _hfGroupTypeId );
            Controls.Add( _lblGroupTypeName );
            Controls.Add( _ddlGroupTypeInheritFrom );
            Controls.Add( _tbGroupTypeName );
            Controls.Add( _phGroupTypeAttributes );

            // Check-in Labels grid
            CreateCheckinLabelsGrid();

            Controls.Add( _lbDeleteGroupType );
            Controls.Add( _lbAddCheckinGroupType );
            Controls.Add( _lbAddCheckinGroup );
        }
예제 #42
0
        /// <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()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add( _hfExpanded );
            _hfExpanded.ID = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "group-expanded";
            _hfExpanded.Value = "False";

            _hfGroupGuid = new HiddenField();
            _hfGroupGuid.ID = this.ID + "_hfGroupGuid";

            _lblGroupRowName = new Label();
            _lblGroupRowName.ClientIDMode = ClientIDMode.Static;
            _lblGroupRowName.ID = this.ID + "_lblGroupRowName";

            _lbAddGroup = new LinkButton();
            _lbAddGroup.ID = this.ID + "_lbAddGroup";
            _lbAddGroup.CssClass = "btn btn-xs btn-default checkin-group-add-group";
            _lbAddGroup.Click += lbAddGroup_Click;
            _lbAddGroup.CausesValidation = false;
            _lbAddGroup.Controls.Add( new LiteralControl { Text = "<i class='fa fa-plus'></i> <i class='fa fa-check-circle'></i>" } );

            _lblDeleteGroup = new LinkButton();
            _lblDeleteGroup.CausesValidation = false;
            _lblDeleteGroup.ID = this.ID + "_lblDeleteGroup";
            _lblDeleteGroup.CssClass = "btn btn-xs btn-danger";
            _lblDeleteGroup.Click += lblDeleteGroup_Click;
            _lblDeleteGroup.Controls.Add( new LiteralControl { Text = "<i class='fa fa-times'></i>" } );
            _lblDeleteGroup.Attributes["onclick"] = string.Format( "javascript: return Rock.dialogs.confirmDelete(event, '{0}', '{1}');", "check-in group", "Once saved, you will lose all attendance data." );

            Controls.Add( _hfGroupGuid );
            Controls.Add( _lblGroupRowName );

            Controls.Add( _lbAddGroup );
            Controls.Add( _lblDeleteGroup );
        }
예제 #43
0
        /// <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()
        {
            Controls.Clear();

            _hfChecked = new HiddenFieldWithClass();
            _hfChecked.CssClass = "js-toggle-checked";
            _hfChecked.ID = this.ID + "_hfChecked";

            _btnOn = new HtmlAnchor();
            _btnOn.ID = this.ID + "_btnOn";
            _btnOn.Attributes["class"] = "btn btn-default js-toggle-on " + this.ButtonSizeCssClass;
            _btnOn.InnerText = this.OnText;

            _btnOff = new HtmlAnchor();
            _btnOff.ID = this.ID + "_btnOff";
            _btnOff.Attributes["class"] = "btn btn-default js-toggle-off " + this.ButtonSizeCssClass;
            _btnOff.InnerText = this.OffText;

            Controls.Add( _hfChecked );
            Controls.Add( _btnOn );
            Controls.Add( _btnOff );
        }
예제 #44
0
        /// <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();

            _hfPersonId = new HiddenFieldWithClass();
            _hfPersonId.CssClass = "js-person-id";
            Controls.Add( _hfPersonId );
            _hfPersonId.ID = "hfPersonId";
            _hfPersonId.Value = "0";

            _hfPersonName = new HiddenFieldWithClass();
            _hfPersonName.CssClass = "js-person-name";
            Controls.Add( _hfPersonName );
            _hfPersonName.ID = "hfPersonName";

            _hfSelfPersonId = new HiddenFieldWithClass();
            _hfSelfPersonId.CssClass = "js-self-person-id";
            Controls.Add( _hfSelfPersonId );
            _hfSelfPersonId.ID = "hfSelfPersonId";
            _hfSelfPersonId.Value = "0";

            _hfSelfPersonName = new HiddenFieldWithClass();
            _hfSelfPersonName.CssClass = "js-self-person-name";
            Controls.Add( _hfSelfPersonName );
            _hfSelfPersonName.ID = "hfSelfPersonName";

            var rockBlock = this.RockBlock();
            if ( rockBlock != null && rockBlock.CurrentPerson != null)
            {
                _hfSelfPersonId.Value = rockBlock.CurrentPersonId.ToString();
                _hfSelfPersonName.Value = rockBlock.CurrentPerson.ToString();
            }

            _hfIncludeBusinesses = new HiddenFieldWithClass();
            _hfIncludeBusinesses.CssClass = "js-include-businesses";
            Controls.Add( _hfIncludeBusinesses );
            _hfIncludeBusinesses.ID = "hfIncludeBusinesses";

            _btnSelect = new HtmlAnchor();
            Controls.Add( _btnSelect );
            _btnSelect.Attributes["class"] = "btn btn-xs btn-primary";
            _btnSelect.ID = "btnSelect";
            _btnSelect.InnerText = "Select";
            _btnSelect.CausesValidation = false;
            _btnSelect.ServerClick += btnSelect_Click;

            _btnSelectNone = new HtmlAnchor();
            Controls.Add( _btnSelectNone );
            _btnSelectNone.Attributes["class"] = "picker-select-none";
            _btnSelectNone.ID = "btnSelectNone";
            _btnSelectNone.InnerHtml = "<i class='fa fa-times'></i>";
            _btnSelectNone.CausesValidation = false;
            _btnSelectNone.Style[HtmlTextWriterStyle.Display] = "none";
            _btnSelectNone.ServerClick += btnSelect_Click;

            RockControlHelper.CreateChildControls( this, Controls );

            // override a couple of property values on RequiredFieldValidator so that Validation works correctly
            RequiredFieldValidator.InitialValue = "0";
            RequiredFieldValidator.ControlToValidate = _hfPersonId.ID;
        }
예제 #45
0
        /// <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();

            // main container
            _dialogPanel = new Panel();
            Controls.Add( _dialogPanel );
            _dialogPanel.ID = "modal_dialog_panel";
            _dialogPanel.CssClass = "modal container modal-content rock-modal rock-modal-frame";

            _hfModalVisible = new HiddenFieldWithClass();
            _hfModalVisible.CssClass = "js-modal-visible";
            _dialogPanel.Controls.Add( _hfModalVisible );

            // modal-header
            _headerPanel = new Panel();
            _dialogPanel.Controls.Add( _headerPanel );
            _headerPanel.CssClass = "modal-header";

            _closeLink = new HtmlGenericControl( "button" );
            _headerPanel.Controls.Add( _closeLink );
            _closeLink.ID = "closeLink";
            _closeLink.Attributes.Add( "class", "close js-modaldialog-close-link" );
            _closeLink.Attributes.Add( "aria-hidden", "true" );
            _closeLink.Attributes.Add( "type", "button" );
            _closeLink.Attributes.Add( "data-dismiss", "modal" );
            _closeLink.InnerHtml = "&times;";

            _titleH3 = new HtmlGenericControl( "h3" );
            _titleH3.AddCssClass( "modal-title" );
            _headerPanel.Controls.Add( _titleH3 );

            // _title control for public this.Title
            _title = new Literal();
            _title.Text = string.Empty;
            _titleH3.Controls.Add( _title );

            // _subtitle controls for public this.Subtitle
            _subtitleSmall = new HtmlGenericControl( "small" );
            _headerPanel.Controls.Add( _subtitleSmall );
            _subtitle = new Literal();
            _subtitle.Text = string.Empty;
            _subtitleSmall.Controls.Add( _subtitle );

            // modal-body and content
            _bodyPanel = new Panel();
            _bodyPanel.CssClass = "modal-body";
            _dialogPanel.Controls.Add( _bodyPanel );

            // for this.Content
            _contentPanel = new Panel();
            _bodyPanel.Controls.Add( _contentPanel );
            _contentPanel.ID = "contentPanel";

            // modal-footer
            _footerPanel = new Panel();
            _dialogPanel.Controls.Add( _footerPanel );
            _footerPanel.CssClass = "modal-footer";

            _cancelLink = new HtmlAnchor();
            _footerPanel.Controls.Add( _cancelLink );
            _cancelLink.ID = "cancelLink";
            _cancelLink.Attributes.Add( "class", "btn btn-link js-modaldialog-cancel-link" );
            _cancelLink.Attributes.Add( "data-dismiss", "modal" );
            _cancelLink.InnerText = "Cancel";

            _serverSaveLink = new HtmlAnchor();
            _footerPanel.Controls.Add( _serverSaveLink );
            _serverSaveLink.ID = "serverSaveLink";
            _serverSaveLink.Attributes.Add( "class", "btn btn-primary" );
            _serverSaveLink.ServerClick += SaveLink_ServerClick;

            _saveLink = new HtmlAnchor();
            _footerPanel.Controls.Add( _saveLink );
            _saveLink.ID = "saveLink";
            _saveLink.Attributes.Add( "class", "btn btn-primary js-modaldialog-save-link" );
        }