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


C# ModuleController.GetModule方法代码示例

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


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

示例1: btGo_Click

        public void btGo_Click(object sender, EventArgs e)
        {
            //Setup Child Page - Main View/Activity
            TabInfo tab = CreatePage(PortalSettings.ActiveTab, PortalId, TabId, "Group Activity", false);
            //Add Module to Child Page
            int groupViewModuleId = AddModule(tab, PortalId, "Social Groups", "ContentPaneProfile");
            int journalModuleId = AddModule(tab, PortalId, "Journal", "ContentPaneProfile");
            int consoleId = AddModule(tab, PortalId, "Console", "RightPaneProfile");

            var mc = new ModuleController();

            ModuleInfo groupConsoleModule = mc.GetModule(consoleId, tab.TabID);
            TabInfo memberTab = CreatePage(PortalSettings.ActiveTab, PortalId, tab.TabID, "Members", false);
            mc.CopyModule(groupConsoleModule, memberTab, "RightPaneProfile", true);

            ModuleInfo groupViewModule = mc.GetModule(groupViewModuleId, tab.TabID);
            mc.CopyModule(groupViewModule, memberTab, "ContentPaneProfile", true);
            AddModule(memberTab, PortalId, "DotNetNuke.Modules.MemberDirectory", "ContentPaneProfile");


            //List Settings
            var modules = new ModuleController();
            modules.UpdateTabModuleSetting(TabModuleId, Constants.GroupLoadView, GroupMode.List.ToString());
            modules.UpdateTabModuleSetting(TabModuleId, Constants.GroupViewPage, tab.TabID.ToString(CultureInfo.InvariantCulture));

            Response.Redirect(Request.RawUrl);
        }
开发者ID:biganth,项目名称:Curt,代码行数:27,代码来源:Setup.ascx.cs

示例2: getModuleInfo

        public static ModuleInfo getModuleInfo(int moduleId, int tabId)
        {
            var modController = new ModuleController();
            var modInfo = modController.GetModule(moduleId, tabId);
            return modInfo;

        }
开发者ID:BravoSierra,项目名称:2sxc,代码行数:7,代码来源:SecurityContext.cs

示例3: BuildEditUrl

        public static string BuildEditUrl(int itemId, int tabId, int moduleId)
        {
            int id = Convert.ToInt32(itemId, CultureInfo.InvariantCulture);
            int typeId = Item.GetItemTypeId(id);
            ItemType type = ItemType.GetFromId(typeId, typeof(ItemType));
            Item i;
            var controller = new ModuleController();
            int portalId = controller.GetModule(moduleId, tabId).PortalID;
            if (type.Name == ItemType.Article.Name)
            {
                i = Article.GetArticle(id, portalId);
            }
            else
            {
                i = Category.GetCategory(id);
            }

            string returnUrl = string.Empty;
            if (HttpContext.Current != null)
            {
                returnUrl = "returnUrl=" + HttpUtility.UrlEncode(HttpContext.Current.Request.RawUrl);
            }

            return Globals.NavigateURL(
                tabId,
                string.Empty,
                "ctl=" + Utility.AdminContainer,
                "mid=" + moduleId.ToString(CultureInfo.InvariantCulture),
                "adminType=" + type.Name + "Edit",
                "versionId=" + i.ItemVersionId.ToString(CultureInfo.InvariantCulture),
                returnUrl);
        }
开发者ID:krishna23456,项目名称:Engage-Publish,代码行数:32,代码来源:UrlGenerator.cs

