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


C# TabController.GetAllTabs方法代码示例

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


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

示例1: UrlForTabPath

        public static string UrlForTabPath(string tabPath, string csvParams)
        {
            TabController tabs = new TabController();
            List<TabInfo> tabInfos = new List<TabInfo>((TabInfo[])tabs.GetAllTabs().ToArray(typeof(TabInfo)));
            foreach (TabInfo info in tabInfos)
            {
                if (info.TabPath == tabPath && !info.IsDeleted)
                {
                    return Globals.NavigateURL(info.TabID, "", csvParams.Split(','));
                }
            }

            return "";
        }
开发者ID:trantruong2007,项目名称:angeldnn,代码行数:14,代码来源:UrlHelper.cs

示例2: SearchPagesInternal

        private NTree<ItemDto> SearchPagesInternal(int portalId, string searchText, int sortOrder)
        {
            var tree = new NTree<ItemDto> { Data = new ItemDto { Key = RootKey } };

            List<TabInfo> tabs;
            if (portalId == -1)
            {
                portalId = GetActivePortalId();
            }
            else
            {
                if (!IsPortalIdValid(portalId))
                {
                    return tree;
                }
            }

            Func<TabInfo, bool> searchFunc;
            if (String.IsNullOrEmpty(searchText))
            {
                searchFunc = page => true;
            }
            else
            {
                searchFunc = page => page.LocalizedTabName.IndexOf(searchText, StringComparison.InvariantCultureIgnoreCase) > -1;
            }

            var tabController = new TabController();
            var allTabs = tabController.GetAllTabs().ToArray().Select(tab => (TabInfo)tab).ToList();

            if (portalId > -1)
            {
                var includeHiddenTabs = PortalSettings.UserInfo.IsSuperUser || PortalSettings.UserInfo.IsInRole("Administrators");
               
                if (!includeHiddenTabs) allTabs = allTabs.Where(t => t.IsVisible).ToList();
                tabs = allTabs.Where(tab => tab.PortalID == portalId && !tab.DisableLink && searchFunc(tab))
                    .OrderBy(tab => tab.TabOrder)
                    .ToList();
            }
            else
            {
                if (PortalSettings.UserInfo.IsSuperUser)
                {
                    tabs = allTabs.Where(tab => tab.PortalID == -1 && !tab.DisableLink && searchFunc(tab))
                    .OrderBy(tab => tab.TabOrder)
                    .ToList();
                }
                else
                {
                    return tree;
                }
            }

            var pages = tabs.Select(tab => new ItemDto
                {
                    Key = tab.TabID.ToString(CultureInfo.InvariantCulture),
                    Value = tab.LocalizedTabName,
                    HasChildren = false,
                    Selectable = true
                });

            tree.Children = ApplySort(pages, sortOrder).Select(dto => new NTree<ItemDto> { Data = dto }).ToList();
            return tree;
        }
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:64,代码来源:ItemListServiceController.cs

示例3: UpgradeApplication


//.........这里部分代码省略.........
                            if (objModule.AuthorizedViewRoles.IndexOf(";") > 0)
                            {
                                roles = objModule.AuthorizedViewRoles.Split(';');
                                for (k = 0; k <= roles.Length - 1; k++)
                                {

                                    if (Int32.TryParse(roles[k], out intViewModulePermissionID))
                                    {
                                        objModulePermission.PermissionID = intViewModulePermissionID;
                                        objModulePermission.AllowAccess = true;
                                        objModulePermission.RoleID = Convert.ToInt32(roles[k]);
                                        objModulePermissionController.AddModulePermission(objModulePermission);
                                    }
                                }
                            }
                            if (objModule.AuthorizedEditRoles.IndexOf(";") > 0)
                            {
                                roles = objModule.AuthorizedEditRoles.Split(';');
                                for (k = 0; k <= roles.Length - 1; k++)
                                {
                                    if (Int32.TryParse(roles[k], out intEditModulePermissionID))
                                    {
                                        objModulePermission.PermissionID = intEditModulePermissionID;
                                        objModulePermission.AllowAccess = true;
                                        objModulePermission.RoleID = Convert.ToInt32(roles[k]);
                                        objModulePermissionController.AddModulePermission(objModulePermission);
                                    }
                                }
                            }
                        }

                        ArrayList arrTabs;
                        TabController objTabController = new TabController();
                        arrTabs = objTabController.GetAllTabs();

                        TabPermissionController objTabPermissionController = new TabPermissionController();
                        for (ModCount = 0; ModCount <= arrTabs.Count - 1; ModCount++)
                        {
                            TabInfo objTab = (TabInfo)arrTabs[ModCount];
                            TabPermissionInfo objTabPermission = new TabPermissionInfo();
                            objTabPermission.TabID = objTab.TabID;
                            int k;
                            string[] roles;
                            if (objTab.AuthorizedRoles.IndexOf(";") > 0)
                            {
                                roles = objTab.AuthorizedRoles.Split(';');
                                for (k = 0; k <= roles.Length - 1; k++)
                                {
                                    if (Int32.TryParse(roles[k], out intViewTabPermissionID))
                                    {
                                        objTabPermission.PermissionID = intViewTabPermissionID;
                                        objTabPermission.AllowAccess = true;
                                        objTabPermission.RoleID = Convert.ToInt32(roles[k]);
                                        objTabPermissionController.AddTabPermission(objTabPermission);
                                    }
                                }
                            }
                            if (objTab.AdministratorRoles.IndexOf(";") > 0)
                            {
                                roles = objTab.AdministratorRoles.Split(';');
                                for (k = 0; k <= roles.Length - 1; k++)
                                {
                                    if (Int32.TryParse(roles[k], out intEditTabPermissionID))
                                    {
                                        objTabPermission.PermissionID = intEditTabPermissionID;
                                        objTabPermission.AllowAccess = true;
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:67,代码来源:Upgrade.cs


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