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


C# PortalController.GetPortals方法代码示例

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


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

示例1: AddAdminPages

        public static void AddAdminPages(string tabName, string description, string tabIconFile, string tabIconFileLarge, bool isVisible, int moduleDefId, string moduleTitle, string moduleIconFile, bool inheritPermissions)
        {
            var portalController = new PortalController();
            ArrayList portals = portalController.GetPortals();

            //Add Page to Admin Menu of all configured Portals
            for (int intPortal = 0; intPortal <= portals.Count - 1; intPortal++)
            {
                var portal = (PortalInfo)portals[intPortal];

                //Create New Admin Page (or get existing one)
                TabInfo newPage = Upgrade.AddAdminPage(portal, tabName, description, tabIconFile, tabIconFileLarge, isVisible);

                //Add Module To Page
                Upgrade.AddModuleToPage(newPage, moduleDefId, moduleTitle, moduleIconFile, inheritPermissions);
                var moduleController = new ModuleController();

                if (newPage != null) {
                    foreach (var module in moduleController.GetTabModules(newPage.TabID).Values)
                    {
                        moduleController.UpdateTabModuleSetting(module.TabModuleID, "hideadminborder", "true");
                    }
                }

            }
        }
开发者ID:sachatrauwaen,项目名称:OpenBlocks,代码行数:26,代码来源:FeatureController.cs

示例2: BindSettingControls

        private void BindSettingControls()
        {
			// Toggle fields if a redirect already exists for the Portal Home Page
			var defaultRedirect = HomePageRedirectExists();

            // Populating Portals dropdown
            var portalController = new PortalController();
        	var portals = portalController.GetPortals().Cast<PortalInfo>().Where(p => p.PortalID != ModuleContext.PortalId).ToList();
            if (portals.Count > 0)
            {
                cboPortal.DataSource = portals;
                cboPortal.DataTextField = "PortalName";
                cboPortal.DataValueField = "PortalID";
                cboPortal.DataBind();
            }
            else
            {
                optRedirectTarget.Items[0].Enabled = false;
                optRedirectTarget.Items[0].Selected = false;
                optRedirectTarget.Items[1].Selected = true;
            }

            cboSourcePage.Visible = defaultRedirect;
            lblHomePage.Visible = !defaultRedirect;
            lblRedirectName.Visible = defaultRedirect;
            txtRedirectName.Visible = defaultRedirect;
        }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:27,代码来源:SimpleSettingsView.ascx.cs

示例3: CreateNewUser

        public UserCreateStatus CreateNewUser(string firstName, string lastName, string emailAddress, int portalId)
        {
            var ctlPortal = new PortalController();
            var portalSettings = ctlPortal.GetPortals().Cast<PortalInfo>().FirstOrDefault(p => p.PortalID == portalId);

            var user = new UserInfo()
            {
                FirstName = firstName,
                LastName = lastName,
                Email = emailAddress,
                Username = emailAddress,
                DisplayName = string.Concat(firstName, " ", lastName),
                PortalID = portalId
            };

            user.Profile.PreferredLocale = portalSettings.DefaultLanguage;
            user.Profile.FirstName = firstName;
            user.Profile.LastName = lastName;

            user.Membership.Approved = true;
            user.Membership.Password = PasswordGenerator.GeneratePassword();
            user.Membership.UpdatePassword = true;

            var status = UserController.CreateUser(ref user);

            User = user;

            return status;
        }
开发者ID:nvisionative,项目名称:dnnextensions,代码行数:29,代码来源:DnnUserController.cs