示例4: OnEmptyBinClick

        /// <summary>
        /// Permanently removes all deleted tabs and modules
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <remarks>
        /// Parent tabs will not be deleted. To delete a parent tab all child tabs need to be deleted before.
        /// </remarks>
        /// <history>
        /// 	[VMasanas]	18/08/2004	Created
        /// </history>
        protected void OnEmptyBinClick(Object sender, EventArgs e)
        {
            var objEventLog = new EventLogController();

            foreach (ListItem item in lstModules.Items)
            {
                var objModules = new ModuleController();
                var values = item.Value.Split('-');
                var tabId = int.Parse(values[0]);
                var moduleId = int.Parse(values[1]);

                //delete module
                var objModule = objModules.GetModule(moduleId, tabId, false);
                if (objModule != null)
                {
                    //hard-delete Tab Module Instance
                    objModules.DeleteTabModule(tabId, moduleId, false);
                    objEventLog.AddLog(objModule, PortalSettings, UserId, "", EventLogController.EventLogType.MODULE_DELETED);
                }
            }
            foreach (ListItem item in lstTabs.Items)
            {
                var intTabId = int.Parse(item.Value);
                var objTabs = new TabController();
                var objTab = objTabs.GetTab(intTabId, PortalId, false);
                if (objTab != null)
                {
                    DeleteTab(objTab, true);
                }
            }
            BindData();
        }
开发者ID:rickfox,项目名称:Steves,代码行数:43,代码来源:RecycleBin.ascx.cs

示例5: UpdateModuleSettingForAllLanguages

        /// <summary>
        /// Update a setting for all language-versions of a module
        /// </summary>
        public static void UpdateModuleSettingForAllLanguages(int moduleId, string key, string value)
        {
            var moduleController = new ModuleController();

            // Find this module in other languages and update contentGroupGuid
            var originalModule = moduleController.GetModule(moduleId);
            var languages = LocaleController.Instance.GetLocales(originalModule.PortalID);

            if (!originalModule.IsDefaultLanguage && originalModule.DefaultLanguageModule != null)
                originalModule = originalModule.DefaultLanguageModule;

            foreach (var language in languages)
            {
                // Find module for given Culture
                var moduleByCulture = moduleController.GetModuleByCulture(originalModule.ModuleID, originalModule.TabID, originalModule.PortalID, language.Value);

                // Break if no module found
                if (moduleByCulture == null)
                    continue;

                if (value == null)
                    moduleController.DeleteModuleSetting(moduleByCulture.ModuleID, key);
                else
                    moduleController.UpdateModuleSetting(moduleByCulture.ModuleID, key, value);
            }
        }
开发者ID:2sic,项目名称:2sxc,代码行数:29,代码来源:DnnStuffToRefactor.cs

示例6: Page_Load

        protected void Page_Load( Object sender, EventArgs e )
        {
            try
            {
                if( Request.QueryString["moduleid"] != null )
                {
                    m_moduleId = int.Parse( Request.QueryString["moduleid"] );
                }

                ModuleController objModules = new ModuleController();
                ModuleInfo objModule = objModules.GetModule(ModuleId, TabId, false);
                if( objModule != null )
                {
                    ArrayList arrFiles = Globals.GetFileList( PortalId, "xml", false );
                    foreach( FileItem objFile in arrFiles )
                    {
                        if( objFile.Text.IndexOf( "content." + CleanName( objModule.FriendlyName ) ) != - 1 )
                        {
                            cboFiles.Items.Add( objFile.Text );
                        }
                    }
                }
            }
            catch( Exception exc ) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException( this, exc );
            }
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:28,代码来源:Import.ascx.cs

