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


C# ModuleController.GetModulesByDefinition方法代码示例

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


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

示例1: GetAllAnnouncements

        public HttpResponseMessage GetAllAnnouncements(string output)
        {
            try
            {
                var mc = new ModuleController();
                var results = new List<AnnouncementInfo>();
                // get list of all announcements modules in the site
                var annModules = mc.GetModulesByDefinition(PortalSettings.PortalId, "Announcements");
                // loop through all the modules
                foreach (ModuleInfo m in annModules )
                {
                   // make sure to only include modules the user actually has access to
                   if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.View, "VIEW", m))
                   {
                       // get the current announcements of the module
                       IEnumerable<Components.Business.AnnouncementInfo> baseResults = new Components.Business.AnnouncementsController().GetCurrentAnnouncements(m.ModuleID);
                       // add to the total results list
                       results.AddRange(baseResults.Select(announcementInfo => new AnnouncementInfo(announcementInfo)).ToList());
                   }  
                }

                return GenerateOutput(results.OrderByDescending(a => a.PublishDate).ToList(), output);
            }
            catch (Exception ex)
            {
                DnnLog.Error(ex);
                return Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message);
            }

        }
开发者ID:schotman,项目名称:DNN.Announcements,代码行数:30,代码来源:AnnouncementsController.cs

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

示例3: NavigateUrl

        /// <summary>
        /// A public statically available method in which clients can call to get effectly the "NavigateUrl()"
        /// for this module. Code that references this project can obtain a valid URL to navigate to for another module.
        /// </summary>
        /// <returns>The url to the survey's default control.</returns>
        public static string NavigateUrl()
        {
            var mc = new ModuleController();
            int portalId = PortalController.GetCurrentPortalSettings().PortalId;
            ArrayList modules = mc.GetModulesByDefinition(portalId, ModuleDefinitionFriendlyName);

            foreach (ModuleInfo module in modules)
            {
                return Globals.NavigateURL(module.TabID);
            }

            // either the freindly name is wrong or no modules defined. Maybe should throw exception instead?
            return Globals.NavigateURL();
        }
开发者ID:EngageSoftware,项目名称:Engage-Survey,代码行数:19,代码来源:Utility.cs

示例4: GetSearchTabId

        private int GetSearchTabId()
        {
            int searchTabId = PortalSettings.SearchTabId;
            if (searchTabId == Null.NullInteger)
            {
                var objModules = new ModuleController();
                ArrayList arrModules = objModules.GetModulesByDefinition(PortalSettings.PortalId, "Search Results");
                if (arrModules.Count > 1)
                {
                    foreach (ModuleInfo SearchModule in arrModules)
                    {
                        if (SearchModule.CultureCode == PortalSettings.CultureCode)
                        {
                            searchTabId = SearchModule.TabID;
                        }
                    }
                }
                else if (arrModules.Count == 1)
                {
                    searchTabId = ((ModuleInfo)arrModules[0]).TabID;
                }
            }

            return searchTabId;
        }
开发者ID:ReneProc,项目名称:BoatRouteKeeper,代码行数:25,代码来源:Search.ascx.cs

