protected override void OnLoad(EventArgs e) { base.OnLoad(e); try { bool blnIndicateChildren = bool.Parse(GetValue(IndicateChildren, "True")); string strRightArrow; string strDownArrow; var objSkins = new SkinController(); //image for right facing arrow if (!String.IsNullOrEmpty(IndicateChildImageSub)) { strRightArrow = IndicateChildImageSub; } else { strRightArrow = "breadcrumb.gif"; //removed APPIMAGEPATH token - http://www.dotnetnuke.com/Community/ForumsDotNetNuke/tabid/795/forumid/76/threadid/85554/scope/posts/Default.aspx } //image for down facing arrow if (!String.IsNullOrEmpty(IndicateChildImageRoot)) { strDownArrow = IndicateChildImageRoot; } else { strDownArrow = "menu_down.gif"; //removed APPIMAGEPATH token - http://www.dotnetnuke.com/Community/ForumsDotNetNuke/tabid/795/forumid/76/threadid/85554/scope/posts/Default.aspx } //Set correct image path for all separator images if (!String.IsNullOrEmpty(SeparatorHTML)) { SeparatorHTML = FixImagePath(SeparatorHTML); } if (!String.IsNullOrEmpty(SeparatorLeftHTML)) { SeparatorLeftHTML = FixImagePath(SeparatorLeftHTML); } if (!String.IsNullOrEmpty(SeparatorRightHTML)) { SeparatorRightHTML = FixImagePath(SeparatorRightHTML); } if (!String.IsNullOrEmpty(SeparatorLeftHTMLBreadCrumb)) { SeparatorLeftHTMLBreadCrumb = FixImagePath(SeparatorLeftHTMLBreadCrumb); } if (!String.IsNullOrEmpty(SeparatorRightHTMLBreadCrumb)) { SeparatorRightHTMLBreadCrumb = FixImagePath(SeparatorRightHTMLBreadCrumb); } if (!String.IsNullOrEmpty(SeparatorLeftHTMLActive)) { SeparatorLeftHTMLActive = FixImagePath(SeparatorLeftHTMLActive); } if (!String.IsNullOrEmpty(SeparatorRightHTMLActive)) { SeparatorRightHTMLActive = FixImagePath(SeparatorRightHTMLActive); } if (!String.IsNullOrEmpty(NodeLeftHTMLBreadCrumbRoot)) { NodeLeftHTMLBreadCrumbRoot = FixImagePath(NodeLeftHTMLBreadCrumbRoot); } if (!String.IsNullOrEmpty(NodeRightHTMLBreadCrumbRoot)) { NodeRightHTMLBreadCrumbRoot = FixImagePath(NodeRightHTMLBreadCrumbRoot); } if (!String.IsNullOrEmpty(NodeLeftHTMLBreadCrumbSub)) { NodeLeftHTMLBreadCrumbSub = FixImagePath(NodeLeftHTMLBreadCrumbSub); } if (!String.IsNullOrEmpty(NodeRightHTMLBreadCrumbSub)) { NodeRightHTMLBreadCrumbSub = FixImagePath(NodeRightHTMLBreadCrumbSub); } if (!String.IsNullOrEmpty(NodeLeftHTMLRoot)) { NodeLeftHTMLRoot = FixImagePath(NodeLeftHTMLRoot); } if (!String.IsNullOrEmpty(NodeRightHTMLRoot)) { NodeRightHTMLRoot = FixImagePath(NodeRightHTMLRoot); } if (!String.IsNullOrEmpty(NodeLeftHTMLSub)) { NodeLeftHTMLSub = FixImagePath(NodeLeftHTMLSub); } if (!String.IsNullOrEmpty(NodeRightHTMLSub)) { NodeRightHTMLSub = FixImagePath(NodeRightHTMLSub); } if (String.IsNullOrEmpty(PathImage)) { PathImage = PortalSettings.HomeDirectory; } if (blnIndicateChildren) { IndicateChildImageSub = strRightArrow; if (ControlOrientation.ToLower() == "vertical") { IndicateChildImageRoot = strRightArrow; } else { IndicateChildImageRoot = strDownArrow; } } else { IndicateChildImageSub = "[APPIMAGEPATH]spacer.gif"; } PathSystemScript = Globals.ApplicationPath + "/controls/SolpartMenu/"; PathSystemImage = "[APPIMAGEPATH]"; BuildNodes(null); } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } }
/// <summary> /// The Page_Load server event handler on this page is used /// to populate the role information for the page /// </summary> protected override void OnLoad(EventArgs e) { base.OnLoad(e); try { bool blnUseSkinPathArrowImages = bool.Parse(GetValue(UseSkinPathArrowImages, "False")); bool blnUseRootBreadcrumbArrow = bool.Parse(GetValue(UseRootBreadCrumbArrow, "True")); bool blnUseSubMenuBreadcrumbArrow = bool.Parse(GetValue(UseSubMenuBreadCrumbArrow, "False")); bool blnUseArrows = bool.Parse(GetValue(UseArrows, "True")); bool blnRootOnly = bool.Parse(GetValue(RootOnly, "False")); string strRootBreadcrumbArrow; string strSubMenuBreadcrumbArrow; string strRightArrow; string strDownArrow; if (blnRootOnly) { blnUseArrows = false; PopulateNodesFromClient = false; StartTabId = -1; ExpandDepth = 1; } var objSkins = new SkinController(); //image for root menu breadcrumb marking if (!String.IsNullOrEmpty(RootBreadCrumbArrow)) { strRootBreadcrumbArrow = PortalSettings.ActiveTab.SkinPath + RootBreadCrumbArrow; } else { strRootBreadcrumbArrow = Globals.ApplicationPath + "/images/breadcrumb.gif"; } //image for submenu breadcrumb marking if (!String.IsNullOrEmpty(SubMenuBreadCrumbArrow)) { strSubMenuBreadcrumbArrow = PortalSettings.ActiveTab.SkinPath + SubMenuBreadCrumbArrow; } if (blnUseSubMenuBreadcrumbArrow) { strSubMenuBreadcrumbArrow = Globals.ApplicationPath + "/images/breadcrumb.gif"; NodeLeftHTMLBreadCrumbSub = "<img alt=\"*\" BORDER=\"0\" src=\"" + strSubMenuBreadcrumbArrow + "\">"; } if (blnUseRootBreadcrumbArrow) { NodeLeftHTMLBreadCrumbRoot = "<img alt=\"*\" BORDER=\"0\" src=\"" + strRootBreadcrumbArrow + "\">"; } //image for right facing arrow if (!String.IsNullOrEmpty(RightArrow)) { strRightArrow = RightArrow; } else { strRightArrow = "breadcrumb.gif"; } if (!String.IsNullOrEmpty(DownArrow)) { strDownArrow = DownArrow; } else { strDownArrow = "menu_down.gif"; } //Set correct image path for all separator images if (!String.IsNullOrEmpty(Separator)) { if (Separator.IndexOf("src=") != -1) { Separator = Separator.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(LeftSeparator)) { if (LeftSeparator.IndexOf("src=") != -1) { LeftSeparator = LeftSeparator.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(RightSeparator)) { if (RightSeparator.IndexOf("src=") != -1) { RightSeparator = RightSeparator.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(LeftSeparatorBreadCrumb)) { if (LeftSeparatorBreadCrumb.IndexOf("src=") != -1) { LeftSeparatorBreadCrumb = LeftSeparatorBreadCrumb.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(RightSeparatorBreadCrumb)) { if (RightSeparatorBreadCrumb.IndexOf("src=") != -1) { RightSeparatorBreadCrumb = RightSeparatorBreadCrumb.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(LeftSeparatorActive)) { if (LeftSeparatorActive.IndexOf("src=") != -1) { LeftSeparatorActive = LeftSeparatorActive.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(RightSeparatorActive)) { if (RightSeparatorActive.IndexOf("src=") != -1) { RightSeparatorActive = RightSeparatorActive.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } //generate dynamic menu if (blnUseSkinPathArrowImages) { PathSystemImage = PortalSettings.ActiveTab.SkinPath; } else { PathSystemImage = Globals.ApplicationPath + "/images/"; } if (String.IsNullOrEmpty(PathImage)) { PathImage = PortalSettings.HomeDirectory; } if (blnUseArrows) { IndicateChildImageSub = strRightArrow; if (ControlOrientation.ToLower() == "vertical") //NavigationProvider.NavigationProvider.Orientation.Vertical Then { IndicateChildImageRoot = strRightArrow; } else { IndicateChildImageRoot = strDownArrow; } } else { PathSystemImage = Globals.ApplicationPath + "/images/"; IndicateChildImageSub = "spacer.gif"; } if (String.IsNullOrEmpty(PathSystemScript)) { PathSystemScript = Globals.ApplicationPath + "/controls/SolpartMenu/"; } BuildNodes(null); } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
protected override void OnPreRender(EventArgs e) { using (new DNNContext(this)) { var blnUseSkinPathArrowImages = Boolean.Parse(GetValue(UseSkinPathArrowImages, "false")); var blnUseRootBreadcrumbArrow = Boolean.Parse(GetValue(UseRootBreadCrumbArrow, "true")); var blnUseSubMenuBreadcrumbArrow = Boolean.Parse(GetValue(UseSubMenuBreadCrumbArrow, "false")); var blnUseArrows = Boolean.Parse(GetValue(UseArrows, "true")); var blnRootOnly = Boolean.Parse(GetValue(RootOnly, "false")); if (blnRootOnly) { blnUseArrows = false; PopulateNodesFromClient = false; StartTabId = -1; ExpandDepth = 1; } var strRootBreadcrumbArrow = !String.IsNullOrEmpty(RootBreadCrumbArrow) ? PortalSettings.ActiveTab.SkinPath + RootBreadCrumbArrow : ResolveUrl("~/images/breadcrumb.gif"); if (blnUseSubMenuBreadcrumbArrow) { var strSubMenuBreadcrumbArrow = ResolveUrl("~/images/breadcrumb.gif"); NodeLeftHTMLBreadCrumbSub = "<img alt='*' BORDER='0' src='" + strSubMenuBreadcrumbArrow + "'>"; } if (blnUseRootBreadcrumbArrow) { NodeLeftHTMLBreadCrumbRoot = "<img alt='*' BORDER='0' src='" + strRootBreadcrumbArrow + "'>"; } var strRightArrow = !String.IsNullOrEmpty(RightArrow) ? RightArrow : "breadcrumb.gif"; var strDownArrow = !String.IsNullOrEmpty(DownArrow) ? DownArrow : "menu_down.gif"; if (!String.IsNullOrEmpty(Separator)) { if (Separator.IndexOf("src=") != -1) { Separator = Separator.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(LeftSeparator)) { if (LeftSeparator.IndexOf("src=") != -1) { LeftSeparator = LeftSeparator.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(RightSeparator)) { if (RightSeparator.IndexOf("src=") != -1) { RightSeparator = RightSeparator.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(LeftSeparatorBreadCrumb)) { if (LeftSeparatorBreadCrumb.IndexOf("src=") != -1) { LeftSeparatorBreadCrumb = LeftSeparatorBreadCrumb.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(RightSeparatorBreadCrumb)) { if (RightSeparatorBreadCrumb.IndexOf("src=") != -1) { RightSeparatorBreadCrumb = RightSeparatorBreadCrumb.Replace( "src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(LeftSeparatorActive)) { if (LeftSeparatorActive.IndexOf("src=") != -1) { LeftSeparatorActive = LeftSeparatorActive.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(RightSeparatorActive)) { if (RightSeparatorActive.IndexOf("src=") != -1) { RightSeparatorActive = RightSeparatorActive.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } PathSystemImage = blnUseSkinPathArrowImages ? PortalSettings.ActiveTab.SkinPath : ResolveUrl("~/images/"); PathImage = PortalSettings.HomeDirectory; if (blnUseArrows) { IndicateChildImageSub = strRightArrow; IndicateChildImageRoot = (ControlOrientation.ToLower() == "vertical") ? strRightArrow : strDownArrow; } else { PathSystemImage = ResolveUrl("~/images/"); IndicateChildImageSub = "spacer.gif"; } if (String.IsNullOrEmpty(PathSystemScript)) { PathSystemScript = ResolveUrl("~/controls/SolpartMenu/"); } Control.Bind(GetNavigationNodes(null)); base.OnPreRender(e); } }