示例7: btGo_Click

        public void btGo_Click(object sender, EventArgs e)
        {
            //Setup Child Page - Main View/Activity
            TabInfo tab = CreatePage(PortalSettings.ActiveTab, PortalId, TabId, "Group Activity", false);

            //Add Module to Child Page
            int groupViewModuleId = AddModule(tab, PortalId, "Social Groups", "ContentPane");
            int journalModuleId = AddModule(tab, PortalId, "Journal", "ContentPane");
            int consoleId = AddModule(tab, PortalId, "Console", "RightPane");

            var mc = new ModuleController();

            ModuleInfo groupConsoleModule = mc.GetModule(consoleId, tab.TabID);
            TabInfo memberTab = CreatePage(PortalSettings.ActiveTab, PortalId, tab.TabID, "Members", false);
            mc.CopyModule(groupConsoleModule, memberTab, "RightPane", true);

            ModuleInfo groupViewModule = mc.GetModule(groupViewModuleId, tab.TabID);
            mc.CopyModule(groupViewModule, memberTab, "ContentPane", true);
            AddModule(memberTab, PortalId, "DotNetNuke.Modules.MemberDirectory", "ContentPane");


            //List Settings
            var modules = new ModuleController();
            modules.UpdateTabModuleSetting(TabModuleId, Constants.GroupLoadView, GroupMode.List.ToString());
            modules.UpdateTabModuleSetting(TabModuleId, Constants.GroupViewPage, tab.TabID.ToString(CultureInfo.InvariantCulture));

			//Default Social Groups
	        var defaultGroup = RoleController.GetRoleGroupByName(PortalId, Constants.DefaultGroupName);
	        var groupId = -2;
			if (defaultGroup != null)
			{
				groupId = defaultGroup.RoleGroupID;
			}
			else
			{
				var groupInfo = new RoleGroupInfo();
                    groupInfo.PortalID = PortalId;
                    groupInfo.RoleGroupName = Constants.DefaultGroupName;
                    groupInfo.Description = Constants.DefaultGroupName;
				groupId = RoleController.AddRoleGroup(groupInfo);

			}
			modules.UpdateTabModuleSetting(TabModuleId, Constants.DefaultRoleGroupSetting, groupId.ToString());

            Response.Redirect(Request.RawUrl);
        }
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:46,代码来源:Setup.ascx.cs

示例8: buttonImport_Click

        protected void buttonImport_Click (object sender, EventArgs e)
        {
            try {
                var mctrl = new ModuleController ();
                var module = mctrl.GetModule (int.Parse (comboModule.SelectedValue), TabId);
                var mdef = module.ModuleDefinition.DefinitionName.ToLowerInvariant ();

                foreach (ListItem item in listDocuments.Items) {
                    if (item.Selected) {
                        DocumentInfo document = null;

                        if (mdef == "r7.documents") {
                            document = DocumentsDataProvider.Instance.GetDocument (
                                int.Parse (item.Value),
                                module.ModuleID);
                        }
                        else if (mdef == "documents") {
                            document = DocumentsDataProvider.Instance.GetDNNDocument (
                                int.Parse (item.Value),
                                module.ModuleID);

                            // publish documents, imported from the DNN Documents module
                            document.IsPublished = true;
                        }

                        if (document != null) {
                            var ctrlUrl = new UrlController ();

                            // get original document tracking data
                            var url = ctrlUrl.GetUrlTracking (PortalId, document.Url, document.ModuleId);

                            document.ItemId = Null.NullInteger;
                            document.ModuleId = ModuleId;

                            // add new document
                            DocumentsDataProvider.Instance.Add (document);

                            // add new url tracking data
                            ctrlUrl.UpdateUrl (PortalId, document.Url, url.UrlType, 
                                url.LogActivity, url.TrackClicks, ModuleId, url.NewWindow);

                            // NOTE: using url.Clicks, url.LastClick, url.CreatedDate not working
                        }
                    }
                }

                ModuleSynchronizer.Synchronize (ModuleId, TabModuleId);

                // redirect back to the module page
                Response.Redirect (Globals.NavigateURL (), true);
            }
            catch (Exception ex) {
                // module failed to load
                Exceptions.ProcessModuleLoadException (this, ex);
            }
        }
开发者ID:roman-yagodin,项目名称:R7.Documents,代码行数:56,代码来源:ImportDocuments.ascx.cs

