Beispiel #1
0
        protected virtual void CreateControlHierarchy(bool useDataSource)
        {
            CssClass = string.IsNullOrEmpty(CssClass) ? "dnnForm" : CssClass.Contains("dnnForm") ? CssClass : string.Format("dnnForm {0}", CssClass);

            SetUpTabs();

            SetUpSections(Sections, this);

            SetUpItems(Items, this, LocalResourceFile, EncryptIds);

            DataBindItems(useDataSource);
        }
Beispiel #2
0
        protected override void OnPreRender(EventArgs e)
        {
            if (HttpContext.Current == null)
            {
                base.OnPreRender(e);
                return;
            }

            countOfVisibleWebControls = GetCountVisibleChildWebControls();
            Visible = !(Autohide && countOfVisibleWebControls == 0);

            if (DetectSideColumn)
            {
                columnId = this.GetColumnId();

                switch (columnId)
                {
                case UIHelper.LeftColumnId:
                case UIHelper.RightColumnId:
                    ExtraCssClasses    = SideColumnxtraCssClasses;
                    InsideTopMarkup    = SideColumnLiteralExtraTopContent;
                    InsideBottomMarkup = SideColumnLiteralExtraBottomContent;

                    break;

                case UIHelper.CenterColumnId:
                default:
                    // nothing to do here

                    break;
                }

                base.OnPreRender(e);
            }


            if (ExtraCssClasses.Length > 0)
            {
                if (CssClass.Length > 0)
                {
                    if (!CssClass.Contains(ExtraCssClasses))
                    {
                        CssClass = CssClass + " " + ExtraCssClasses;
                    }
                }
                else
                {
                    CssClass = ExtraCssClasses;
                }
            }
        }
Beispiel #3
0
		protected override void CreateChildControls()
		{
			string toolTipText = LocalizeString(ToolTipKey);
            if (string.IsNullOrEmpty(CssClass))
                CssClass = "dnnLabel";

            else if (!CssClass.Contains("dnnLabel"))                           
                CssClass += " dnnLabel";
            

            //var outerPanel = new Panel();
            //outerPanel.CssClass = "dnnLabel";
            //Controls.Add(outerPanel);            

            var outerLabel = new System.Web.UI.HtmlControls.HtmlGenericControl { TagName = "label" };
            Controls.Add(outerLabel);
            
            var label = new Label { ID = "Label", Text = LocalizeString(ResourceKey) };
            if (RequiredField)
            {
                label.CssClass += " dnnFormRequired";
            }
		    outerLabel.Controls.Add(label);			

            var link = new LinkButton { ID = "Link", CssClass = "dnnFormHelp", TabIndex = -1 };
            Controls.Add(link);
			
			if (!String.IsNullOrEmpty(toolTipText))
			{
				//CssClass += "dnnLabel";

			    var tooltipPanel = new Panel() { CssClass = "dnnTooltip"};
                Controls.Add(tooltipPanel);

				var panel = new Panel { ID = "Help", CssClass = "dnnFormHelpContent dnnClear" };				
                tooltipPanel.Controls.Add(panel);
				
				var helpLabel = new Label { ID = "Text", CssClass="dnnHelpText", Text = LocalizeString(ToolTipKey) };
				panel.Controls.Add(helpLabel);

				var pinLink = new HyperLink {CssClass = "pinHelp"};
			    pinLink.Attributes.Add("href", "#");
				panel.Controls.Add(pinLink);

				ClientAPI.RegisterClientReference(Page, ClientAPI.ClientNamespaceReferences.dnn);
                jQuery.RequestHoverIntentRegistration();
				jQuery.RequestDnnPluginsRegistration();
                //ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/Scripts/initTooltips.js");
			}
		}
Beispiel #4
0
 // Build CSS classes for the "root" DOM element ("this control")
 private void BuildCssForRootElement()
 {
     if (!CssClass.Contains("item"))
     {
         CssClass += " item";
     }
     if (ChildMenuItems != null &&
         ChildMenuItems.Controls.Count > 0 &&
         !CssClass.Contains("has-children") &&
         !CssClass.Contains("top"))
     {
         CssClass += " has-children";
     }
 }
Beispiel #5
0
 protected override void Render(HtmlTextWriter writer)
 {
     if (!CssClass.Contains("validator"))
     {
         CssClass += " validator";
     }
     if (!CssClass.Contains("regexValidator"))
     {
         CssClass += " regexValidator";
     }
     CssClass = CssClass.Trim();
     if (!m_OverwriteDisplayType)
     {
         base.Display = ValidatorDisplay.Dynamic;
     }
     base.Render(writer);
 }
Beispiel #6
0
        private void SetVisibility()
        {
            int idxCurrentVisibleView = (Parent as Accordion).ActiveAccordionViewIndex;
            int idxOfThisView         = (Parent as Accordion).GetIndex(this);

            if (idxCurrentVisibleView == idxOfThisView)
            {
                _content.Style[Styles.display] = "";
            }
            else
            {
                _content.Style[Styles.display] = "none";
                if (!CssClass.Contains("ra-acc-view-collapsed"))
                {
                    CssClass += " ra-acc-view-collapsed";
                }
            }
        }
Beispiel #7
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            if (groupClass.Length > 0)
            {
                if (CssClass.Length > 0)
                {
                    if (!CssClass.Contains(groupClass))
                    {
                        CssClass = groupClass + " " + CssClass;
                    }
                }
                else
                {
                    CssClass = groupClass;
                }
            }
        }
        /// <inheritdoc/>
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            builder.OpenElement(0, "a");

            builder.AddMultipleAttributes(1, AdditionalAttributes);
            builder.AddAttribute(2, "class", CssClass);

            if (CssClass?.Contains("active") == true && ((ActiveAttributes?.Count ?? 0) > 0))
            {
                builder.AddMultipleAttributes(3, ActiveAttributes);
                builder.AddContent(4, ChildContent);
            }
            else
            {
                builder.AddContent(3, ChildContent);
            }

            builder.CloseElement();
        }