コード例 #1
0
        private void SetUpTabs()
        {
            if (Tabs.Count > 0)
            {
                var tabStrip = new DnnFormTabStrip {
                    CssClass = "dnnAdminTabNav dnnClear"
                };
                Controls.Add(tabStrip);
                tabStrip.Items.Clear();

                foreach (DnnFormTab formTab in Tabs)
                {
                    var resourceKey = formTab.ResourceKey;
                    if (String.IsNullOrEmpty(resourceKey))
                    {
                        resourceKey = formTab.ID;
                    }

                    var tab = new Panel {
                        CssClass = formTab.ID + " dnnClear", ID = "tab_" + formTab.ID
                    };
                    Controls.Add(tab);

                    if (formTab.IncludeExpandAll)
                    {
                        var expandAll = new Panel {
                            CssClass = "dnnFormExpandContent"
                        };
                        string expandAllText = Localization.GetString("ExpandAll", Localization.SharedResourceFile);
                        expandAll.Controls.Add(new LiteralControl("<a href=\"\">" + expandAllText + "</a>"));
                        tab.Controls.Add(expandAll);

                        formTab.ExpandAllScript  = "\t\t\t$('#" + tab.ClientID + " .dnnFormExpandContent a').dnnExpandAll({\r\n";
                        formTab.ExpandAllScript += "\t\t\t\texpandText: '" + Localization.GetString("ExpandAll", Localization.SharedResourceFile) + "',\r\n";
                        formTab.ExpandAllScript += "\t\t\t\tcollapseText: '" + Localization.GetString("CollapseAll", Localization.SharedResourceFile) + "',\r\n";
                        formTab.ExpandAllScript += "\t\t\t\ttargetArea: '#" + tab.ClientID + "' });\r\n";
                    }

                    tabStrip.Items.Add(new ListItem(Localization.GetString(resourceKey, LocalResourceFile), "#" + tab.ClientID));

                    if (formTab.Sections.Count > 0)
                    {
                        SetUpSections(formTab.Sections, tab);
                    }
                    else
                    {
                        tab.CssClass += " dnnFormNoSections";
                    }

                    SetUpItems(formTab.Items, tab, LocalResourceFile, EncryptIds);
                }
            }
        }
コード例 #2
0
ファイル: DnnFormEditor.cs プロジェクト: rut5949/Dnn.Platform
        private void SetUpTabs()
        {
            if (Tabs.Count > 0)
            {
                var tabStrip = new DnnFormTabStrip {CssClass = "dnnAdminTabNav dnnClear"};
                Controls.Add(tabStrip);
                tabStrip.Items.Clear();

                foreach (DnnFormTab formTab in Tabs)
                {
                    var resourceKey = formTab.ResourceKey;
                    if (String.IsNullOrEmpty(resourceKey))
                    {
                        resourceKey = formTab.ID;
                    }

                    var tab = new Panel {CssClass = formTab.ID + " dnnClear", ID = "tab_" + formTab.ID};
                    Controls.Add(tab);

                    if (formTab.IncludeExpandAll)
                    {
                        var expandAll = new Panel {CssClass = "dnnFormExpandContent"};
                        string expandAllText = Localization.GetString("ExpandAll", Localization.SharedResourceFile);
                        expandAll.Controls.Add(new LiteralControl("<a href=\"\">" + expandAllText + "</a>"));
                        tab.Controls.Add(expandAll);

                        formTab.ExpandAllScript = "\t\t\t$('#" + tab.ClientID + " .dnnFormExpandContent a').dnnExpandAll({\r\n";
                        formTab.ExpandAllScript += "\t\t\t\texpandText: '" + Localization.GetString("ExpandAll", Localization.SharedResourceFile) + "',\r\n";
                        formTab.ExpandAllScript += "\t\t\t\tcollapseText: '" + Localization.GetString("CollapseAll", Localization.SharedResourceFile) + "',\r\n";
                        formTab.ExpandAllScript += "\t\t\t\ttargetArea: '#" + tab.ClientID + "' });\r\n";
                    }

                    tabStrip.Items.Add(new ListItem(Localization.GetString(resourceKey, LocalResourceFile), "#" + tab.ClientID));

                    if (formTab.Sections.Count > 0)
                    {
                        SetUpSections(formTab.Sections, tab);
                    }
                    else
                    {
                        tab.CssClass += " dnnFormNoSections";
                    }

                    SetUpItems(formTab.Items, tab, LocalResourceFile);
                }
            }
        }