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


C# TabController.UpdateTabSetting方法代码示例

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


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

示例1: CmdUpdateClick

        protected void CmdUpdateClick(object sender, EventArgs e)
        {
            //Often times grid stays but node is not selected (e.g. when node is deleted or update page is clicked)
            if (ctlPages.SelectedNode == null)
                return;

            var intTab = Convert.ToInt32(ctlPages.SelectedNode.Value);
            var tabcontroller = new TabController();
            var tab = tabcontroller.GetTab(intTab, PortalId, true);
            this.Page.Validate();
            if (!this.Page.IsValid)
                return;
            if (tab != null && TabPermissionController.CanManagePage(tab))
            {
                tab.TabName = txtName.Text;
                tab.Title = txtTitle.Text;
                tab.Description = txtDescription.Text;
                tab.KeyWords = txtKeywords.Text;
                tab.IsVisible = chkVisible.Checked;
                tab.DisableLink = chkDisabled.Checked;

                tab.IsDeleted = false;
                tab.Url = ctlURL.Url;
                tabcontroller.UpdateTabSetting(tab.TabID, "LinkNewWindow", ctlURL.NewWindow.ToString());
                tabcontroller.UpdateTabSetting(tab.TabID, "AllowIndex", chkAllowIndex.Checked.ToString());

                tab.SkinSrc = drpSkin.SelectedValue;
                tab.ContainerSrc = drpContainer.SelectedValue;
                tab.TabPath = Globals.GenerateTabPath(tab.ParentId, tab.TabName);

                tab.TabPermissions.Clear();
                if (tab.PortalID != Null.NullInteger)
                {
                    tab.TabPermissions.AddRange(dgPermissions.Permissions);
                }

                //All validations have been done in the Page.Validate()

                //Check for invalid
                if (!IsValidTabName(tab.TabName))
                {
                    return;
                }

                //Validate Tab Path
                if (!IsValidTabPath(tab, tab.TabPath))
                {
                    return;
                }

                tab.RefreshInterval = txtRefresh.Text == "" ? Null.NullInteger : Convert.ToInt32(txtRefresh.Text);

                tab.SiteMapPriority = float.Parse(txtSitemapPriority.Text);
                tab.PageHeadText = txtMeta.Text;
                tab.IsSecure = chkSecure.Checked;
                tab.PermanentRedirect = chkPermanentRedirect.Checked;

                var iconFile = ctlIcon.Url;
                var iconFileLarge = ctlIconLarge.Url;

                tab.IconFile = iconFile;
                tab.IconFileLarge = iconFileLarge;

                tab.Terms.Clear();
                tab.Terms.AddRange(termsSelector.Terms);

                tabcontroller.UpdateTab(tab);
                ShowSuccessMessage(string.Format(Localization.GetString("TabUpdated", LocalResourceFile), tab.TabName));

                BindTree();

                //keep the tab selected
                SelectedNode = intTab.ToString(CultureInfo.InvariantCulture);
                ctlPages.FindNodeByValue(SelectedNode).Selected = true;
                ctlPages.FindNodeByValue(SelectedNode).ExpandParentNodes();
            }
        }
开发者ID:rcedev,项目名称:evans-software-solutions,代码行数:77,代码来源:Tabs.ascx.cs

示例2: UpdateWorkflow

        /// -----------------------------------------------------------------------------
        /// <summary>
        ///   UpdateWorkFlow updates the currently active Workflow
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="WorkFlowType">The type of workflow (Module | Page | Site)</param>
        /// <param name = "WorkflowID">The ID of the Workflow</param>
        /// <param name="ObjectID">The ID of the object to apply the update to (depends on WorkFlowType)</param>
        /// <param name="ReplaceExistingSettings">Should existing settings be overwritten?</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public void UpdateWorkflow(int ObjectID, string WorkFlowType, int WorkflowID, bool ReplaceExistingSettings)
        {
            var tabController = new TabController();
            var moduleController = new ModuleController();

            switch (WorkFlowType)
            {
                case "Module":
                    moduleController.UpdateModuleSetting(ObjectID, "WorkflowID", WorkflowID.ToString());
                    break;
                case "Page":
                    tabController.UpdateTabSetting(ObjectID, "WorkflowID", WorkflowID.ToString());
                    if (ReplaceExistingSettings)
                    {
                        //Get All Modules on the current Tab
                        foreach (var kvp in moduleController.GetTabModules(ObjectID))
                        {
                            ClearModuleSettings(kvp.Value);
                        }
                    }
                    break;
                case "Site":
                    PortalController.UpdatePortalSetting(ObjectID, "WorkflowID", WorkflowID.ToString());
                    if (ReplaceExistingSettings)
                    {
                        //Get All Tabs aon the Site
                        foreach (var kvp in tabController.GetTabsByPortal(ObjectID))
                        {
                            tabController.DeleteTabSetting(kvp.Value.TabID, "WorkFlowID");
                        }
                        //Get All Modules in the current Site
                        foreach (ModuleInfo objModule in moduleController.GetModules(ObjectID))
                        {
                            ClearModuleSettings(objModule);
                        }
                    }
                    break;
            }
        }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:52,代码来源:HtmlTextController.cs

