protected void RenderMiddleNav() { switch (this.topNavType) { case _Default.TopNav.NoTopNav: return; case _Default.TopNav.O365GNav: case _Default.TopNav.O365GNavFallback: if (NavigationUtil.ShouldRenderOwaLink(RbacPrincipal.Current, this.showAdminFeatures.Value) && !string.IsNullOrWhiteSpace(HttpContext.Current.GetOwaNavigationParameter())) { base.Response.Output.Write("<div id=\"middleNavZone\" class=\"{3}\" ><div class=\"middleLeftNav\"><a id=\"returnToOWA\" onclick=\"return JumpTo('{2}', true);\" title=\"{0}\" href=\"#\"><img id=\"imgRetrunToOWA\" class=\"NavigationSprite ReturnToOWA\" src='{1}' alt=\"{0}\" title=\"{0}\"/></a></div></div>", new object[] { OwaOptionStrings.ReturnToOWA, Util.GetSpriteImageSrc(this), HttpUtility.HtmlEncode(HttpUtility.JavaScriptStringEncode(EcpUrl.GetOwaNavigateBackUrl())), "o365MiddleNav" }); return; } return; } if ((!this.showAdminFeatures.Value || !RbacPrincipal.Current.IsInRole("ControlPanelAdmin")) && !string.IsNullOrWhiteSpace(HttpContext.Current.GetOwaNavigationParameter())) { base.Response.Output.Write("<div id=\"middleNavZone\" class=\"{3}\" ><div class=\"middleLeftNav\"><a id=\"returnToOWA\" onclick=\"return JumpTo('{2}', true);\" title=\"{0}\" href=\"#\"><img id=\"imgRetrunToOWA\" class=\"NavigationSprite ReturnToOWA\" src='{1}' alt=\"{0}\" title=\"{0}\"/></a></div></div>", new object[] { OwaOptionStrings.ReturnToOWA, Util.GetSpriteImageSrc(this), HttpUtility.HtmlEncode(HttpUtility.JavaScriptStringEncode(EcpUrl.GetOwaNavigateBackUrl())), "defaultMiddleNav" }); } }
private void BuildNameDropDown() { RbacPrincipal rbacPrincipal = RbacPrincipal.Current; DropDownCommand dropDownCommand = this.nameDropDown.DropDownCommand; dropDownCommand.Name = "UserName"; dropDownCommand.Text = rbacPrincipal.Name; if (NavigationUtil.ShouldRenderOwaLink(rbacPrincipal, this.showAdminFeatures.Value)) { dropDownCommand.Commands.Add(new Command { Name = "MailLnk", Text = Strings.MyMail, OnClientClick = "JumpTo('" + EcpUrl.OwaVDir + "', true);" }); } if (this.HasAccessTo("helpdesk")) { dropDownCommand.Commands.Add(new Command { Name = "Helpdesk", Text = Strings.EntryOnBehalfOf, OnClientClick = "JumpTo('helpdesk');" }); } if (NavigationUtil.ShouldRenderLogoutLink(rbacPrincipal)) { if (dropDownCommand.Commands.Count > 0) { dropDownCommand.Commands.Add(new SeparatorCommand()); } dropDownCommand.Commands.Add(new Command { Name = "SignOff", Text = Strings.SignOff, OnClientClick = "Navigation.SignOut();" }); } }
public NavBarPack GetNavBarPack() { if (this.userPuid != null && !this.fallbackMode && (this.forceReload || !this.UseNavBarPackCache)) { this.navBarPack = this.EndGetNavBarPack(); } bool isMockObject = false; if (this.navBarPack == null && !this.forceReload) { this.navBarPack = this.GetMockNavBarPack(); NavBarData navBarData = this.navBarPack.NavBarData; navBarData.UserDisplayName = this.rbacPrincipal.Name; if (NavigationUtil.ShouldRenderLogoutLink(this.rbacPrincipal)) { navBarData.SignOutLink = MockNavBar.CreateLink("signout_O365L", Strings.SignOff, "logoff.aspx?src=exch", null); } if (!this.isGallatin) { navBarData.FooterCopyrightText = this.Office365Copyright; navBarData.LegalLink = MockNavBar.CreateLink("legal_O365L", Strings.Legal, "http://g.microsoftonline.com/1BX10en/20", "_blank"); navBarData.CommunityLink = MockNavBar.CreateLink("community_O365L", Strings.Community, "http://g.microsoftonline.com/1BX10en/142", "_blank"); navBarData.PrivacyLink = MockNavBar.CreateLink("privacy_O365L", Strings.Privacy, "http://g.microsoftonline.com/1BX10en/11", "_blank"); } navBarData.HelpLink = MockNavBar.CreateLink("help_O365L", Strings.Help, null, null); isMockObject = true; if (this.fallbackMode) { this.navBarPack.IsFresh = true; } } if (this.navBarPack != null) { this.UpdateAppsLinks(); this.AddCustomSubLinks(isMockObject); } return(this.navBarPack); }
private void AddCustomSubLinks(bool isMockObject) { NavBarLinkData[] currentWorkloadUserSubLinks = null; if (this.showAdminFeature) { this.navBarPack.FeatureSet = "myorg"; this.navBarPack.NavBarData.CurrentMainLinkElementID = "ShellAdmin"; if (this.rbacPrincipal.IsInRole("UserOptions+OrgMgmControlPanel")) { currentWorkloadUserSubLinks = new NavBarLinkData[] { MockNavBar.CreateLink("eso_O365L", Strings.EntryOnBehalfOf, null, null) }; } } else { this.navBarPack.FeatureSet = "myself"; this.navBarPack.NavBarData.CurrentMainLinkElementID = "ShellOutlook"; if (isMockObject && NavigationUtil.ShouldRenderOwaLink(this.rbacPrincipal, this.showAdminFeature)) { NavBarLinkData[] workloadLinks = new NavBarLinkData[] { MockNavBar.CreateLink("ShellOutlook", Strings.NavBarMail, EcpUrl.OwaVDir, null) }; this.navBarPack.NavBarData.WorkloadLinks = workloadLinks; } } this.navBarPack.NavBarData.CurrentWorkloadUserSubLinks = currentWorkloadUserSubLinks; List <NavBarLinkData> list = new List <NavBarLinkData>(); string flightName = this.navBarPack.NavBarData.FlightName; if (!string.IsNullOrEmpty(flightName) && flightName.Contains("GeminiShellUX")) { this.navBarPack.HelpParameters = this.navBarPack.NavBarData.HelpLink.Url; this.navBarPack.NavBarData.HelpLink.Id = (this.showAdminFeature ? "openHelp_O365L" : "openOptionHelp_O365L"); this.navBarPack.NavBarData.HelpLink.Url = HelpUtil.BuildEhcHref(this.showAdminFeature ? EACHelpId.Default.ToString() : OptionsHelpId.OwaOptionsDefault.ToString()); } else if (this.showAdminFeature) { list.Add(MockNavBar.CreateLink("openHelp_O365L", Strings.Help, HelpUtil.BuildEhcHref(EACHelpId.Default.ToString()), null)); } else { list.Add(MockNavBar.CreateLink("openOptionHelp_O365L", Strings.Help, HelpUtil.BuildEhcHref(OptionsHelpId.OwaOptionsDefault.ToString()), null)); } HttpCookie httpCookie = HttpContext.Current.Request.Cookies["msExchEcpFvaHelp"]; bool flag = httpCookie != null && httpCookie.Value != null && httpCookie.Value.StartsWith("0"); list.Add(MockNavBar.CreateLink("toggleFVA_O365L", flag ? ClientStrings.EnableFVA : ClientStrings.DisableFVA, null, null)); if (NavBarClientBase.showPerfConsole) { list.Add(MockNavBar.CreateLink("perfConsole_O365L", Strings.PerformanceConsole, null, null)); } if (this.showAdminFeature && EacFlightUtility.GetSnapshotForCurrentUser().Eac.CmdletLogging.Enabled) { list.Add(MockNavBar.CreateLink("cmdletLogging_O365L", Strings.CmdLogButtonText, null, null)); } this.navBarPack.NavBarData.CurrentWorkloadHelpSubLinks = list.ToArray(); if (this.isGallatin && this.navBarPack.NavBarData.FooterICPLink != null) { if (!string.IsNullOrEmpty(this.navBarPack.NavBarData.FooterICPLink.Text)) { this.navBarPack.NavBarData.FooterICPLink.Text = this.navBarPack.NavBarData.FooterICPLink.Text.Replace("-10", "-22"); } if (!string.IsNullOrEmpty(this.navBarPack.NavBarData.FooterICPLink.Title)) { this.navBarPack.NavBarData.FooterICPLink.Title = this.navBarPack.NavBarData.FooterICPLink.Title.Replace("-10", "-22"); } } }