示例4: BindDetailData

        private void BindDetailData()
        {
            var pc = new PortalController();
            cboLogTypePortalID.DataTextField = "PortalName";
            cboLogTypePortalID.DataValueField = "PortalID";
            cboLogTypePortalID.DataSource = pc.GetPortals();
            cboLogTypePortalID.DataBind();

// ReSharper disable LocalizableElement
            var i = new DnnComboBoxItem{Text = Localization.GetString("All"), Value = "*"};
// ReSharper restore LocalizableElement
            cboLogTypePortalID.Items.Insert(0, i);


            pnlEditLogTypeConfigInfo.Visible = true;
            pnlLogTypeConfigInfo.Visible = false;
            var logController = new LogController();

        	var arrLogTypeInfo = logController.GetLogTypeInfoDictionary().Values.OrderBy(t => t.LogTypeFriendlyName);

            cboLogTypeKey.DataTextField = "LogTypeFriendlyName";
            cboLogTypeKey.DataValueField = "LogTypeKey";
            cboLogTypeKey.DataSource = arrLogTypeInfo;
            cboLogTypeKey.DataBind();

            int[] items = {1, 2, 3, 4, 5, 10, 25, 100, 250, 500};
            cboKeepMostRecent.Items.Clear();
            cboKeepMostRecent.Items.Add(new DnnComboBoxItem(Localization.GetString("All"), "*"));
            foreach (int item in items)
            {
                cboKeepMostRecent.Items.Add(item == 1
                                                ? new DnnComboBoxItem(item + Localization.GetString("LogEntry", LocalResourceFile), item.ToString(CultureInfo.InvariantCulture))
                                                : new DnnComboBoxItem(item + Localization.GetString("LogEntries", LocalResourceFile), item.ToString(CultureInfo.InvariantCulture)));
            }
            int[] items2 = {1, 2, 3, 4, 5, 10, 25, 100, 250, 500, 1000};
            cboThreshold.Items.Clear();
            foreach (int item in items2)
            {
                cboThreshold.Items.Add(item == 1
                                           ? new DnnComboBoxItem(item + Localization.GetString("Occurence", LocalResourceFile), item.ToString(CultureInfo.InvariantCulture))
                                           : new DnnComboBoxItem(item + Localization.GetString("Occurences", LocalResourceFile), item.ToString(CultureInfo.InvariantCulture)));
            }

            cboThresholdNotificationTime.Items.Clear();
            foreach (int item in new []{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 60, 90, 120})
            {
                cboThresholdNotificationTime.Items.Add(new DnnComboBoxItem(item.ToString(CultureInfo.InvariantCulture), item.ToString(CultureInfo.InvariantCulture)));
            }

            cboThresholdNotificationTimeType.Items.Clear();
            foreach (int item in new[] { 1, 2, 3, 4 })
            {
                cboThresholdNotificationTimeType.Items.Add(new DnnComboBoxItem(Localization.GetString(string.Format("TimeType_{0}", item), LocalResourceFile), item.ToString(CultureInfo.InvariantCulture)));
            }
// ReSharper disable LocalizableElement
            var j = new DnnComboBoxItem{Text = Localization.GetString("All"), Value = "*"};
// ReSharper restore LocalizableElement
            cboLogTypeKey.Items.Insert(0, j);
        }
开发者ID:KashbinRepository,项目名称:Core,代码行数:59,代码来源:EditLogTypes.ascx.cs

示例5: ClearCache

 private static void ClearCache()
 {
     var portalController = new PortalController();
     foreach (PortalAliasInfo portal in portalController.GetPortals())
     {
         ClearCache(portal.PortalID);
     }
 }
开发者ID:rrsc,项目名称:Dnn.Platform,代码行数:8,代码来源:ExtensionUrlProviderController.cs

示例6: 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

示例7: CacheMappedDirectory

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// CacheMappedDirectory caches the Portal Mapped Directory(s)
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///     [cnurse]    1/27/2005   Moved back to App_Start from Caching Module
        /// </history>
        /// -----------------------------------------------------------------------------
        private static void CacheMappedDirectory()
        {
            //This code is only retained for binary compatability.
#pragma warning disable 612,618
            var objFolderController = new FolderController();
            var objPortalController = new PortalController();
            ArrayList arrPortals = objPortalController.GetPortals();
            int i;
            for (i = 0; i <= arrPortals.Count - 1; i++)
            {
                var objPortalInfo = (PortalInfo)arrPortals[i];
                objFolderController.SetMappedDirectory(objPortalInfo, HttpContext.Current);
            }
#pragma warning restore 612,618
        }
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:25,代码来源:Initialize.cs

