当前位置: 首页>>代码示例>>C#>>正文


C# TabController.GetTab方法代码示例

本文整理汇总了C#中DotNetNuke.Entities.Tabs.TabController.GetTab方法的典型用法代码示例。如果您正苦于以下问题:C# TabController.GetTab方法的具体用法?C# TabController.GetTab怎么用?C# TabController.GetTab使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DotNetNuke.Entities.Tabs.TabController的用法示例。


在下文中一共展示了TabController.GetTab方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FindMessageTab

        //This method is copied from user skin object
        private int FindMessageTab()
        {
            var tabController = new TabController();
            var moduleController = new ModuleController();

            //On brand new install the new Message Center Module is on the child page of User Profile Page 
            //On Upgrade to 6.2.0, the Message Center module is on the User Profile Page
            var profileTab = tabController.GetTab(PortalSettings.UserTabId, PortalSettings.PortalId, false);
            if (profileTab != null)
            {
                var childTabs = tabController.GetTabsByPortal(profileTab.PortalID).DescendentsOf(profileTab.TabID);
                foreach (TabInfo tab in childTabs)
                {
                    foreach (KeyValuePair<int, ModuleInfo> kvp in moduleController.GetTabModules(tab.TabID))
                    {
                        var module = kvp.Value;
                        if (module.DesktopModule.FriendlyName == "Message Center")
                        {
                            return tab.TabID;                            
                        }
                    }
                }
            }

            //default to User Profile Page
            return PortalSettings.UserTabId;            
        }        
开发者ID:heitkea,项目名称:DNN_DEV_7_2,代码行数:28,代码来源:Toast.ascx.cs

