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


C# TabController.GiveTranslatorRoleEditRights方法代码示例

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


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

示例1: submitTranslation_Click

        protected void submitTranslation_Click(object sender, EventArgs e)
        {
            var modCtrl = new ModuleController();
            var tabCtrl = new TabController();

            foreach (TabInfo localizedTab in Tab.LocalizedTabs.Values)
            {
                //Make Deep copies of all modules
                var moduleCtrl = new ModuleController();
                foreach (KeyValuePair<int, ModuleInfo> kvp in moduleCtrl.GetTabModules(Tab.TabID))
                {
                    ModuleInfo sourceModule = kvp.Value;
                    ModuleInfo localizedModule = null;

                    //Make sure module has the correct culture code
                    if (string.IsNullOrEmpty(sourceModule.CultureCode))
                    {
                        sourceModule.CultureCode = Tab.CultureCode;
                        moduleCtrl.UpdateModule(sourceModule);
                    }

                    if (!sourceModule.LocalizedModules.TryGetValue(localizedTab.CultureCode, out localizedModule))
                    {
                        if (!sourceModule.IsDeleted)
                        {
                            //Shallow (Reference Copy)

                            {
                                if (sourceModule.AllTabs)
                                {
                                    foreach (ModuleInfo m in moduleCtrl.GetModuleTabs(sourceModule.ModuleID))
                                    {
                                        //Get the tab
                                        TabInfo allTabsTab = tabCtrl.GetTab(m.TabID, m.PortalID, false);
                                        TabInfo localizedAllTabsTab = null;
                                        if (allTabsTab.LocalizedTabs.TryGetValue(localizedTab.CultureCode, out localizedAllTabsTab))
                                        {
                                            moduleCtrl.CopyModule(m, localizedAllTabsTab, Null.NullString, true);
                                        }
                                    }
                                }
                                else
                                {
                                    moduleCtrl.CopyModule(sourceModule, localizedTab, Null.NullString, true);
                                }
                            }

                            //Fetch new module
                            localizedModule = moduleCtrl.GetModule(sourceModule.ModuleID, localizedTab.TabID);

                            //Convert to deep copy
                            moduleCtrl.LocalizeModule(localizedModule, LocaleController.Instance.GetLocale(localizedTab.CultureCode));
                        }
                    }
                }

                var users = new Dictionary<int, UserInfo>();

                //Give default translators for this language and administrators permissions
                tabCtrl.GiveTranslatorRoleEditRights(localizedTab, users);

                //Send Messages to all the translators of new content
                foreach (var translator in users.Values.Where(user => user.UserID != PortalSettings.AdministratorId))
                {
                    AddTranslationSubmittedNotification(localizedTab, translator);
                }
            }

            //Redirect to refresh page (and skinobjects)
            Response.Redirect(Request.RawUrl, true);
        }
开发者ID:smkkstudios,项目名称:BlackandWhiteReporting,代码行数:71,代码来源:ManageTabs.ascx.cs

示例2: submitTranslation_Click

        protected void submitTranslation_Click(object sender, EventArgs e)
        {
            sendTranslationMessageConfirm.Visible = true;
            try
            {

                var tabCtrl = new TabController();

                // loop through all localized version of this page
                foreach (TabInfo localizedTab in Tab.LocalizedTabs.Values)
                {
                    var users = new Dictionary<int, UserInfo>();

                    //Give default translators for this language and administrators permissions
                    tabCtrl.GiveTranslatorRoleEditRights(localizedTab, users);

                    //Send Messages to all the translators of new content
                    foreach (var translator in users.Values.Where(user => user.UserID != PortalSettings.AdministratorId))
                    {
                        AddTranslationSubmittedNotification(localizedTab, translator);
                    }
                }
                txtTranslationComment.Text = "";
                sendTranslationMessageRow.Visible = false;
                sendTranslationMessageConfirm.Attributes.Remove("class");
                sendTranslationMessageConfirm.Attributes.Add("class", "dnnFormMessage dnnFormSuccess");

                sendTranslationMessageConfirmMessage.Text = LocalizeString("TranslationMessageConfirmMessage.Text");
            }
            catch (Exception)
            {
                sendTranslationMessageConfirm.Attributes.Remove("class");
                sendTranslationMessageConfirm.Attributes.Add("class", "dnnFormMessage dnnFormError");
                sendTranslationMessageConfirmMessage.Text = LocalizeString("TranslationMessageConfirmMessage.Error");
                throw;
            }
        }
