• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Modules.ModuleController类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ModuleController类属于DotNetNuke.Entities.Modules命名空间,在下文中一共展示了ModuleController类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

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


示例2: Login_Input

 protected int Login_Input()
 {
     UserLoginStatus loginStatus = new UserLoginStatus();
     UserInfo objUserInfo = UserController.ValidateUser(PortalId, tbUsername.Text, tbPassword.Text, "", PortalSettings.PortalName, Request.UserHostAddress, ref loginStatus);
     if (loginStatus == UserLoginStatus.LOGIN_SUCCESS || loginStatus == UserLoginStatus.LOGIN_SUPERUSER)
     {
         UserController.UserLogin(PortalId, objUserInfo, PortalSettings.PortalName, Request.UserHostAddress, false);
         if (cbRemember.Checked)
         {
             // Set settings
             int random = new Random().Next();
             ModuleController obModule = new ModuleController();
             obModule.UpdateModuleSetting(ModuleId, tbUsername.Text, random.ToString());
             // Set cookie
             HttpCookie obCookie = new HttpCookie(cookie_name());
             obCookie.Value = string.Format("{0}_{1}", random, tbUsername.Text);
             obCookie.Expires = DateTime.Today.AddMonths(3);
             Response.Cookies.Add(obCookie);
             obCookie = new HttpCookie("EOFFICE");
             obCookie.Value = Request.ApplicationPath;
             obCookie.Expires = DateTime.Today.AddYears(1);
             obCookie.HttpOnly = false;
             Response.Cookies.Add(obCookie);
         }
         return 1;
     }
     else
     {
         lbError.Text = "Tên đăng nhập hoặc Mật khẩu không chính xác";
         return 0;
     }
 }
开发者ID:chungnt88,项目名称:DesktopModules,代码行数:32,代码来源:Login.ascx.cs


示例3: GetModuleShareable

        public HttpResponseMessage GetModuleShareable(int moduleId, int tabId, int portalId = -1)
        {
            var requiresWarning = false;
            if (portalId == -1)
            {
                var portalDict = PortalController.GetPortalDictionary();
                portalId = portalDict[tabId];
            }

            DesktopModuleInfo desktopModule;
            if (tabId < 0)
            {
                desktopModule = DesktopModuleController.GetDesktopModule(moduleId, portalId);
            }
            else
            {
                var moduleInfo = new ModuleController().GetModule(moduleId, tabId);

                desktopModule = moduleInfo.DesktopModule;

                requiresWarning = moduleInfo.PortalID != PortalSettings.PortalId && desktopModule.Shareable == ModuleSharing.Unknown;
            }

            if (desktopModule == null)
            {
                var message = string.Format("Cannot find module ID {0} (tab ID {1}, portal ID {2})", moduleId, tabId, portalId);
                Logger.Error(message);
                return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, message);
            }

            return Request.CreateResponse(HttpStatusCode.OK, new {Shareable = desktopModule.Shareable.ToString(), RequiresWarning = requiresWarning});
        }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:32,代码来源:ModuleServiceController.cs


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