示例5: LoadSettings

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// LoadSettings loads the settings from the Database and displays them
        /// </summary>
        /// -----------------------------------------------------------------------------
        public override void LoadSettings()
        {
            try
            {
                if (Page.IsPostBack == false)
                {
                    var moduleSettings = new ModuleController().GetModuleSettings(ModuleId);
                    var settings = ActiveForumsTapatalkModuleSettings.Create(moduleSettings);

                    // Bind the Simple Settings
                    ckEnabled.Checked = settings.IsOpen;
                    ckAllowAnonymous.Checked = settings.AllowAnonymous;
                    txtRegistrationPage.Text = settings.RegistrationUrl;

                    // Bind Active Forum Instances
                    ddlAFInstance.Items.Clear();
                    ddlAFInstance.ClearSelection();

                    ckEnableTapatalkDetection.Checked = settings.IsTapatalkDetectionEnabled;

                    ddlSearchPermission.ClearSelection();
                    var searchPermissionItem = ddlSearchPermission.Items.FindByValue(((int) settings.SearchPermission).ToString());
                    if (searchPermissionItem != null)
                        searchPermissionItem.Selected = true;

                    var mc = new ModuleController();
                    var tc = new TabController();

                    var selectedValue = string.Format("{0}|{1}", settings.ForumTabId, settings.ForumModuleId);

                    foreach(ModuleInfo mi in mc.GetModulesByDefinition(PortalId, "Active Forums"))
                    {
                        if(mi.IsDeleted)
                            continue;

                        var ti = tc.GetTab(mi.TabID, PortalId, false);
                        if(ti != null && !ti.IsDeleted)
                        {
                            var itemValue = string.Format("{0}|{1}", ti.TabID, mi.ModuleID);
                            ddlAFInstance.Items.Add(new ListItem
                                                        {
                                                            Text = ti.TabName + " - " + mi.DesktopModule.ModuleName,
                                                            Value = ti.TabID + "|" + mi.ModuleID,
                                                            Selected = itemValue == selectedValue
                                                        });
                        }
                    }

                    // Bind the Tapatalk.Com info
                    txtForumUrl.Text = string.Format("{0}://{1}", Request.Url.Scheme, Request.Url.Host);
                    txtInstallationDirectoryName.Text = string.Format("aft{0}", ModuleId);
                    txtFileExtension.Text = "ashx";

                    // Bind the Tapatalk API Handler
                    var isTapatalkAPIHandlerEnabled = IsTapatalkAPIHandlerEnabled();

                    ckEnabled.Enabled = isTapatalkAPIHandlerEnabled;
                    lbInstallHandler.Text =
                        LocalizeString(isTapatalkAPIHandlerEnabled
                                           ? "UninstallTapatalkAPIHandler"
                                           : "InstallTapatalkAPIHandler");

                    var u = UserController.GetCurrentUserInfo();
                    lbInstallHandler.Enabled = u.IsSuperUser && !PortalSettings.PortalAlias.HTTPAlias.Contains("/");

                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
开发者ID:jbrunken,项目名称:ActiveForumsTapatalk,代码行数:77,代码来源:Settings.ascx.cs

示例6: cmdDelete_Click

        protected void cmdDelete_Click(object sender, EventArgs e)
        {
            txtMessage.Visible = true;
            bool itemExists = false;

            if (ItemId > -1)
            {
                //Using GetItemTypeId as substitute for IfExists
                if (Item.GetItemTypeId(ItemId, PortalId) > -1)
                {
                    itemExists = true;
                    bool inUse = false;
                    var modulesInUse = new StringBuilder();
                    var mc = new ModuleController();
                    ArrayList modules = mc.GetModulesByDefinition(PortalId, Utility.DnnFriendlyModuleName);

                    foreach (ModuleInfo module in modules)
                    {
                        Hashtable settings = mc.GetTabModuleSettings(module.TabModuleID);

                        if (settings.ContainsKey("DisplayType") && settings["DisplayType"].ToString() == "ArticleDisplay")
                        {
                            int articleId;
                            if (settings.ContainsKey("adArticleId") && int.TryParse(settings["adArticleId"].ToString(), out articleId))
                            {
                                if (articleId == ItemId)
                                {
                                    inUse = true;
                                    modulesInUse.AppendFormat("{0} ({1}){2}", module.ModuleTitle, module.TabID, Environment.NewLine);
                                    break;
                                }
                            }
                        }
                    }

                    ArrayList featuredRelationships = ItemRelationship.GetItemChildRelationships(ItemId, Util.RelationshipType.ItemToFeaturedItem.GetId());
                    bool isFeatured = featuredRelationships.Count > 0;

                    if (!inUse && !isFeatured)
                    {
                        //Item.DeleteItem(ItemId);
                        Item.DeleteItem(ItemId, PortalId);
                        txtMessage.Text = Localization.GetString("DeleteSuccess", LocalResourceFile);

                    }
                    else
                    {
                        var errorMessage = new StringBuilder();

                        if (inUse)
                        {
                            errorMessage.AppendFormat("{0}{1}", Localization.GetString("DeleteFailureInUse", LocalResourceFile), Environment.NewLine);
                            errorMessage.Append(modulesInUse.ToString());
                        }
                        if (isFeatured)
                        {
                            errorMessage.AppendFormat("{0}{1}", Localization.GetString("DeleteFailureIsFeatured", LocalResourceFile), Environment.NewLine);

                            foreach (ItemRelationship rel in featuredRelationships)
                            {
                                Category parentCategory = Category.GetCategory(rel.ChildItemId, PortalId);
                                errorMessage.AppendFormat("{0}{1}", parentCategory.Name, Environment.NewLine);
                            }
                        }
                        txtMessage.Text = errorMessage.ToString();
                    }
                }
            }
            if (!itemExists)
            {
                txtMessage.Text = Localization.GetString("DeleteFailure", LocalResourceFile);
            }
            ShowOnlyMessage();
        }
开发者ID:ChrisHammond,项目名称:Engage-Publish,代码行数:74,代码来源:ArticleEdit.ascx.cs

示例7: SendStatusUpdateEmail

        private void SendStatusUpdateEmail()
        {
            //string toAddress = string.Empty;
            int edittabid = -1;
            int editModuleId = -1;
            var objModules = new ModuleController();
            foreach (ModuleInfo mi in objModules.GetModulesByDefinition(PortalId, Utility.DnnFriendlyModuleName))
            {
                if (!mi.IsDeleted && mi.TabID != -1)
                {
                    var objTabs = new TabController();
                    if (!objTabs.GetTab(mi.TabID, mi.PortalID, false).IsDeleted)
                    {
                        edittabid = mi.TabID;
                        editModuleId = mi.ModuleID;
                        break;
                    }
                    continue;
                }
            }

            UserInfo ui = UserController.GetCurrentUserInfo();
            if (ui.Username != null)
            {
                UserInfo versionAuthor = UserController.GetUserById(PortalId, _authorUserId);

                //if this is the same user, don't email them notification.
                if (versionAuthor != null && versionAuthor.Email != ui.Email)
                {
                    DotNetNuke.Entities.Portals.PortalSettings ps = DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings();
                    //string linkUrl = Globals.NavigateURL(this.DisplayTabId, "", "VersionId=" + this.ItemVersionId.ToString(CultureInfo.InvariantCulture));
                    string linkUrl = Globals.NavigateURL(DisplayTabId, "", "VersionId=" + ItemVersionId.ToString(CultureInfo.InvariantCulture) + "&modid=" + ModuleId);
                    //href = Globals.NavigateURL(_displayTabId, "", "VersionId=" + _itemVersionId.ToString(CultureInfo.InvariantCulture) + "&modid=" + version.ModuleId.ToString());

                    string linksUrl = Globals.NavigateURL(edittabid, "", "&ctl=" + Utility.AdminContainer + "&mid=" + editModuleId.ToString(CultureInfo.InvariantCulture) + "&adminType=" + "VersionsList&_itemId=" + ItemId);

                    //Now ask for the approriate subclass (which gets it from the correct resource file) the subject and body.
                    string body = EmailStatusChangeBody;
                    body = body.Replace("[ENGAGEITEMNAME]", _name);
                    body = body.Replace("[ENGAGEITEMLINK]", linkUrl);
                    body = body.Replace("[ENGAGEITEMSLINK]", linksUrl);

                    body = body.Replace("[ADMINNAME]", ui.DisplayName);
                    body = body.Replace("[ENGAGEITEMCOMMENTS]", _approvalComments);

                    body = body.Replace("[ENGAGESTATUS]", ApprovalStatus.GetFromId(ApprovalStatusId, typeof(ApprovalStatus)).Name);

                    string subject = EmailStatusChangeSubject;

                    Mail.SendMail(ps.Email, versionAuthor.Email, "", subject, body, "", "HTML", "", "", "", "");
                }
            }
        }
开发者ID:ChrisHammond,项目名称:Engage-Publish,代码行数:53,代码来源:Item.cs

示例8: SendApprovalEmail

        private void SendApprovalEmail()
        {
            //string toAddress = string.Empty;
            int edittabid = -1;
            int editModuleId = -1;
            var objModules = new ModuleController();
            foreach (ModuleInfo mi in objModules.GetModulesByDefinition(PortalId, Utility.DnnFriendlyModuleName))
            {
                if (!mi.IsDeleted)
                {
                    var objTabs = new TabController();
                    if (!objTabs.GetTab(mi.TabID, mi.PortalID, false).IsDeleted)
                    {
                        edittabid = mi.TabID;
                        editModuleId = mi.ModuleID;
                        break;
                    }
                    continue;
                }
            }

            UserInfo ui = UserController.GetCurrentUserInfo();
            if (ui.Username != null)
            {
                var rc = new RoleController();

                ArrayList users = rc.GetUsersByRoleName(ui.PortalID, HostController.Instance.GetString(Utility.PublishEmailNotificationRole + PortalId));

                DotNetNuke.Entities.Portals.PortalSettings ps = DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings();
                string linkUrl = Globals.NavigateURL(DisplayTabId, "", "VersionId=" + ItemVersionId.ToString(CultureInfo.InvariantCulture) + "&modid=" + _moduleId);
                string linksUrl = Globals.NavigateURL(edittabid, "", "&ctl=" + Utility.AdminContainer + "&mid=" + editModuleId.ToString(CultureInfo.InvariantCulture) + "&adminType=" + "VersionsList&_itemId=" + ItemId);

                //Now ask for the approriate subclass (which gets it from the correct resource file) the subject and body.
                string body = EmailApprovalBody;
                body = body.Replace("[ENGAGEITEMNAME]", _name);
                body = body.Replace("[ENGAGEITEMLINK]", linkUrl);
                body = body.Replace("[ENGAGEITEMSLINK]", linksUrl);

                string subject = EmailApprovalSubject;

                foreach (UserInfo u in users)
                {
                    Mail.SendMail(ps.Email, u.Email, "", subject, body, "", "HTML", "", "", "", "");
                }
            }
        }
开发者ID:ChrisHammond,项目名称:Engage-Publish,代码行数:46,代码来源:Item.cs

示例9: GetRules

        public override List<UrlRule> GetRules(int PortalId)
        {
            List<UrlRule> Rules = new List<UrlRule>();
            Dictionary<string, Locale> dicLocales = LocaleController.Instance.GetLocales(PortalId);
            ProductController pc = new ProductController();
            CategoryController cc = new CategoryController();
            ModuleController mc = new ModuleController();
            ArrayList modules = mc.GetModulesByDefinition(PortalId, "NB_Store_ProductList");
            foreach (ModuleInfo module in modules.OfType<ModuleInfo>().Where(m=> m.IsDeleted == false))
            {
                Hashtable modSettings = mc.GetModuleSettings(module.ModuleID);

                int DetailTabId = Null.NullInteger;
                if (modSettings["lstProductTabs"] != null)
                {
                    string lstProductTabs = modSettings["lstProductTabs"].ToString();
                    int.TryParse(lstProductTabs, out DetailTabId);
                }
                bool RewriteProducts = module.TabID == DetailTabId;

                bool BrowseCategory = Null.NullBoolean;
                string chkBrowseCategory = modSettings["chkBrowseCategory"] == null ? "" :  modSettings["chkBrowseCategory"].ToString();
                Boolean.TryParse(chkBrowseCategory, out BrowseCategory);

                bool IndexProducts = true;
                if (modSettings["chkIndexProducts"] != null)
                {
                    Boolean.TryParse(modSettings["chkIndexProducts"].ToString(), out IndexProducts);
                }

                int CatID = Null.NullInteger;
                string ddlDefaultCategory = modSettings["ddlDefaultCategory"] == null ? "" : modSettings["ddlDefaultCategory"].ToString();
                int.TryParse(ddlDefaultCategory, out CatID);
                foreach (KeyValuePair<string, Locale> key in dicLocales)
                {
                    string CultureCode = key.Value.Code;
                    string RuleCultureCode = (dicLocales.Count > 1 ? CultureCode : null);
                    bool chkCascadeResults = false;
                    bool.TryParse(modSettings["chkCascadeResults"] == null ? "" : modSettings["chkCascadeResults"].ToString(), out chkCascadeResults);

                    if (RewriteProducts)
                    {
                        var prodLst = GetProductList(PortalId, pc, cc, CatID, CultureCode, chkCascadeResults);

                        //var prodLst = pc.GetProductList(PortalId, CatID, CultureCode, false);
                        foreach (ProductListInfo prod in prodLst)
                        {
                            var rule = new UrlRule
                            {
                                RuleType = UrlRuleType.Module,
                                CultureCode = RuleCultureCode,
                                TabId = module.TabID,
                                Parameters = "ProdID=" + prod.ProductID + (CatID == Null.NullInteger ? "" : "&" + "CatID=" + CatID),
                                Action = UrlRuleAction.Rewrite,
                                Url = CleanupUrl(prod.SEOName == "" ? prod.ProductName : prod.SEOName),
                                InSitemap = IndexProducts
                            };
                            Rules.Add(rule);
                        }
                    }
                    if (BrowseCategory)
                    {
                        var CatRules = GetRulesForCategory(PortalId, CultureCode, module.TabID, CatID, "", pc, cc, RuleCultureCode, chkCascadeResults, RewriteProducts, IndexProducts);
                        Rules.AddRange(CatRules);
                    }
                }
            }
            return Rules;
        }
开发者ID:sachatrauwaen,项目名称:NBStore_OpenUrlRewriter,代码行数:69,代码来源:NbStoreUrlRuleProvider.cs

示例10: BindRegionSetting

 private void BindRegionSetting()
 {
     //ModuleController
     ModuleController moduleController = new ModuleController();
     //TabController
     TabController tabController = new TabController();
     //Modules
     ArrayList al = moduleController.GetModulesByDefinition(PortalId, "RegionSetting");
     foreach (ModuleInfo moduleInfo in al)
     {
         //Tabs
         IDictionary<int, TabInfo> dicTabInfo =
             tabController.GetTabsByModuleID(moduleInfo.ModuleID);
         foreach (TabInfo tabInfo in dicTabInfo.Values)
         {
             foreach (ModuleInfo moduleInfo2 in tabInfo.ChildModules.Values)
             {
                 if (moduleInfo2.TabModuleID == moduleInfo.TabModuleID)
                 {
                     if (moduleInfo2.TabModuleSettings.ContainsKey("RegionSetting.ViewMode"))
                     {
                         if (moduleInfo2.TabModuleSettings["RegionSetting.ViewMode"].ToString() == "Form")
                         {
                             ddlRegionSetting.Items.Add(new ListItem(tabInfo.TabPath, moduleInfo2.ModuleID.ToString()));
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:asaki0510,项目名称:AlarmRuleSet,代码行数:31,代码来源:Settings.ascx.cs

示例11: GetCurrentModuleByDefinition

        /// <summary>
        /// Gets an instance of the Employment module with the given <paramref name="moduleDefinition"/> and <paramref name="jobGroupId"/> which can be viewed by the current user.
        /// </summary>
        /// <param name="portalSettings">The portal id.</param>
        /// <param name="moduleDefinition">The module definition.</param>
        /// <param name="jobGroupId">ID of the Job Group displayed on the module.</param>
        /// <returns>A non-deleted <see cref="ModuleInfo"/> with the given <paramref name="moduleDefinition"/>, or null if none exists.</returns>
        public static ModuleInfo GetCurrentModuleByDefinition(PortalSettings portalSettings, ModuleDefinition moduleDefinition, int? jobGroupId)
        {
            var moduleController = new ModuleController();
            var tabController = new TabController();

            // GetModulesByDefinition's obsolete status was rescinded after DNN 5.0
            #pragma warning disable 618

            return (from ModuleInfo module in moduleController.GetModulesByDefinition(portalSettings.PortalId, moduleDefinition.ToString())
                    where !module.IsDeleted && PortalSecurity.HasNecessaryPermission(SecurityAccessLevel.View, portalSettings, module)
                    let moduleJobGroupSetting = ModuleSettings.JobGroupId.GetValueAsInt32For(EmploymentController.DesktopModuleName, module, ModuleSettings.JobGroupId.DefaultValue)
                    let tab = tabController.GetTab(module.TabID, portalSettings.PortalId, false)
                    where tab != null && !tab.IsDeleted && TabPermissionController.HasTabPermission(tab.TabPermissions, "VIEW") && (jobGroupId.Equals(moduleJobGroupSetting) || moduleJobGroupSetting == null)
                    orderby !jobGroupId.Equals(moduleJobGroupSetting), moduleJobGroupSetting != null // false then true (i.e. job groups are equal *first*, then module's job group is null)
                    select module).FirstOrDefault();

            #pragma warning restore 618
        }
开发者ID:krishna23456,项目名称:Engage-Employment,代码行数:25,代码来源:Utility.cs

示例12: GetPermissibleJobGroups

        /// <summary>
        /// Gets a list of IDs of the job groups which the current user has permission to edit (and therefore to view documents for).
        /// </summary>
        /// <returns>A list of IDs for the job groups that the current user can view documents for.</returns>
        private IList<int?> GetPermissibleJobGroups()
        {
            var permissibleJobGroups = new List<int?>();
            if (UserInfo.IsSuperUser)
            {
                permissibleJobGroups.Add(null);
            }
            else
            {
            // GetModulesByDefinition's obsolete status was rescinded after DNN 5.0
            #pragma warning disable 618

                var moduleController = new ModuleController();
                foreach (ModuleInfo module in moduleController.GetModulesByDefinition(this.PortalSettings.PortalId, ModuleDefinition.JobListing.ToString()))
                {
            #pragma warning restore 618
                    int? jobGroupId = ModuleSettings.JobGroupId.GetValueAsInt32For(EmploymentController.DesktopModuleName, module, ModuleSettings.JobGroupId.DefaultValue);
                    if (!permissibleJobGroups.Contains(jobGroupId))
                    {
                        if (PermissionController.CanManageApplications(module))
                        {
                            permissibleJobGroups.Add(jobGroupId);

                            if (!jobGroupId.HasValue)
                            {
                                // if they have access to the "null" job group, they can see it all, no need to keep looking
                                break;
                            }
                        }
                    }
                }
            }

            return permissibleJobGroups;
        }
开发者ID:fujinguyen,项目名称:Engage-Employment,代码行数:39,代码来源:GetResume.aspx.cs

示例13: Modules

 public HttpResponseMessage Modules()
 {
     var mc = new ModuleController();
     var annModules = mc.GetModulesByDefinition(PortalSettings.PortalId, "Announcements");
     var results = (from ModuleInfo m in annModules where ModulePermissionController.HasModuleAccess(SecurityAccessLevel.View, "VIEW", m) select new AnnouncementsModule(m)).ToList();
     
     return Request.CreateResponse(HttpStatusCode.OK, results);
 }
开发者ID:schotman,项目名称:DNN.Announcements,代码行数:8,代码来源:AnnouncementsController.cs

示例14: LoadTagDropDown

        private void LoadTagDropDown()
        {
            var mc = new ModuleController();
            var tc = new TabController();
            ArrayList al = mc.GetModulesByDefinition(this.PortalId, Utility.DnnTagsFriendlyModuleName);

            this.ddlTagList.Items.Insert(0, new ListItem(Localization.GetString("ChooseOne", this.LocalResourceFile), "-1"));

            foreach (ModuleInfo mi in al)
            {
                TabInfo ti = tc.GetTab(mi.TabID, mi.PortalID, false);
                var li = new ListItem(ti.TabName + " (" + ti.TabID + ")", ti.TabID.ToString(CultureInfo.InvariantCulture));
                this.ddlTagList.Items.Add(li);
            }
        }
开发者ID:EngageSoftware,项目名称:Engage-Publish,代码行数:15,代码来源:AdminSettings.ascx.cs

示例15: FillPhotoGalleryDropDown

        private void FillPhotoGalleryDropDown()
        {
            var modules = new ModuleController();

            var simpleGalleryAlbums = new SortedList<string, ListItem>(StringComparer.CurrentCultureIgnoreCase);
            if (this.AllowSimpleGalleryIntegration)
            {
                foreach (ModuleInfo module in modules.GetModulesByDefinition(this.PortalId, Utility.SimpleGalleryFriendlyName))
                {
                    if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, string.Empty, module))
                    {
                        IDataReader dr = DataProvider.Instance().GetSimpleGalleryAlbums(module.ModuleID);
                        while (dr.Read())
                        {
                            string caption = dr["Caption"].ToString();
                            for (int i = 0; simpleGalleryAlbums.ContainsKey(caption); i++)
                            {
                                caption += i.ToString(CultureInfo.InvariantCulture);
                            }

                            simpleGalleryAlbums.Add(caption, new ListItem(dr["Caption"].ToString(), "s" + dr["AlbumId"]));
                        }
                    }
                }
            }

            var ultaMediaGalleryAlbums = new SortedList<string, ListItem>(StringComparer.CurrentCultureIgnoreCase);
            if (this.AllowUltraMediaGalleryIntegration)
            {
                foreach (ModuleInfo module in modules.GetModulesByDefinition(this.PortalId, Utility.UltraMediaGalleryFriendlyName))
                {
                    if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, string.Empty, module))
                    {
                        IDataReader dr = DataProvider.Instance().GetUltraMediaGalleryAlbums(module.ModuleID);
                        while (dr.Read())
                        {
                            string title = dr["Title"].ToString();
                            for (int i = 0; ultaMediaGalleryAlbums.ContainsKey(title); i++)
                            {
                                title += i.ToString(CultureInfo.InvariantCulture);
                            }

                            ultaMediaGalleryAlbums.Add(title, new ListItem(dr["Title"].ToString(), "u" + dr["ItemId"]));
                        }
                    }
                }
            }

            // label which module it's from if there are some from both.
            bool labelModuleType = simpleGalleryAlbums.Count > 0 && ultaMediaGalleryAlbums.Count > 0;

            foreach (ListItem li in simpleGalleryAlbums.Values)
            {
                if (labelModuleType)
                {
                    li.Text += " - " + Localization.GetString("SimpleGallery", this.LocalResourceFile);
                }

                this.ddlPhotoGalleryAlbum.Items.Add(li);
            }

            foreach (ListItem li in ultaMediaGalleryAlbums.Values)
            {
                if (labelModuleType)
                {
                    li.Text += " - " + Localization.GetString("UltraMediaGallery", this.LocalResourceFile);
                }

                this.ddlPhotoGalleryAlbum.Items.Add(li);
            }
        }
开发者ID:EngageSoftware,项目名称:Engage-Publish,代码行数:71,代码来源:ArticleEdit.ascx.cs


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