示例8: GetContent

        /// <Summary>
        /// GetContent gets all the content and passes it to the Indexer
        /// </Summary>
        /// <Param name="Indexer">
        /// The Index Provider that will index the content of the portal
        /// </Param>
        protected SearchItemInfoCollection GetContent( IndexingProvider Indexer )
        {
            SearchItemInfoCollection SearchItems = new SearchItemInfoCollection();
            PortalController objPortals = new PortalController();
            PortalInfo objPortal;

            ArrayList arrPortals = objPortals.GetPortals();
            int intPortal;
            for (intPortal = 0; intPortal <= arrPortals.Count - 1; intPortal++)
            {
                objPortal = (PortalInfo)arrPortals[intPortal];

                SearchItems.AddRange(Indexer.GetSearchIndexItems(objPortal.PortalID));
            }
            return SearchItems;
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:22,代码来源:SearchEngine.cs

示例9: Synchronize

        private void Synchronize()
        {
            PortalController objPortals = new PortalController();
            ArrayList arrPortals = objPortals.GetPortals();
            PortalInfo objPortal;

            //Sync Host
            FileSystemUtils.Synchronize(Null.NullInteger, Null.NullInteger, Globals.HostMapPath);

            //Sync Portals
            int intIndex;
            for (intIndex = 0; intIndex <= arrPortals.Count - 1; intIndex++)
            {
                objPortal = (PortalInfo)arrPortals[intIndex];
                FileSystemUtils.Synchronize(objPortal.PortalID, objPortal.AdministratorRoleId, objPortal.HomeDirectoryMapPath);
            }
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:17,代码来源:SynchronizeFileSystem.cs

示例10: Synchronize

        private void Synchronize()
        {
            var folderManager = FolderManager.Instance;
            
            folderManager.Synchronize(Null.NullInteger);
            
            PortalInfo objPortal;

            var objPortals = new PortalController();
            var arrPortals = objPortals.GetPortals();

            //Sync Portals
			for (int intIndex = 0; intIndex <= arrPortals.Count - 1; intIndex++)
            {
                objPortal = (PortalInfo) arrPortals[intIndex];
                folderManager.Synchronize(objPortal.PortalID);
            }
        }
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:18,代码来源:SynchronizeFileSystem.cs

示例11: DoPurgeSiteLog

 private void DoPurgeSiteLog()
 {
     var objSiteLog = new SiteLogController();
     var objPortals = new PortalController();
     ArrayList arrPortals = objPortals.GetPortals();
     PortalInfo objPortal;
     DateTime PurgeDate;
     int intIndex;
     for (intIndex = 0; intIndex <= arrPortals.Count - 1; intIndex++)
     {
         objPortal = (PortalInfo) arrPortals[intIndex];
         if (objPortal.SiteLogHistory > 0)
         {
             PurgeDate = DateTime.Now.AddDays(-(objPortal.SiteLogHistory));
             objSiteLog.DeleteSiteLog(PurgeDate, objPortal.PortalID);
         }
     }
 }
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:18,代码来源:PurgeSiteLog.cs

示例12: PurgeSiteLog_Renamed

        private void PurgeSiteLog_Renamed()
        {
            SiteLogController objSiteLog = new SiteLogController();

            PortalController objPortals = new PortalController();
            ArrayList arrPortals = objPortals.GetPortals();
            PortalInfo objPortal;
            DateTime PurgeDate;

            int intIndex;
            for (intIndex = 0; intIndex <= arrPortals.Count - 1; intIndex++)
            {
                objPortal = (PortalInfo)arrPortals[intIndex];
                if (objPortal.SiteLogHistory > 0)
                {
                    PurgeDate = DateAndTime.DateAdd(DateInterval.Day, -(objPortal.SiteLogHistory), DateTime.Now);
                    objSiteLog.DeleteSiteLog(PurgeDate, objPortal.PortalID);
                }
            }
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:20,代码来源:PurgeSiteLog.cs

示例13: UpdateDisplaySearchSettings

		private void UpdateDisplaySearchSettings()
		{
            var moduleController = new ModuleController();
            var portalController = new PortalController();

            foreach (PortalInfo portal in portalController.GetPortals())
            {
				foreach (ModuleInfo module in moduleController.GetModulesByDefinition(portal.PortalID, "Member Directory"))
	            {
					foreach (ModuleInfo tabModule in moduleController.GetAllTabsModulesByModuleID(module.ModuleID))
		            {
			            if (tabModule.TabModuleSettings.ContainsKey("DisplaySearch"))
			            {
				            var oldValue = bool.Parse(tabModule.TabModuleSettings["DisplaySearch"].ToString());
							moduleController.UpdateTabModuleSetting(tabModule.TabModuleID, "DisplaySearch", oldValue ? "Both" : "None");
			            }
		            }
	            }
            }
		}
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:20,代码来源:UpgradeController.cs

示例14: DoWork

        public override void DoWork()
        {
            try
            {
                ArrayList portals;
                var portalController = new PortalController();
                portals = portalController.GetPortals();
                foreach (KeyValuePair<string, ModuleCachingProvider> kvp in ModuleCachingProvider.GetProviderList())
                {
                    try
                    {
                        foreach (PortalInfo portal in portals)
                        {
                            kvp.Value.PurgeExpiredItems(portal.PortalID);
                            ScheduleHistoryItem.AddLogNote(string.Format("Purged Module cache for {0}.  ", kvp.Key));
                        }
                    }
                    catch (NotSupportedException exc)
                    {
						//some Module caching providers don't use this feature
                        Logger.Debug(exc);

                    }
                }
                ScheduleHistoryItem.Succeeded = true; //REQUIRED
            }
            catch (Exception exc) //REQUIRED
            {
                ScheduleHistoryItem.Succeeded = false; //REQUIRED

                ScheduleHistoryItem.AddLogNote(string.Format("Purging Module cache task failed: {0}.", exc.ToString()));

                //notification that we have errored
                Errored(ref exc); //REQUIRED
				
				//log the exception
                Exceptions.Exceptions.LogException(exc); //OPTIONAL
            }
        }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:39,代码来源:PurgeModuleCache.cs

示例15: Version050500

        /// <summary>
        /// While upgrading to 05.04.02, make sure the template folders get renamed to "2sxc"
        /// </summary>
        internal void Version050500()
        {
            logger.LogStep("05.05.00", "Starting", false);

            var portalController = new PortalController();
            var portals = portalController.GetPortals();
            var pathsToCopy = portals.Cast<PortalInfo>().Select(p => p.HomeDirectoryMapPath).ToList();
            pathsToCopy.Add(HttpContext.Current.Server.MapPath("~/Portals/_default/"));
            logger.LogStep("05.05.00", "Starting paths for " + pathsToCopy.Count + " paths", false);
            foreach (var path in pathsToCopy)
            {
                logger.LogStep("05.05.00", "Path: " + path, false);
                var portalFolder = new DirectoryInfo(path);
                if (portalFolder.Exists)
                {
                    var oldSexyFolder = new DirectoryInfo(Path.Combine(path, "2sexy"));
                    var newSexyFolder = new DirectoryInfo(Path.Combine(path, "2sxc"));
                    var newSexyContentFolder = new DirectoryInfo(Path.Combine(newSexyFolder.FullName, Constants.ContentAppName));
                    if (oldSexyFolder.Exists && !newSexyFolder.Exists)
                    {
                        logger.LogStep("05.05.00", "Path: " + path + " will copy from 2Sexy to 2sxc", false);

                        // Move 2sexy directory to 2sxc/Content
                        Helpers.DirectoryCopy(oldSexyFolder.FullName, newSexyContentFolder.FullName, true);

                        // Leave info message in the content folder
                        File.WriteAllText(Path.Combine(oldSexyFolder.FullName, "__WARNING - old copy of files - READ ME.txt"), "This is a short information\r\n\r\n2sxc renamed the main folder from \"[Portal]/2Sexy\" to \"[Portal]/2sxc\" in version 5.5.\r\n\r\nTo make sure that links to images/css/js still work, the old folder was copied and this was left. Please clean up and delete the entire \"[Portal]/2Sexy/\" folder once you're done. \r\n\r\nMany thanks!\r\n2sxc\r\n\r\nPS: Remember that you might have ClientDependency activated, so maybe you still have bundled & minified  JS/CSS-Files in your cache pointing to the old location. When done cleaning up, we recommend increasing the version just to be sure you're not seeing an old files that don't exist any more. ");

                        // Move web.config (should be directly in 2sxc)
                        if (File.Exists(Path.Combine(newSexyContentFolder.FullName, "web.config")))
                            File.Move(Path.Combine(newSexyContentFolder.FullName, "web.config"), Path.Combine(newSexyFolder.FullName, "web.config"));

                    }
                }
            }
            logger.LogStep("05.05.00", "Paths done", false);
        }
开发者ID:2sic,项目名称:2sxc,代码行数:40,代码来源:V5.cs


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