示例3: UpdateTabSettings

 private void UpdateTabSettings(int tabId)
 {
     var t = new TabController();
     t.UpdateTabSetting(tabId, "CacheProvider", cboCacheProvider.SelectedValue);
     t.UpdateTabSetting(tabId, "CacheDuration", txtCacheDuration.Text);
     t.UpdateTabSetting(tabId, "CacheIncludeExclude", rblCacheIncludeExclude.SelectedValue);
     t.UpdateTabSetting(tabId, "IncludeVaryBy", txtIncludeVaryBy.Text);
     t.UpdateTabSetting(tabId, "ExcludeVaryBy", txtExcludeVaryBy.Text);
     t.UpdateTabSetting(tabId, "MaxVaryByCount", txtMaxVaryByCount.Text);
 }
开发者ID:smkkstudios,项目名称:BlackandWhiteReporting,代码行数:10,代码来源:ManageTabs.ascx.cs

示例4: CopyGettingStartedStyles

		private static void CopyGettingStartedStyles()
		{
			//copy getting started css to portals folder.
			var hostGettingStartedFile = string.Format("{0}GettingStarted.css", Globals.HostMapPath);
			var tabController = new TabController();
			foreach (PortalInfo portal in new PortalController().GetPortals())
			{

				if (File.Exists(hostGettingStartedFile))
				{
					var portalFile = portal.HomeDirectoryMapPath + "GettingStarted.css";
					if (!File.Exists(portalFile))
					{
						File.Copy(hostGettingStartedFile, portalFile);
					}
				}

				//update the getting started page to have this custom style sheet.
				var gettingStartedTabId = PortalController.GetPortalSettingAsInteger("GettingStartedTabId", portal.PortalID, Null.NullInteger);
				if (gettingStartedTabId > Null.NullInteger)
				{
                    // check if tab exists
				    if (tabController.GetTab(gettingStartedTabId, portal.PortalID, true) != null)
				    {
				        tabController.UpdateTabSetting(gettingStartedTabId, "CustomStylesheet", "GettingStarted.css");
				    }
				}
			}
		}
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:29,代码来源:Upgrade.cs

示例5: SaveTabInfoObject


