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


C# TabController.GetCultureTabList方法代码示例

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


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

示例1: updateButton_Click

        protected void updateButton_Click(object sender, EventArgs e)
        {
            var tabCtrl = new TabController();
            var portalCtrl = new PortalController();
            int languageCount = LocaleController.Instance.GetLocales(PortalSettings.PortalId).Count;
            List<TabInfo> pageList = tabCtrl.GetDefaultCultureTabList(PortalId);

            int scriptTimeOut = Server.ScriptTimeout;
            Server.ScriptTimeout = timeout;

            int languageCounter = 0;
            if (chkAllPagesTranslatable.Checked)
            {
            ProcessLanguage(pageList, LocaleController.Instance.GetLocale(PortalDefault), languageCounter, languageCount);
            }
            PublishLanguage(PortalDefault, true);

            PortalController.UpdatePortalSetting(PortalId, "ContentLocalizationEnabled", "True");

            // populate other languages
            foreach (Locale locale in LocaleController.Instance.GetLocales(PortalSettings.PortalId).Values)
            {
                if (!IsDefaultLanguage(locale.Code))
                {
                    languageCounter += 1;
                    pageList = tabCtrl.GetCultureTabList(PortalId);

                    //add translator role
                    Localization.AddTranslatorRole(PortalId, locale);

                    //populate pages
                    ProcessLanguage(pageList, locale, languageCounter, languageCount);

                    //Map special pages
                    portalCtrl.MapLocalizedSpecialPages(PortalSettings.PortalId, locale.Code);
                }
            }
            //Restore Script Timeout
            Server.ScriptTimeout = scriptTimeOut;
            //clear portal cache
            DataCache.ClearPortalCache(PortalId,true);
            //'Redirect to refresh page (and skinobjects)
            Response.Redirect(Globals.NavigateURL(), true);
        }
开发者ID:chutinhha,项目名称:onlineexampro,代码行数:44,代码来源:EnableLocalizedContent.ascx.cs

示例2: cmdUpdate_Click

        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                if (UserInfo.IsSuperUser)
                {
                    //Update Language
                    if (Language == null)
                    {
                        _Language = LocaleController.Instance.GetLocale(languageComboBox.SelectedValue);
                        if (_Language == null)
                        {
                            _Language = new Locale();
                            Language.Code = languageComboBox.SelectedValue;
                        }
                    }
                    Language.Fallback = fallBackComboBox.SelectedValue;
                    Language.Text = CultureInfo.CreateSpecificCulture(Language.Code).NativeName;
                    Localization.SaveLanguage(Language);
                }

                if (!IsLanguageEnabled(Language.Code))
                {
                    //Add language to portal
                    Localization.AddLanguageToPortal(PortalId, Language.LanguageId, true);
                }

                string roles = Null.NullString;
                if (IsAddMode)
                {
                    roles = string.Format("Administrators;{0}", string.Format("Translator ({0})", Language.Code));
                }
                else
                {
                    foreach (string role in translatorRoles.SelectedRoleNames)
                    {
                        roles += role + ";";
                    }

                    roles = roles.TrimEnd(';');
                }

                PortalController.UpdatePortalSetting(PortalId, string.Format("DefaultTranslatorRoles-{0}", Language.Code), roles);

                var tabCtrl = new TabController();
                TabCollection tabs = tabCtrl.GetTabsByPortal(PortalId).WithCulture(Language.Code, false);
                if (PortalSettings.ContentLocalizationEnabled && tabs.Count == 0)
                {
                    //Create Localized Pages
                    foreach (TabInfo t in tabCtrl.GetCultureTabList(PortalId))
                    {
                        tabCtrl.CreateLocalizedCopy(t, Language);
                    }

                    var portalCtl = new PortalController();
                    portalCtl.MapLocalizedSpecialPages(PortalId, Language.Code);
                }

                Response.Redirect(Globals.NavigateURL(), true);
                //Module failed to load
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
开发者ID:nguyenppt,项目名称:1pubcreditnew,代码行数:66,代码来源:EditLanguage.ascx.cs

示例3: updateButton_Click

        protected void updateButton_Click(object sender, EventArgs e)
        {
            var tabCtrl = new TabController();
            var portalCtrl = new PortalController();
            var locale = LocaleController.Instance.GetLocale(Locale);
            List<TabInfo> pageList = tabCtrl.GetCultureTabList(PortalId);

            int scriptTimeOut = Server.ScriptTimeout;
            Server.ScriptTimeout = timeout;

            //add translator role
            Localization.AddTranslatorRole(PortalId, locale);

            //populate pages
            ProcessLanguage(pageList, locale, 0, 1);

            //Map special pages
            portalCtrl.MapLocalizedSpecialPages(PortalSettings.PortalId, locale.Code);

            //Restore Script Timeout
            Server.ScriptTimeout = scriptTimeOut;
            //'Redirect to refresh page (and skinobjects)
            Response.Redirect(Globals.NavigateURL(), true);
        }
开发者ID:nguyenppt,项目名称:1pubcreditnew,代码行数:24,代码来源:LocalizePages.ascx.cs


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