示例5: SearchExecute

        private void SearchExecute()
        {
            int ResultsTabid;

            if( Settings["SearchResultsModule"] != null )
            {
                ResultsTabid = int.Parse( Convert.ToString( Settings["SearchResultsModule"] ) );
            }
            else
            {
                //Get Default Page
                ModuleController objModules = new ModuleController();
                ModuleInfo SearchModule = objModules.GetModuleByDefinition( PortalSettings.PortalId, "Search Results" );
                if( SearchModule == null )
                {
                    UI.Skins.Skin.AddModuleMessage( this, Localization.GetString( "NoSearchModule", LocalResourceFile ), ModuleMessageType.YellowWarning );
                    return;
                }
                else
                {
                    ResultsTabid = SearchModule.TabID;
                }
            }
            if( HostSettings.GetHostSetting( "UseFriendlyUrls" ) == "Y" )
            {
                Response.Redirect( Globals.NavigateURL( ResultsTabid ) + "?Search=" + Server.UrlEncode( txtSearch.Text ) );
            }
            else
            {
                Response.Redirect( Globals.NavigateURL( ResultsTabid ) + "&Search=" + Server.UrlEncode( txtSearch.Text ) );
            }
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:32,代码来源:SearchInput.ascx.cs


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


示例7: LoadSettings

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

                    if (TabModuleSettings.Contains(SettingNames.JumbotronTitle))
                        txtJumbotronTitle.Text = TabModuleSettings[SettingNames.JumbotronTitle].ToString();

                    if (TabModuleSettings.Contains(SettingNames.SubmitPhoneButton))
                        txtCallToActionPhone.Text = TabModuleSettings[SettingNames.SubmitPhoneButton].ToString();

                    txtSelectedCountries.Text = (TabModuleSettings[SettingNames.SelectedCountries] ?? SettingNames.DefaultCountries).ToString();

                    txtServiceOnSubmit.Text = (TabModuleSettings[SettingNames.ServiceOnSubmit] ?? string.Empty).ToString();

                    htmlEditor.Text = module.ReadLargeTabModuleSetting(TabModuleSettings, TabModuleId, SettingNames.JumbotronContent);
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
开发者ID:jpvillaseca,项目名称:DNN-Modules-3G,代码行数:31,代码来源:Settings.ascx.cs


示例8: SaveSettings

        protected void SaveSettings()
        {
            ModuleController mc = new ModuleController();
            if (txtAnalyticsTrackingId.Text.Length > 0)
            {
                if (ModuleSettings.ContainsKey("GoogleTrackingId"))
                    ModuleSettings["GoogleTrackingId"] = txtAnalyticsTrackingId.Text;
                else
                    ModuleSettings.Add("GoogleTrackingId", txtAnalyticsTrackingId.Text);
                mc.UpdateModuleSetting(this.ModuleId, "GoogleTrackingId", txtAnalyticsTrackingId.Text);
            }

            if (ModuleSettings.ContainsKey("LocalHostAddress"))
                ModuleSettings["LocalHostAddress"] = txtLocalHostName.Text;
            else
                ModuleSettings.Add("LocalHostAddress", txtLocalHostName.Text );
            mc.UpdateModuleSetting(this.ModuleId, "LocalHostAddress", txtLocalHostName.Text );

            if (ddlSecurityGroups.SelectedValue != "-1")
            {
                if (ModuleSettings.ContainsKey("HideTrackingFromRole"))
                    ModuleSettings["HideTrackingFromRole"] = ddlSecurityGroups.SelectedItem.Text;
                else
                    ModuleSettings.Add("HideTrackingFromRole", ddlSecurityGroups.SelectedItem.Text);
                mc.UpdateModuleSetting(this.ModuleId, "HideTrackingFromRole", ddlSecurityGroups.SelectedItem.Text);
            }
            else
            {
                if (ModuleSettings.ContainsKey("HideTrackingFromRole"))
                    mc.DeleteModuleSetting(this.ModuleId, "HideTrackingFromRole");
            }
        }
开发者ID:goedings,项目名称:VendorLink,代码行数:32,代码来源:ScripterSettings.ascx.cs


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


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


示例11: Save

        public bool Save(ModuleController moduleController, int moduleId)
        {
            try
            {
                if (moduleController == null || moduleId < 0)
                    return false;

                moduleController.UpdateModuleSetting(moduleId, ForumsSettingsKey, Forums);
                moduleController.UpdateModuleSetting(moduleId, RowsSettingsKey, Rows.ToString());
                moduleController.UpdateModuleSetting(moduleId, FormatSettingsKey, Format);
                moduleController.UpdateModuleSetting(moduleId, HeaderSettingsKey, Header);
                moduleController.UpdateModuleSetting(moduleId, FooterSettingsKey, Footer);
                moduleController.UpdateModuleSetting(moduleId, RSSEnabledSettingsKey, RSSEnabled.ToString());
                moduleController.UpdateModuleSetting(moduleId, TopicsOnlySettingsKey, TopicsOnly.ToString());
                moduleController.UpdateModuleSetting(moduleId, RandomOrderSettingsKey, RandomOrder.ToString());
                moduleController.UpdateModuleSetting(moduleId, TagsSettingsKey, Tags);
                moduleController.UpdateModuleSetting(moduleId, RSSIgnoreSecuritySettingsKey, RSSIgnoreSecurity.ToString());
                moduleController.UpdateModuleSetting(moduleId, RSSIncludeBodySettingsKey, RSSIncludeBody.ToString());
                moduleController.UpdateModuleSetting(moduleId, RSSCacheTimeoutSettingsKey, RSSCacheTimeout.ToString());

                // Clear the cache
                DataCache.CacheClear("aftp_" + moduleId);

                return true;
            }
            catch (Exception)
            {
                return false;
            }
        }
开发者ID:allanedk,项目名称:ActiveForums,代码行数:30,代码来源:WhatsNewModuleSettings.cs


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


示例13: ImportModule

        /// <summary>
        ///   IPortable:Import
        /// </summary>
        public void ImportModule(int moduleId, string content, string version, int userId)
        {
            XmlNode node;
            var nodes = Globals.GetContent(content, Portable.ModuleElement);
            var objModules = new ModuleController();
            var nameOfXmlDataProvider = string.Empty;
            var nameOfXmlRenderingProvider = string.Empty;
            foreach (XmlNode nodeLoopVariable in nodes.SelectSingleNode(Portable.SettingsElement).ChildNodes)
            {
                node = nodeLoopVariable;
                var settingName = node.Attributes[Portable.NameAttribute].Value;
                var settingValue = node.Attributes[Portable.ValueAttribute].Value;
                objModules.UpdateModuleSetting(moduleId, settingName, settingValue);
                if (settingName == Setting.SourceProvider)
                    nameOfXmlDataProvider = settingValue;
                if (settingName == Setting.RenderingProvider)
                    nameOfXmlRenderingProvider = settingValue;
            }

            XmlDataProvider.Instance(nameOfXmlDataProvider).ImportProviderSettings(moduleId, nodes.SelectSingleNode("XmlDataProvider"));
            XmlRenderingProvider.Instance(nameOfXmlRenderingProvider).ImportProviderSettings(moduleId, nodes.SelectSingleNode("XmlRenderingProvider"));

            //LEGACY SUPPORT
            XmlDataProvider.Instance("HttpRequestProvider").ImportProviderSettings(moduleId, nodes.SelectSingleNode("URL"));
            XmlRenderingProvider.Instance("XslCompiledTransformProvider").ImportProviderSettings(moduleId, nodes.SelectSingleNode("XSL"));

        }
开发者ID:DNNCommunity,项目名称:DNN.XML,代码行数:30,代码来源:FeatureController.cs


示例14: ExportModule

        /// <summary>
        ///   IPortable: Export
        /// </summary>
        public string ExportModule(int moduleId)
        {
            var settings = new ModuleController().GetModuleSettings(moduleId);
            //start export
            var strXml = new StringWriter();
            XmlWriter writer = new XmlTextWriter(strXml);
            writer.WriteStartElement(Portable.ModuleElement);
            writer.WriteStartElement(Portable.SettingsElement);

            foreach (DictionaryEntry item in settings)
            {
                writer.WriteStartElement(Portable.SettingElement);
                writer.WriteAttributeString(Portable.NameAttribute, Convert.ToString(item.Key));
                writer.WriteAttributeString(Portable.ValueAttribute, Convert.ToString(item.Value));
                writer.WriteEndElement();
            }
            writer.WriteEndElement();
            writer.WriteStartElement("XmlDataProvider");
            var nameOfSourceProvider = settings[Setting.SourceProvider].ToString();
            writer.WriteAttributeString(Portable.NameAttribute, nameOfSourceProvider);
            XmlDataProvider.Instance(nameOfSourceProvider).ExportProviderSettings(moduleId, writer);
            writer.WriteEndElement();
            writer.WriteStartElement("XmlRenderingProvider");
            var nameOfRenderingProvider = settings[Setting.RenderingProvider].ToString();
            writer.WriteAttributeString(Portable.NameAttribute, nameOfRenderingProvider);
            XmlRenderingProvider.Instance(nameOfRenderingProvider).ExportProviderSettings(moduleId, writer);
            writer.WriteEndElement();
            writer.WriteEndElement();
            writer.Close();

            return strXml.ToString();
        }
开发者ID:DNNCommunity,项目名称:DNN.XML,代码行数:35,代码来源:FeatureController.cs


示例15: UpdateSettings

        /// <summary>UpdateSettings saves the modified settings to the Database</summary>
        public override void UpdateSettings()
        {
            try
            {
                if (!this.Page.IsValid)
                {
                    return;
                }

                var modules = new ModuleController();
                modules.UpdateModuleSetting(this.ModuleId, "SiteUrl", this.SiteUrlTextBox.Text);
                modules.UpdateModuleSetting(this.ModuleId, "ShowMessage", this.ShowMessageCheckBox.Checked.ToString(CultureInfo.InvariantCulture));
                modules.UpdateModuleSetting(this.ModuleId, "ShowModal", this.ShowModalCheckBox.Checked.ToString(CultureInfo.InvariantCulture));
                modules.UpdateModuleSetting(this.ModuleId, "CarbonCopy", this.CarbonCopyTextBox.Text);
                modules.UpdateModuleSetting(this.ModuleId, "BlindCarbonCopy", this.BlindCarbonCopyTextBox.Text);
                modules.UpdateModuleSetting(this.ModuleId, "From", this.FromTextBox.Text);
                modules.UpdateModuleSetting(this.ModuleId, "Subject", this.SubjectTextBox.Text);
                modules.UpdateModuleSetting(this.ModuleId, "Body", this.BodyTextBox.Text);
                modules.UpdateModuleSetting(this.ModuleId, "InvisibleCaptcha", this.InvisibleCaptchaCheckBox.Checked.ToString(CultureInfo.InvariantCulture));
                modules.UpdateModuleSetting(this.ModuleId, "TimedCaptcha", this.TimedCaptchaCheckBox.Checked.ToString(CultureInfo.InvariantCulture));
                modules.UpdateModuleSetting(this.ModuleId, "StandardCaptcha", this.StandardCaptchaCheckBox.Checked.ToString(CultureInfo.InvariantCulture));
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
开发者ID:EngageSoftware,项目名称:Engage-Tell-a-Friend,代码行数:28,代码来源:Settings.ascx.cs


示例16: Load

        public void Load(int moduleId)
        {
            ModuleController modCtrl = new ModuleController();
            Hashtable modSettings = modCtrl.GetModuleSettings(moduleId);

            ModuleId = moduleId;

            if (modSettings.ContainsKey("template")) {
                Template = modSettings["template"].ToString();
            }

            if (Template.IndexOf("/") == -1) {
                Template = "LightBox/" + Template;
            }

            TemplateType = Template.Substring(0, Template.IndexOf("/"));

            if (modSettings.ContainsKey("thumb_width")) {
                try {
                    ThumbWidth = Convert.ToInt32(modSettings["thumb_width"]);
                } catch {
                    ThumbWidth = 0;
                }
            }

            if (modSettings.ContainsKey("thumb_height")) {
                try {
                    ThumbHeight = Convert.ToInt32(modSettings["thumb_height"]);
                } catch {
                    ThumbHeight = 0;
                }
            }
        }
开发者ID:schotman,项目名称:DnnSharp.FastShot,代码行数:33,代码来源:Settings.cs


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


示例18: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if(!Page.IsPostBack)
            {
                try
                {
                    var moduleController = new ModuleController();

                    lblJumbotronTitle.Text = (TabModuleSettings[SettingNames.JumbotronTitle] ?? LocalizeString("JumbotronDefaultTitle")).ToString();

                    litJumbotronContent.Text = moduleController.ReadLargeTabModuleSetting(TabModuleSettings, TabModuleId, SettingNames.JumbotronContent) ?? string.Empty;

                    btnSubmitPhone.Text = (TabModuleSettings[SettingNames.SubmitPhoneButton] ?? LocalizeString("SubmitForm")).ToString();

                    SelectedCountries = (TabModuleSettings[SettingNames.SelectedCountries] ?? SettingNames.DefaultCountries).ToString();

                    //Set cookies if viral metadata is specified
                    if (!string.IsNullOrWhiteSpace(GetQueryStringParameter("referal")))
                        base.Referal = GetQueryStringParameter("referal");

                    if (!string.IsNullOrWhiteSpace(GetQueryStringParameter("viral")))
                        base.ViralToken = GetQueryStringParameter("viral");
                }
                catch (Exception exc) //Module failed to load
                {
                    Exceptions.ProcessModuleLoadException(this, exc);
                }
            }
        }
开发者ID:jpvillaseca,项目名称:DNN-Modules-3G,代码行数:29,代码来源:View.ascx.cs


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


示例20: UpdateSettings

        public override void UpdateSettings()
        {
            try
            {
                ModuleController controller = new ModuleController();
                controller.UpdateTabModuleSetting(TabModuleId, "TokenProvider", ddlTokens.SelectedValue);
                foreach (TokenConfigurator conf in phConfigurator.Controls)
                {
                    var sets = conf.SaveSettings();
                    foreach (DictionaryEntry set in sets)
                    {
                        controller.UpdateTabModuleSetting(TabModuleId, (string)set.Key, (string)set.Value);
                    }
                    if (conf.Visible)
                    {
                        controller.UpdateTabModuleSetting(TabModuleId, "Token", conf.getToken());

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Modules.ModuleInfo类代码示例发布时间:2022-05-24
下一篇:
C# Taxonomy.TermController类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap