From 536447fd360d6fa24a66b9f01e04b1a8caa943bc Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Fri, 28 Feb 2014 12:45:25 +0300 Subject: [PATCH] update replace menu --- .../App_Data/WebsitePanel_Pages.config | 6 +++--- .../App_Skins/Default/Browse2.ascx | 3 ++- .../App_Skins/Default/Browse3.ascx | 3 ++- .../App_Skins/Default/Storefront2.ascx | 3 ++- .../Code/PortalConfiguration.cs | 1 + .../WebsitePanel.WebPortal/Code/PortalPage.cs | 7 +++++++ .../Code/WebsitePanelSiteMapProvider.cs | 1 + .../WebsitePanel/SkinControls/TopMenu.ascx | 2 +- .../WebsitePanel/SkinControls/TopMenu.ascx.cs | 16 +++++++++++++++- .../SkinControls/TopMenu.ascx.designer.cs | 3 +-- 10 files changed, 35 insertions(+), 10 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Pages.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Pages.config index bb162c93..d5a7060d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Pages.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Pages.config @@ -27,7 +27,7 @@ - + @@ -534,7 +534,7 @@ - + @@ -552,7 +552,7 @@ - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Skins/Default/Browse2.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Skins/Default/Browse2.ascx index ae2563c2..0abbf788 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Skins/Default/Browse2.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Skins/Default/Browse2.ascx @@ -33,8 +33,9 @@
- + +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Skins/Default/Browse3.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Skins/Default/Browse3.ascx index 8dcd0803..ad646a3b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Skins/Default/Browse3.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Skins/Default/Browse3.ascx @@ -33,8 +33,9 @@
- + +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Skins/Default/Storefront2.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Skins/Default/Storefront2.ascx index e0c4f531..56925464 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Skins/Default/Storefront2.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Skins/Default/Storefront2.ascx @@ -28,8 +28,9 @@
- + +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalConfiguration.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalConfiguration.cs index 5de61c70..c1de8652 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalConfiguration.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalConfiguration.cs @@ -295,6 +295,7 @@ namespace WebsitePanel.WebPortal page.Enabled = (xmlPage.Attributes["enabled"] != null) ? Boolean.Parse(xmlPage.Attributes["enabled"].Value) : true; page.Hidden = (xmlPage.Attributes["hidden"] != null) ? Boolean.Parse(xmlPage.Attributes["hidden"].Value) : false; + page.Align = (xmlPage.Attributes["align"] != null) ? xmlPage.Attributes["align"].Value : null; page.SkinSrc = (xmlPage.Attributes["skin"] != null) ? xmlPage.Attributes["skin"].Value : null; page.AdminSkinSrc = (xmlPage.Attributes["adminskin"] != null) ? xmlPage.Attributes["adminskin"].Value : null; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalPage.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalPage.cs index 77df175c..a39a595c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalPage.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalPage.cs @@ -45,6 +45,7 @@ namespace WebsitePanel.WebPortal private Dictionary contentPanes = new Dictionary(); private string url; private string target; + private string align; public string Name { @@ -108,5 +109,11 @@ namespace WebsitePanel.WebPortal get { return this.target; } set { this.target = value; } } + + public string Align + { + get { return this.align; } + set { this.align = value; } + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/WebsitePanelSiteMapProvider.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/WebsitePanelSiteMapProvider.cs index acb25348..99990030 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/WebsitePanelSiteMapProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/WebsitePanelSiteMapProvider.cs @@ -199,6 +199,7 @@ namespace WebsitePanel.WebPortal NameValueCollection attrs = new NameValueCollection(); attrs["target"] = page.Target; + attrs["align"] = page.Align; SiteMapNode node = new SiteMapNode(this, page.Name, url, diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/TopMenu.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/TopMenu.ascx index 5c7b570b..96aebfa2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/TopMenu.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/TopMenu.ascx @@ -2,6 +2,6 @@ \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/TopMenu.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/TopMenu.ascx.cs index cf6542e8..2d606b63 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/TopMenu.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/TopMenu.ascx.cs @@ -41,6 +41,12 @@ namespace WebsitePanel.Portal.SkinControls { public partial class TopMenu : System.Web.UI.UserControl { + public string Align + { + get { return ViewState["Align"].ToString(); } + set { ViewState["Align"] = value; } + } + protected void Page_Load(object sender, EventArgs e) { @@ -48,7 +54,15 @@ namespace WebsitePanel.Portal.SkinControls protected void topMenu_MenuItemDataBound(object sender, MenuEventArgs e) { - string target = ((SiteMapNode)e.Item.DataItem)["target"]; + var node = ((SiteMapNode)e.Item.DataItem); + + if (node["align"] == Align) + { + topMenu.Items.Remove(e.Item); + return; + } + + string target = node["target"]; if(!String.IsNullOrEmpty(target)) e.Item.Target = target; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/TopMenu.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/TopMenu.ascx.designer.cs index b92c932e..f5d46f5b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/TopMenu.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/TopMenu.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------