diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx index f02c0f95..a2535bd2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VdcHome.ascx @@ -13,8 +13,8 @@ -
-
+
+
@@ -22,7 +22,7 @@ Text="Import VPS" CssClass="Button1" CausesValidation="False" onclick="btnImport_Click" />
-
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VpsMenu.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VpsMenu.ascx.cs index b406b5d5..a80249e1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VpsMenu.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VpsMenu.ascx.cs @@ -27,16 +27,18 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.Linq; +using System.Collections.Generic; +using System.Web.UI; using System.Web.UI.WebControls; using WebsitePanel.EnterpriseServer; using WebsitePanel.WebPortal; -using WebsitePanel.Portal.UserControls; namespace WebsitePanel.Portal { - public partial class VpsMenu : VpsMenuControl + public partial class VpsMenu : WebsitePanelModuleBase { private const string PID_SPACE_VPS = "SpaceVPS2012"; @@ -123,7 +125,11 @@ namespace WebsitePanel.Portal MenuItem item = new MenuItem(); item.Text = GetLocalizedString("Text." + text); - item.NavigateUrl = PortalUtils.EditUrl("ItemID", ItemID.ToString(), key, "SpaceID=" + PackageId); + var hostModule = GetAllControlsOfType(this.Page); + if (hostModule.Count > 0) + { + item.NavigateUrl = hostModule.LastOrDefault().EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), key); // PortalUtils.EditUrl("ItemID", ItemID.ToString(), key, "SpaceID=" + PackageId); + } //if (img == null) // item.ImageUrl = PortalUtils.GetThemedIcon("Icons/tool_48.png"); @@ -133,5 +139,22 @@ namespace WebsitePanel.Portal return item; } + public static List GetAllControlsOfType(Control parent) where T : Control + { + var result = new List(); + foreach (Control control in parent.Controls) + { + if (control is T) + { + result.Add((T) control); + } + if (control.HasControls()) + { + result.AddRange(GetAllControlsOfType(control)); + } + } + return result; + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj index 67a7faf2..0d25226f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -332,9 +332,6 @@ HostedSharePointEnterpriseStorageUsage.ascx - - ASPXCodeBehind - VpsMenu.ascx ASPXCodeBehind