开发者ID:RichardHowells,项目名称:dnnextensions,代码行数:37,代码来源:ManageTabs.ascx.cs

示例3: readyForTranslationButton_Click

        protected void readyForTranslationButton_Click(object sender, EventArgs e)
        {
            var modCtrl = new ModuleController();
            var tabCtrl = new TabController();

            foreach (TabInfo localizedTab in Tab.LocalizedTabs.Values)
            {
                //Make Deep copies of all modules
                var moduleCtrl = new ModuleController();
                foreach (KeyValuePair<int, ModuleInfo> kvp in moduleCtrl.GetTabModules(Tab.TabID))
                {
                    ModuleInfo sourceModule = kvp.Value;
                    ModuleInfo localizedModule = null;

                    //Make sure module has the correct culture code
                    if (string.IsNullOrEmpty(sourceModule.CultureCode))
                    {
                        sourceModule.CultureCode = Tab.CultureCode;
                        moduleCtrl.UpdateModule(sourceModule);
                    }

                    if (!sourceModule.LocalizedModules.TryGetValue(localizedTab.CultureCode, out localizedModule))
                    {
                        if (!sourceModule.IsDeleted)
                        {
                            //Shallow (Reference Copy)

                            {
                                if (sourceModule.AllTabs)
                                {
                                    foreach (ModuleInfo m in moduleCtrl.GetModuleTabs(sourceModule.ModuleID))
                                    {
                                        //Get the tab
                                        TabInfo allTabsTab = tabCtrl.GetTab(m.TabID, m.PortalID, false);
                                        TabInfo localizedAllTabsTab = null;
                                        if (allTabsTab.LocalizedTabs.TryGetValue(localizedTab.CultureCode, out localizedAllTabsTab))
                                        {
                                            moduleCtrl.CopyModule(m, localizedAllTabsTab, Null.NullString, true);
                                        }
                                    }
                                }
                                else
                                {
                                    moduleCtrl.CopyModule(sourceModule, localizedTab, Null.NullString, true);
                                }
                            }

                            //Fetch new module
                            localizedModule = moduleCtrl.GetModule(sourceModule.ModuleID, localizedTab.TabID);

                            //Convert to deep copy
                            moduleCtrl.LocalizeModule(localizedModule, LocaleController.Instance.GetLocale(localizedTab.CultureCode));
                        }
                    }
                }

                var users = new Dictionary<int, UserInfo>();

                //Give default translators for this language and administrators permissions
                tabCtrl.GiveTranslatorRoleEditRights(localizedTab, users);

                //Send Messages to all the translators of new content
                foreach (UserInfo translator in users.Values)
                {
                    if (translator.UserID != PortalSettings.AdministratorId)
                    {
                        var message = new Message();
                        message.FromUserID = PortalSettings.AdministratorId;
                        message.ToUserID = translator.UserID;
                        message.Subject = Localization.GetString("NewContentMessage.Subject", LocalResourceFile);
                        message.Status = MessageStatusType.Unread;
                        message.Body = string.Format(Localization.GetString("NewContentMessage.Body", LocalResourceFile),
                                                     localizedTab.TabName,
                                                     Globals.NavigateURL(localizedTab.TabID, false, PortalSettings, Null.NullString, localizedTab.CultureCode, new string[] { }));

                        var messageCtrl = new MessagingController();
                        messageCtrl.SaveMessage(message);
                    }
                }
            }

            //Redirect to refresh page (and skinobjects)
            Response.Redirect(Request.RawUrl, true);
        }
开发者ID:patonomatic,项目名称:VUWTC,代码行数:84,代码来源:ManageTabs.ascx.cs


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