//.........这里部分代码省略.........
                    if ((tab.TabPermissions.Count == 0 && tab.PortalID != Null.NullInteger))
                    {
                        //Give admin full permission
                        ArrayList permissions = PermissionController.GetPermissionsByTab();

                        foreach (PermissionInfo permission in permissions)
                        {
                            TabPermissionInfo newTabPermission = new TabPermissionInfo();
                            newTabPermission.PermissionID = permission.PermissionID;
                            newTabPermission.PermissionKey = permission.PermissionKey;
                            newTabPermission.PermissionName = permission.PermissionName;
                            newTabPermission.AllowAccess = true;
                            newTabPermission.RoleID = PortalSettings.Current.AdministratorRoleId;
                            tab.TabPermissions.Add(newTabPermission);
                        }
                    }

                    PortalSettings _PortalSettings = PortalController.GetCurrentPortalSettings();

                    if (_PortalSettings.ContentLocalizationEnabled)
                    {
                        Locale defaultLocale = LocaleController.Instance.GetDefaultLocale(tab.PortalID);
                        tab.CultureCode = defaultLocale.Code;
                    }
                    else
                    {
                        tab.CultureCode = Null.NullString;
                    }

                    if ((location == TabRelativeLocation.AFTER && (relativeToTab != null)))
                    {
                        tab.TabID = tabCtrl.AddTabAfter(tab, relativeToTab.TabID);
                    }
                    else if ((location == TabRelativeLocation.BEFORE && (relativeToTab != null)))
                    {
                        tab.TabID = tabCtrl.AddTabBefore(tab, relativeToTab.TabID);
                    }
                    else
                    {
                        tab.TabID = tabCtrl.AddTab(tab);
                    }

                    if (_PortalSettings.ContentLocalizationEnabled)
                    {
                        tabCtrl.CreateLocalizedCopies(tab);
                    }

                    tabCtrl.UpdateTabSetting(tab.TabID, "CacheProvider", "");
                    tabCtrl.UpdateTabSetting(tab.TabID, "CacheDuration", "");
                    tabCtrl.UpdateTabSetting(tab.TabID, "CacheIncludeExclude", "0");
                    tabCtrl.UpdateTabSetting(tab.TabID, "IncludeVaryBy", "");
                    tabCtrl.UpdateTabSetting(tab.TabID, "ExcludeVaryBy", "");
                    tabCtrl.UpdateTabSetting(tab.TabID, "MaxVaryByCount", "");
                }
                else
                {
                    tabCtrl.UpdateTab(tab);

                    if ((location == TabRelativeLocation.AFTER && (relativeToTab != null)))
                    {
                        tabCtrl.MoveTabAfter(tab, relativeToTab.TabID);
                    }
                    else if ((location == TabRelativeLocation.BEFORE && (relativeToTab != null)))
                    {
                        tabCtrl.MoveTabBefore(tab, relativeToTab.TabID);
                    }
                }
            }
            catch (Exception ex)
            {
                DnnLog.Error(ex);

                if (ex.Message.StartsWith("Page Exists"))
                {
                    throw new DotNetNukeException(ex.Message, DotNetNukeErrorCode.PageExists);
                }
            }

            // create the page from a template
            if ((!string.IsNullOrEmpty(templateMapPath)))
            {
                XmlDocument xmlDoc = new XmlDocument();
                try
                {
                    xmlDoc.Load(templateMapPath);
                    TabController.DeserializePanes(xmlDoc.SelectSingleNode("//portal/tabs/tab/panes"), tab.PortalID, tab.TabID, PortalTemplateModuleAction.Ignore, new Hashtable());
                    
                    //save tab permissions
                    DeserializeTabPermissions(xmlDoc.SelectNodes("//portal/tabs/tab/tabpermissions/permission"), tab);
                }
                catch (Exception ex)
                {
                    Exceptions.LogException(ex);
                    throw new DotNetNukeException("Unable to process page template.", ex, DotNetNukeErrorCode.DeserializePanesFailed);
                }
            }

            //todo: reload tab from db or send back tabid instead?
            return tab.TabID;
        }
开发者ID:biganth,项目名称:Curt,代码行数:101,代码来源:RibbonBarManager.cs

示例6: UpdateTabSettings

 private void UpdateTabSettings(int tabId)
 {
     var t = new TabController();
     t.UpdateTabSetting(tabId, "CacheProvider", cboCacheProvider.SelectedValue);
     t.UpdateTabSetting(tabId, "CacheDuration", txtCacheDuration.Text);
     t.UpdateTabSetting(tabId, "CacheIncludeExclude", rblCacheIncludeExclude.SelectedValue);
     t.UpdateTabSetting(tabId, "IncludeVaryBy", txtIncludeVaryBy.Text);
     t.UpdateTabSetting(tabId, "ExcludeVaryBy", txtExcludeVaryBy.Text);
     t.UpdateTabSetting(tabId, "MaxVaryByCount", txtMaxVaryByCount.Text);
     t.UpdateTabSetting(tabId, "LinkNewWindow", ctlURL.NewWindow.ToString());
     t.UpdateTabSetting(tabId, "AllowIndex", chkAllowIndex.Checked.ToString());
 }
开发者ID:SiddharthMishraPersonal,项目名称:dnndev,代码行数:12,代码来源:ManageTabs.ascx.cs


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