示例9: PopulateChannel

 /// <summary>
 /// This method
 /// </summary>
 /// <param name="channelName"></param>
 /// <param name="userName"></param>
 /// <remarks></remarks>
 protected override void PopulateChannel(string channelName, string userName)
 {
     var objModules = new ModuleController();
     ModuleInfo objModule;
     if (Request == null || Settings == null || Settings.ActiveTab == null || ModuleId == Null.NullInteger)
     {
         return;
     }
     Channel["title"] = Settings.PortalName;
     Channel["link"] = Globals.AddHTTP(Globals.GetDomainName(Request));
     if (!String.IsNullOrEmpty(Settings.Description))
     {
         Channel["description"] = Settings.Description;
     }
     else
     {
         Channel["description"] = Settings.PortalName;
     }
     Channel["language"] = Settings.DefaultLanguage;
     Channel["copyright"] = !string.IsNullOrEmpty(Settings.FooterText) ? 
         Settings.FooterText.Replace("[year]", DateTime.Now.Year.ToString()) : string.Empty;
     Channel["webMaster"] = Settings.Email;
     SearchResultsInfoCollection searchResults = null;
     try
     {
         searchResults = SearchDataStoreProvider.Instance().GetSearchItems(Settings.PortalId, TabId, ModuleId);
     }
     catch (Exception ex)
     {
         Exceptions.Exceptions.LogException(ex);
     }
     if (searchResults != null)
     {
         foreach (SearchResultsInfo objResult in searchResults)
         {
             if (TabPermissionController.CanViewPage())
             {
                 if (Settings.ActiveTab.StartDate < DateTime.Now && Settings.ActiveTab.EndDate > DateTime.Now)
                 {
                     objModule = objModules.GetModule(objResult.ModuleId, objResult.TabId);
                     if (objModule != null && objModule.DisplaySyndicate && objModule.IsDeleted == false)
                     {
                         if (ModulePermissionController.CanViewModule(objModule))
                         {
                             if (Convert.ToDateTime(objModule.StartDate == Null.NullDate ? DateTime.MinValue : objModule.StartDate) < DateTime.Now &&
                                 Convert.ToDateTime(objModule.EndDate == Null.NullDate ? DateTime.MaxValue : objModule.EndDate) > DateTime.Now)
                             {
                                 Channel.Items.Add(GetRssItem(objResult));
                             }
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:biganth,项目名称:Curt,代码行数:62,代码来源:RssHandler.cs

示例10: Page_Load

        /// <Summary>Page_Load runs when the control is loaded.</Summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            string FriendlyName = "";

            ModuleController objModules = new ModuleController();
            ModuleInfo objModule = objModules.GetModule( ModuleId, TabId, false );
            if( objModule != null )
            {
                FriendlyName = objModule.FriendlyName;
            }

            int ModuleControlId = Null.NullInteger;

            if( !( Request.QueryString["ctlid"] == null ) )
            {
                ModuleControlId = int.Parse( Request.QueryString["ctlid"] );
            }

            ModuleControlController objModuleControls = new ModuleControlController();
            ModuleControlInfo objModuleControl = objModuleControls.GetModuleControl( ModuleControlId );
            if( objModuleControl != null )
            {
                string FileName = Path.GetFileName( objModuleControl.ControlSrc );
                string localResourceFile = objModuleControl.ControlSrc.Replace( FileName, Localization.LocalResourceDirectory + "/" + FileName );
                if( Localization.GetString( ModuleActionType.HelpText, localResourceFile ) != "" )
                {
                    lblHelp.Text = Localization.GetString( ModuleActionType.HelpText, localResourceFile );
                }
                _key = objModuleControl.ControlKey;

                string helpUrl = Globals.GetOnLineHelp( objModuleControl.HelpURL, ModuleConfiguration );
                if( !Null.IsNull( helpUrl ) )
                {
                    cmdHelp.NavigateUrl = Globals.FormatHelpUrl( helpUrl, PortalSettings, FriendlyName );
                    cmdHelp.Visible = true;
                }
                else
                {
                    cmdHelp.Visible = false;
                }
            }

            if( Page.IsPostBack == false )
            {
                if( Request.UrlReferrer != null )
                {
                    ViewState["UrlReferrer"] = Convert.ToString( Request.UrlReferrer );
                }
                else
                {
                    ViewState["UrlReferrer"] = "";
                }
            }
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:55,代码来源:Help.ascx.cs

示例11: UpdateModuleTitle

        protected void UpdateModuleTitle (string title)
        {
            // replace module title
            var mctrl = new ModuleController ();
            var module = mctrl.GetModule (ModuleId);

            if (module.ModuleTitle != title)
            {
                module.ModuleTitle = title;
                mctrl.UpdateModule (module);
            }
        }
开发者ID:hassangas2003,项目名称:R7.University,代码行数:12,代码来源:EmployeeModuleBase.cs

示例12: cmdUpdate_Click

        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                var controller = new ModuleController();
                var module = controller.GetModule(ModuleId);

                module.ModuleTitle = Title.Text;
                module.DesktopModule.Description = txtDescription.Text;

                controller.UpdateModule(module);
                Response.Redirect(Globals.NavigateURL(), true);
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
开发者ID:groupdocs-total,项目名称:dnn-groupdocs-assembly-source,代码行数:18,代码来源:Edit.ascx.cs

示例13: ModuleSecurity

        //public ModuleSecurity(int moduleId, int tabId, Hashtable settings)
        //{
        //    var moduleController = new ModuleController();
        //    var s = settings ?? moduleController.GetModuleSettings(moduleId);
        //    Settings = new Settings(s);
        //    return this.ModuleSecurity(moduleId, tabId, Settings);
        //}

        public ModuleSecurity(int moduleId, int tabId, Components.Settings settings)
        {
            var moduleController = new ModuleController();
            Settings = settings ?? new Settings(moduleController.GetModuleSettings(moduleId));
            var moduleInfo = moduleController.GetModule(moduleId, tabId);
            if (moduleInfo == null) return;
            var mp = moduleInfo.ModulePermissions;
            _hasEditRowPermission = ModulePermissionController.HasModulePermission(mp, PermissionName.HasEditRowPermission);
            _hasDeleteRowPermission = ModulePermissionController.HasModulePermission(mp, PermissionName.HasDeleteRowPermission);
            _hasAddRowPermission = ModulePermissionController.HasModulePermission(mp,PermissionName.HasAddRowPermission);
            _hasEditPrivateColumnsPermission = ModulePermissionController.HasModulePermission(mp,PermissionName.EditRestricedFieldsPermission);
            _hasShowAllUserDefinedColumnsPermission = ModulePermissionController.HasModulePermission(mp,PermissionName.ShowAllUserDefinedColumnsPermission);
            _canEditModuleContent = ModulePermissionController.CanEditModuleContent(moduleInfo);
            _canManageModule = ModulePermissionController.CanManageModule(moduleInfo);

            _hasViewListPermission = ModulePermissionController.HasModulePermission(mp,
                                                                                    PermissionName.ShowListPermission);
            _isOnlyAllowedToManipulateHisOwnData = Settings.EditOnlyOwnItems;
        }
开发者ID:DNNCommunity,项目名称:DNN.FormAndList,代码行数:27,代码来源:ModuleSecurity.cs

示例14: cboFolders_SelectedIndexChanged

        void cboFolders_SelectedIndexChanged(object sender, EventArgs e)
        {
            cboFiles.Items.Clear();
            if (cboFolders.SelectedIndex != 0)
            {
                var objModules = new ModuleController();
                var objModule = objModules.GetModule(_moduleId, TabId, false);

                if (objModule != null)
                {
                    var arrFiles = Globals.GetFileList(PortalId, "csv", false, cboFolders.SelectedItem.Value);


                    foreach (FileItem objFile in arrFiles)
                    {
                        cboFiles.Items.Add(new ListItem(objFile.Text, objFile.Text));
                    }
                }
            }
        }
开发者ID:DNNCommunity,项目名称:DNN.FormAndList,代码行数:20,代码来源:ImportCSV.ascx.cs

示例15: Page_Load

        protected void Page_Load( Object sender, EventArgs e )
        {
            try
            {
                if( Request.QueryString["moduleid"] != null )
                {
                    moduleId = int.Parse( Request.QueryString["moduleid"] );
                }

                ModuleController objModules = new ModuleController();
                ModuleInfo objModule = objModules.GetModule( ModuleId, TabId, false );
                if( objModule != null )
                {
                    lblFile.Text = "content." + CleanName( objModule.FriendlyName ) + "." + CleanName( objModule.ModuleTitle ) + ".xml";
                }
            }
            catch( Exception exc ) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException( this, exc );
            }
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:21,代码来源:Export.ascx.cs


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