示例2: LoadSettings

        public override void LoadSettings()
        {
            try
            {

                if (!Page.IsPostBack)
                {
                    TabController tabCtrl = new TabController();
                    var currentTab = tabCtrl.GetTab(TabId, PortalId, true);
                    foreach (var module in currentTab.ChildModules)
                    {
                        var modInfo = module.Value as ModuleInfo;
                        if (modInfo.ModuleDefinition.DefinitionName == "QuickDocsPro")
                        {
                            ddlQDPModule.Items.Add(new ListItem(modInfo.ModuleControl.ControlTitle, modInfo.ModuleID.ToString()));
                        }
                    }

                    if ((string)TabModuleSettings["QDPModule"] != null)
                    {
                        ddlQDPModule.Items.FindByValue((string)TabModuleSettings["QDPModule"].ToString()).Selected = true;
                    }
                }
            }
            catch (Exception exc)
            {
                //Module failed to load
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
开发者ID:heitkea,项目名称:DNN_DEV_7_2,代码行数:30,代码来源:ExplorerSettings.ascx.cs

示例3: BindData

        private void BindData()
        {
            using (var dt = new DataTable())
            {
                dt.Columns.Add(new DataColumn("TabId", typeof (Int32)));
                dt.Columns.Add(new DataColumn("ContentKey", typeof (String)));
                dt.Columns.Add(new DataColumn("Title", typeof (String)));
                dt.Columns.Add(new DataColumn("Description", typeof (String)));
                dt.Columns.Add(new DataColumn("PubDate", typeof (DateTime)));

                var results = new ContentController().GetContentItemsByTerm(_tagQuery).ToList();
                var tabController = new TabController();

                if (_tagQuery.Length > 0)
                {
                    foreach (var item in results)
                    {
                        var dr = dt.NewRow();
                        dr["TabId"] = item.TabID;
                        dr["ContentKey"] = item.ContentKey;
                        dr["Title"] = item.Content;

                        //get tab info and use the tab description, if tab is deleted then ignore the item.
                        var tab = tabController.GetTab(item.TabID, PortalId, false);
                        if(tab != null)
                        {
							if (tab.IsDeleted)
							{
								continue;
							}

							dr["Title"] = string.IsNullOrEmpty(tab.Title) ? tab.TabName : tab.Title;
                            dr["Description"] = tab.Description;
                        }
                        else
                        {
                            dr["Description"] = item.Content.Length > 1000 ? item.Content.Substring(0, 1000) : item.Content;
                        }

                        dr["PubDate"] = item.CreatedOnDate;
                        dt.Rows.Add(dr);
                    }
                }

                //Bind Search Results Grid
                var dv = new DataView(dt);
                dgResults.DataSource = dv;
                dgResults.DataBind();
              
                if (results.Count == 0)
                {
                    dgResults.Visible = false;
                    lblMessage.Text = string.Format(Localization.GetString("NoResults", LocalResourceFile), _tagQuery);
                }
                else
                {
                    lblMessage.Text = string.Format(Localization.GetString("Results", LocalResourceFile), _tagQuery);
                }
            }
        }
开发者ID:RichardHowells,项目名称:dnnextensions,代码行数:60,代码来源:ContentList.ascx.cs

示例4: OnLoad

 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     var controller = new TabController();
     lblHomePage.Text = controller.GetTab(ModuleContext.PortalSettings.HomeTabId, ModuleContext.PortalId,false).TabName;
     
     if (!IsPostBack) BindSettingControls();
 }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:8,代码来源:SimpleSettingsView.ascx.cs

示例5: ResolvePageLink

        private string ResolvePageLink(int linkId, string defaultValue)
        {
            var tabController = new TabController();
            var tabInfo = tabController.GetTab(linkId);
            if (tabInfo == null)
                return defaultValue;

            return tabInfo.TabPath;
        }
开发者ID:BravoSierra,项目名称:2sxc,代码行数:9,代码来源:SexyContentValueConverter.cs

示例6: CmdAddPageClick

        protected void CmdAddPageClick(object sender, EventArgs e)
        {
            var tabCtrl = new TabController();

            int selectedTabID = Int32.Parse(PageLst.SelectedValue);
            TabInfo selectedTab = tabCtrl.GetTab(selectedTabID, PortalSettings.ActiveTab.PortalID, false);
            var tabLocation = (TabRelativeLocation) Enum.Parse(typeof (TabRelativeLocation), LocationLst.SelectedValue);
            TabInfo newTab = RibbonBarManager.InitTabInfoObject(selectedTab, tabLocation);

            string templateFile = string.Empty;
            if ((!string.IsNullOrEmpty(TemplateLst.SelectedValue)))
            {
                templateFile = Path.Combine(PortalSettings.HomeDirectoryMapPath, "Templates\\" + TemplateLst.SelectedValue);
            }

            newTab.TabName = Name.Text;
            newTab.IsVisible = IncludeInMenu.Checked;

            string errMsg = string.Empty;
            try
            {
                RibbonBarManager.SaveTabInfoObject(newTab, selectedTab, tabLocation, templateFile);
            }
            catch (DotNetNukeException ex)
            {
                Exceptions.LogException(ex);
                errMsg = (ex.ErrorCode != DotNetNukeErrorCode.NotSet) ? GetString("Err." + ex.ErrorCode) : ex.Message;
            }
            catch (Exception ex)
            {
                Exceptions.LogException(ex);
                errMsg = ex.Message;
            }

            //Clear the Tab's Cached modules
            DataCache.ClearModuleCache(PortalSettings.ActiveTab.TabID);

            //Update Cached Tabs as TabPath may be needed before cache is cleared
            TabInfo tempTab;
            if (new TabController().GetTabsByPortal(PortalSettings.ActiveTab.PortalID).TryGetValue(newTab.TabID, out tempTab))
            {
                tempTab.TabPath = newTab.TabPath;
            }

            if ((string.IsNullOrEmpty(errMsg)))
            {
                Response.Redirect(Globals.NavigateURL(newTab.TabID));
            }
            else
            {
                errMsg = string.Format("<p>{0}</p><p>{1}</p>", GetString("Err.Header"), errMsg);
                Web.UI.Utilities.RegisterAlertOnPageLoad(this, new MessageWindowParameters(errMsg) { Title = GetString("Err.Title")});
            }
        }
开发者ID:goedings,项目名称:VendorLink,代码行数:54,代码来源:AddPage.ascx.cs

示例7: AddAdminPage

        /// <summary>
        /// AddAdminPage adds an Admin Tab Page
        /// </summary>
        ///	<param name="Portal">The Portal</param>
        ///	<param name="TabName">The Name to give this new Tab</param>
        ///	<param name="TabIconFile">The Icon for this new Tab</param>
        ///	<param name="IsVisible">A flag indicating whether the tab is visible</param>
        private static TabInfo AddAdminPage(PortalInfo Portal, string TabName, string TabIconFile, bool IsVisible)
        {
            TabController objTabController = new TabController();
            TabInfo AdminPage = objTabController.GetTab(Portal.AdminTabId, Portal.PortalID, false);

            TabPermissionCollection objTabPermissions = new TabPermissionCollection();
            AddPagePermission(ref objTabPermissions, "View", Convert.ToInt32(Portal.AdministratorRoleId));

            //Call AddPage with parentTab = AdminPage & RoleId = AdministratorRoleId
            return AddPage(AdminPage, TabName, TabIconFile, IsVisible, objTabPermissions, true);
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:18,代码来源:Upgrade.cs

示例8: GetDocUrl

        public override string GetDocUrl(SearchResult searchResult)
        {
            var url = Localization.Localization.GetString("SEARCH_NoLink");
            var tabController = new TabController();

            var tab = tabController.GetTab(searchResult.TabId, searchResult.PortalId, false);
            if (TabPermissionController.CanViewPage(tab))
            {
                url = TestableGlobals.Instance.NavigateURL(searchResult.TabId, string.Empty, searchResult.QueryString);
            }
            
            return url;
        }
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:13,代码来源:TabResultController.cs

示例9: HasViewPermission

        public override bool HasViewPermission(SearchResult searchResult)
        {
            var viewable = true;

            if (searchResult.TabId > 0)
            {
                var tabController = new TabController();
                var tab = tabController.GetTab(searchResult.TabId, searchResult.PortalId, false);
                viewable = tab != null && !tab.IsDeleted && TabPermissionController.CanViewPage(tab);
            }

            return viewable;
        }
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:13,代码来源:TabResultController.cs

示例10: GetModuleList

 public static List<ListItem> GetModuleList(string ModuleName)
 {
     List<ListItem> lst = new List<ListItem>();
     PortalSettings portalSettings = PortalController.GetCurrentPortalSettings();
     List<TabInfo> objTabs = TabController.GetPortalTabs(portalSettings.PortalId, -1, true, true);
     var objTabController = new TabController();
     var objDesktopModuleController = new DesktopModuleController();
     var objDesktopModuleInfo = objDesktopModuleController.GetDesktopModuleByModuleName(ModuleName);
     if (objDesktopModuleInfo == null)
     {
         objDesktopModuleInfo = objDesktopModuleController.GetDesktopModuleByName(ModuleName);
         if (objDesktopModuleInfo == null)
         {
             return lst;
         }
     }
     foreach (TabInfo objTab in objTabs.Where(tab => !tab.IsDeleted))
     {
         ModuleController objModules = new ModuleController();
         foreach (KeyValuePair<int, ModuleInfo> pair in objModules.GetTabModules(objTab.TabID))
         {
             ModuleInfo objModule = pair.Value;
             if (objModule.IsDeleted)
             {
                 continue;
             }
             if (objModule.DesktopModuleID != objDesktopModuleInfo.DesktopModuleID)
             {
                 continue;
             }
             string strPath = objTab.TabName;
             TabInfo objTabSelected = objTab;
             while (objTabSelected.ParentId != Null.NullInteger)
             {
                 objTabSelected = objTabController.GetTab(objTabSelected.ParentId, objTab.PortalID, false);
                 if (objTabSelected == null)
                 {
                     break;
                 }
                 strPath = string.Format("{0} -> {1}", objTabSelected.TabName, strPath);
             }
             var objListItem = new ListItem
             {
                 Value = objModule.ModuleID.ToString(),
                 Text = string.Format("{0} -> {1}", strPath, objModule.ModuleTitle)
             };
             lst.Add(objListItem);
         }
     }
     return lst;
 }
开发者ID:sachatrauwaen,项目名称:OpenBlocks,代码行数:51,代码来源:ConfiguratorUtils.cs

示例11: BindData

        /// <summary>
        /// BindData loads the Controls with Tab Data from the Database
        /// </summary>
        /// <history>
        /// 	[cnurse]	9/10/2004	Updated to reflect design changes for Help, 508 support
        ///                       and localisation
        /// </history>
        public void BindData()
        {
            TabController objTabs = new TabController();
            TabInfo objTab = objTabs.GetTab( TabId, PortalId, false );

            //Load TabControls
            LoadTabControls( objTab );

            if( objTab != null )
            {
                if( strAction != "copy" )
                {
                    txtTabName.Text = objTab.TabName;
                    txtTitle.Text = objTab.Title;
                    txtDescription.Text = objTab.Description;
                    txtKeyWords.Text = objTab.KeyWords;
                    ctlURL.Url = objTab.Url;
                }
                ctlIcon.Url = objTab.IconFile;
                if( cboTab.Items.FindByValue( objTab.ParentId.ToString() ) != null )
                {
                    cboTab.Items.FindByValue( objTab.ParentId.ToString() ).Selected = true;
                }
                chkHidden.Checked = ! objTab.IsVisible;
                chkDisableLink.Checked = objTab.DisableLink;

                ctlSkin.SkinSrc = objTab.SkinSrc;
                ctlContainer.SkinSrc = objTab.ContainerSrc;

                if( ! Null.IsNull( objTab.StartDate ) )
                {
                    txtStartDate.Text = objTab.StartDate.ToShortDateString();
                }
                if( ! Null.IsNull( objTab.EndDate ) )
                {
                    txtEndDate.Text = objTab.EndDate.ToShortDateString();
                }
                if( objTab.RefreshInterval != Null.NullInteger )
                {
                    txtRefreshInterval.Text = objTab.RefreshInterval.ToString();
                }

                txtPageHeadText.Text = objTab.PageHeadText;
            }

            // copy page options
            cboCopyPage.DataSource = LoadPortalTabs();
            cboCopyPage.DataBind();
            cboCopyPage.Items.Insert( 0, new ListItem( "<" + Localization.GetString( "None_Specified" ) + ">", "-1" ) );
            rowModules.Visible = false;
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:58,代码来源:ManageTabs.ascx.cs

示例12: UpgradeModule

        public string UpgradeModule(string Version)
        {
            try
            {
                switch (Version)
                {
                    case "06.02.00":
                        var portalController = new PortalController();
                        var moduleController = new ModuleController();
                        var tabController = new TabController();

                        var moduleDefinition = ModuleDefinitionController.GetModuleDefinitionByFriendlyName("Message Center");
                        if (moduleDefinition != null)
                        {
                            var portals = portalController.GetPortals();
                            foreach (PortalInfo portal in portals)
                            {
                                if (portal.UserTabId > Null.NullInteger)
                                {
                                    //Find TabInfo
                                    var tab = tabController.GetTab(portal.UserTabId, portal.PortalID, true);
                                    if (tab != null)
                                    {
                                        foreach (var module in moduleController.GetTabModules(portal.UserTabId).Values)
                                        {
                                            if (module.DesktopModule.FriendlyName == "Messaging")
                                            {
                                                //Delete the Module from the Modules list
                                                moduleController.DeleteTabModule(module.TabID, module.ModuleID, false);

                                                //Add new module to the page
                                                Upgrade.AddModuleToPage(tab, moduleDefinition.ModuleDefID, "Message Center", "", true);

                                                break;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        break;
                }
                return "Success";
            }
            catch (Exception exc)
            {
                Logger.Error(exc);

                return "Failed";
            }
        }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:51,代码来源:CoreMessagingBusinessController.cs

示例13: ViewTab

 /// <summary>
 /// ViewTab redirects to the Tab/Page for the currently selected tab/page
 /// </summary>
 /// <remarks>
 /// </remarks>
 /// <history>
 /// 	[cnurse]	9/9/2004	Created
 /// </history>
 private void ViewTab()
 {
     if( lstTabs.SelectedIndex != - 1 )
     {
         TabController objTabs = new TabController();
         TabInfo objTab = objTabs.GetTab( ( (TabInfo)arrPortalTabs[lstTabs.SelectedIndex] ).TabID );
         if( objTab != null )
         {
             if( objTab.DisableLink )
             {
                 UI.Skins.Skin.AddModuleMessage( this, Localization.GetString( "ViewTabMessage", this.LocalResourceFile ), ModuleMessageType.YellowWarning );
             }
             else
             {
                 Response.Redirect( Globals.NavigateURL( objTab.TabID ), true );
             }
         }
     }
 }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:27,代码来源:Tabs.ascx.cs

示例14: BindBeforeAfterTabControls

 private void BindBeforeAfterTabControls()
 {
     TabInfo parentTab = null;
     var noneSpecified = "<" + Localization.GetString("None_Specified") + ">";
     if (cboParentTab.SelectedItem != null)
     {
         var parentTabID = Int32.Parse(cboParentTab.SelectedItem.Value);
         var controller = new TabController();
         parentTab = controller.GetTab(parentTabID, PortalId, false);
     }
     List<TabInfo> listTabs = parentTab != null ? new TabController().GetTabsByPortal(parentTab.PortalID).WithParentId(parentTab.TabID) : new TabController().GetTabsByPortal(PortalId).WithParentId(Null.NullInteger);
     listTabs = TabController.GetPortalTabs(listTabs, Null.NullInteger, true, noneSpecified, false, false, false, false, true);
     cboPositionTab.DataSource = listTabs;
     cboPositionTab.DataBind();
     rbInsertPosition.Items.Clear();
     rbInsertPosition.Items.Add(new ListItem(Localization.GetString("InsertBefore", LocalResourceFile), "Before"));
     rbInsertPosition.Items.Add(new ListItem(Localization.GetString("InsertAfter", LocalResourceFile), "After"));
     rbInsertPosition.Items.Add(new ListItem(Localization.GetString("InsertAtEnd", LocalResourceFile), "AtEnd"));
     rbInsertPosition.SelectedValue = "After";
 }
开发者ID:biganth,项目名称:Curt,代码行数:20,代码来源:Import.ascx.cs

示例15: HasViewPermission

        public override bool HasViewPermission(SearchResult searchResult)
        {
            var viewable = false;
            if (searchResult.ModuleId > 0)
            {
                //Get All related tabIds from moduleId (while minimizing DB access; using caching)
                var tabController = new TabController();
                var moduleId = searchResult.ModuleId;
                // The next call has over 30% performance enhancement over the above one
                var tabModules = tabController.GetTabsByPortal(searchResult.PortalId).Values
                    .SelectMany(tabinfo => tabinfo.ChildModules.Where(kv => kv.Key == moduleId)).Select(m => m.Value);

                foreach (ModuleInfo module in tabModules)
                {
                    var tab = tabController.GetTab(module.TabID, searchResult.PortalId, false);
                    if (!module.IsDeleted && !tab.IsDeleted && TabPermissionController.CanViewPage(tab))
                    {
                        //Check If authorised to View Module
                        if (ModulePermissionController.CanViewModule(module))
                        {
                            //Verify against search document permissions
                            if (string.IsNullOrEmpty(searchResult.Permissions) || PortalSecurity.IsInRoles(searchResult.Permissions))
                            {
                                viewable = true;
                                if (string.IsNullOrEmpty(searchResult.Url))
                                {
                                    searchResult.Url = TestableGlobals.Instance.NavigateURL(module.TabID, string.Empty, searchResult.QueryString);
                                }
                                break;
                            }
                        }
                    }
                }
            }
            else
            {
                viewable = true;
            }

            return viewable;
        }
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:41,代码来源:ModuleResultController.cs


注:本文中的DotNetNuke.Entities.Tabs.TabController.GetTab方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。