private void SetPageControls_Menu_MenuItemDataBoun() { _siteMapSecondLevel = new SiteMapDataSource(); _communicatorPrivateObject.SetField("SiteMapSecondLevel", BindingFlags.Instance | BindingFlags.NonPublic, _siteMapSecondLevel); _menu = new Menu(); _communicatorPrivateObject.SetField("Menu", BindingFlags.Instance | BindingFlags.NonPublic, _menu); }
public string Setup(SiteMapDataSource smds, string CurrentWebPage) { SiteMapNode node = smds.Provider.FindSiteMapNodeFromKey(CurrentWebPage); if (node == null) { return("<li></li>"); } string html = ""; //Loop through Parent Nodes: if (node.ParentNode != null) { if (node.ParentNode.ParentNode != null) { html += "<li><a href = '" + node.ParentNode.ParentNode.Url + "'>" + node.ParentNode.ParentNode.Title + "</a></li>"; } html += "<li><a href = '" + node.ParentNode.Url + "'>" + node.ParentNode.Title + "</a></li>"; } //Define current page node: html += "<li><strong>" + node.Title + "</strong></li>"; //Loop through Child Nodes: if (node.HasChildNodes) { foreach (SiteMapNode smn in node.ChildNodes) { html += "<li><a href = '" + smn.Url + "'>" + smn.Title + "</a></li>"; } } return(html); }
private void LoadAdminMenu() { var menuTop = (ContentPlaceHolder)Master.FindControl("placeHolderMenuTop"); var sm = new SiteMapDataSource { Provider = SiteMap.Providers["PageSiteMap"], ShowStartingNode = false }; var webMenu = new Menu(); webMenu.StaticMenuItemStyle.Font.Bold = true; webMenu.StaticMenuItemStyle.ForeColor = ColorTranslator.FromHtml("#456305"); webMenu.Orientation = Orientation.Horizontal; webMenu.StaticMenuItemStyle.BorderColor = ColorTranslator.FromHtml("#F0F0F0"); webMenu.DynamicHorizontalOffset = 1; webMenu.DynamicMenuItemStyle.Height = Unit.Pixel(20); webMenu.DynamicMenuItemStyle.BorderWidth = Unit.Point(1); webMenu.DynamicMenuItemStyle.BorderStyle = BorderStyle.Solid; webMenu.DynamicMenuItemStyle.BorderColor = ColorTranslator.FromHtml("#F0F0F0"); webMenu.DynamicMenuItemStyle.Font.Name = "Arial, Helvetica, sans-serif"; webMenu.DynamicMenuItemStyle.Font.Size = 9; webMenu.StaticMenuItemStyle.HorizontalPadding = 0; webMenu.DynamicMenuItemStyle.Font.Bold = true; webMenu.DynamicMenuItemStyle.BackColor = ColorTranslator.FromHtml("#F0F0F0"); webMenu.MaximumDynamicDisplayLevels = 5; webMenu.DataSource = sm; webMenu.DataBind(); menuTop.Controls.Add(webMenu); }
/// <summary> /// Binds the menu. /// </summary> void BindMenu() { int menuId = 0; SiteMapDataSource source = null; if (_DataSource.Equals("catalog")) { source = this.CatalogDataSource; if (!String.IsNullOrEmpty(_DataMember)) { ((CatalogSiteMapProvider)source.Provider).CatalogName = _DataMember; } } else { source = this.MenuDataSource; // Initialize provider if (!String.IsNullOrEmpty(_DataMember)) { int.TryParse(_DataMember, out menuId); ((CmsSiteMapProvider)MenuDataSource.Provider).ActiveTopLevelMenuId = menuId; } } BindMenuFromDataSource(SiteMenu, source); }
/// <summary> /// Binds the menu. /// </summary> private void BindMenuFromDataSource(ComponentArt.Web.UI.Menu menu, SiteMapDataSource source) { //menu.Items.Add(CreateItem("StartLook")); int index = 0; foreach (SiteMapNode node in source.Provider.RootNode.ChildNodes) { // Check if item is visible if (!String.IsNullOrEmpty(node["visible"]) && !Boolean.Parse(node["visible"])) { continue; } if (index > 0) { SiteMenu.Items.Add(CreateItem("BreakLook")); } ComponentArt.Web.UI.MenuItem menuItem = new ComponentArt.Web.UI.MenuItem(); menuItem.ID = node.Key; menuItem.Text = node.Title; menuItem.NavigateUrl = node.Url; menuItem.LookId = "TopItemLook"; menu.Items.Add(menuItem); index++; LoadFromNodeRecursive(node, menuItem); } //menu.Items.Add(CreateItem("EndLook")); menu.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (HttpContext.Current == null) { return; } siteSettings = CacheHelper.GetCurrentSiteSettings(); if (siteSettings == null) { return; } currentPage = CacheHelper.GetCurrentPage(); if (currentPage == null) { return; } siteMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl("SiteMapData"); if (siteMapDataSource == null) { return; } siteMapDataSource.SiteMapProvider = "Csite" + siteSettings.SiteId.ToString(CultureInfo.InvariantCulture); isAdmin = WebUser.IsAdmin; isContentAdmin = WebUser.IsContentAdmin; siteRoot = siteSettings.SiteRoot; DoRendering(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null && Session["pers"] == null) { Response.Redirect("~/Login.aspx"); } else { Persona p = (Persona)Session["pers"]; SiteMapDataSource m = (SiteMapDataSource)Master.FindControl("SiteMapDataSource"); switch (p.TipoPersona) { case (Persona.TipoPersonas.Administrador): m.SiteMapProvider = "AdminSiteMap"; break; case (Persona.TipoPersonas.Alumno): m.SiteMapProvider = "AluSiteMap"; break; case (Persona.TipoPersonas.Profesor): m.SiteMapProvider = "DocenteSiteMap"; break; } m.DataBind(); } }
protected override void OnLoad(EventArgs e) { var dataSource = new SiteMapDataSource { ShowStartingNode = false, StartingNodeOffset = StartingNodeOffset }; if (!string.IsNullOrEmpty(SiteMapProvider)) { dataSource.SiteMapProvider = SiteMapProvider; } if (string.IsNullOrEmpty(StartingNodeUrl) && !StartFromCurrentNode) { throw new InvalidOperationException("If not starting from current node, a StartingNodeUrl must be provided."); } if (!string.IsNullOrEmpty(StartingNodeUrl)) { dataSource.StartingNodeUrl = StartingNodeUrl; } else { dataSource.StartFromCurrentNode = StartFromCurrentNode; } base.DataSource = dataSource; DataBind(); base.OnLoad(e); }
protected void Page_Load(object sender, EventArgs e) { siteSettings = CacheHelper.GetCurrentSiteSettings(); currentPage = CacheHelper.GetCurrentPage(); if (siteSettings == null) { return; } siteMapDataSource = (SiteMapDataSource)this.FindControl("SiteMapData"); if (siteMapDataSource == null) { return; } siteMapDataSource.SiteMapProvider = "Csite" + siteSettings.SiteId.ToString(CultureInfo.InvariantCulture); try { rootNode = siteMapDataSource.Provider.RootNode; } catch (HttpException) { return; } SetupLayout(); }
private void LoadSiteMapSettings() { resolveFullUrlsForMenuItemProtocolDifferences = WebConfigSettings.ResolveFullUrlsForMenuItemProtocolDifferences; if (resolveFullUrlsForMenuItemProtocolDifferences) { secureSiteRoot = WebUtils.GetSecureSiteRoot(); insecureSiteRoot = WebUtils.GetInSecureSiteRoot(); } isSecureRequest = SiteUtils.IsSecureRequest(); //siteMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl("SiteMapData"); siteMapDataSource = new SiteMapDataSource(); siteMapDataSource.SiteMapProvider = "mojosite" + siteSettings.SiteId.ToInvariantString(); rootNode = siteMapDataSource.Provider.RootNode; pageId = WebUtils.ParseInt32FromQueryString("node", pageId); if (pageId > -1) { currentNode = SiteUtils.GetSiteMapNodeForPage(rootNode, pageId); } //if (currentNode == null) { currentNode = rootNode; } renderChildren = WebUtils.ParseBoolFromQueryString("renderchildren", renderChildren); if (rootLabel.Length == 0) { rootLabel = ResourceHelper.GetResourceString("Resource", "PageSettingsRootLabel"); } }
private void PopulateControls() { bool hideMenu = siteSettings.AllowHideMenuOnPages && currentPage.HideMainMenu; if (showPages && !hideMenu) { siteMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl("SiteMapData"); if (siteMapDataSource == null) { return; } siteMapDataSource.SiteMapProvider = String.Format("Csite{0}", siteSettings.SiteId.ToString(CultureInfo.InvariantCulture)); if (this.useTreeView) { RenderTreeView(); } else { RenderMenu(); } } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); string title = this.Page.Title; this.role = "document"; using (SiteMapDataSource siteMapDataSource = new SiteMapDataSource()) { SiteMapNode siteMapNode = siteMapDataSource.Provider.CurrentNode; if (siteMapNode != null) { title = siteMapNode.Title; this.role = "application"; SiteMapNode rootNode = siteMapDataSource.Provider.RootNode; while (siteMapNode.ParentNode != null && siteMapNode.ParentNode != rootNode) { siteMapNode = siteMapNode.ParentNode; } string pageTitleFormat = Util.GetPageTitleFormat(siteMapNode); if (pageTitleFormat != null) { this.Page.Title = string.Format(pageTitleFormat, title); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Page is CmsPage) { currentPage = CacheHelper.GetCurrentPage(); } if (CurSettings == null) { return; } siteMapDataSource = (SiteMapDataSource)this.FindControl("SiteMapData"); if (siteMapDataSource == null) { return; } siteMapDataSource.SiteMapProvider = String.Format("Csite{0}", CurSettings.SiteId.ToInvariantString()); try { rootNode = siteMapDataSource.Provider.RootNode; } catch (HttpException) { return; } SetupLayout(); }
protected void Page_Load(object sender, EventArgs e) { if (HttpContext.Current == null) { return; } EnableViewState = false; siteSettings = CacheHelper.GetCurrentSiteSettings(); if (siteSettings == null) { return; } currentPage = CacheHelper.GetCurrentPage(); if (currentPage == null) { return; } siteMapDataSource = (SiteMapDataSource)Page.Master.FindControl("SiteMapData"); if (siteMapDataSource == null) { return; } siteMapDataSource.SiteMapProvider = "mojosite" + siteSettings.SiteId.ToInvariantString(); if (WebConfigSettings.DisableViewStateOnSiteMapDataSource) { siteMapDataSource.EnableViewState = false; } isAdmin = WebUser.IsAdmin; if (!isAdmin) { isContentAdmin = WebUser.IsContentAdmin; } if (!isAdmin && !isContentAdmin) { isSiteEditor = SiteUtils.UserIsSiteEditor(); } siteRoot = SiteUtils.GetNavigationSiteRoot(); if (Page is mojoBasePage) { mojoBasePage basePage = Page as mojoBasePage; enableUnclickableLinks = basePage.StyleCombiner.EnableNonClickablePageLinks; } DoRendering(); }
public void Setup() { _accountsHomePage = new AccountsHomePage(); _accountsHomePagePrivate = new PrivateObject(_accountsHomePage); _siteMapSecondLevelField = new SiteMapDataSource(); _menuField = new Menu(); _shimsContext = ShimsContext.Create(); InitializeFields(); }
public static IEnumerable <KeyValuePair <string, string> > GetUrls() { SiteMapDataSource sm = new SiteMapDataSource(); return(from SiteMapNode node in sm.Provider.RootNode.GetAllNodes() where node.HasChildNodes == false && Convert.ToBoolean(node["isTransactionForm"]) == true select new KeyValuePair <string, string>(node.Url.Substring(node.Url.LastIndexOf("/") + 1), node.Title)); }
protected void Page_Load(object sender, EventArgs e) { SiteMapDataSource dataSource = GenerateSiteMapHierarchy(AccessDataSource1); dataSource.ShowStartingNode = false; ASPxSiteMapControl1.DataSource = dataSource; ASPxSiteMapControl1.DataBind(); }
private void PopulatePageList() { siteMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl("SiteMapData"); siteMapDataSource.SiteMapProvider = "Csite" + siteSettings.SiteId.ToInvariantString(); SiteMapNode siteMapNode = siteMapDataSource.Provider.RootNode; PopulateListControl(lbPages, siteMapNode, string.Empty); }
private void PopulatePageArray(ArrayList sitePages) { SiteMapDataSource siteMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl("SiteMapData"); siteMapDataSource.SiteMapProvider = "mojosite" + siteSettings.SiteId.ToInvariantString(); SiteMapNode siteMapNode = siteMapDataSource.Provider.RootNode; mojoSiteMapProvider.PopulateArrayList(sitePages, siteMapNode); }
private void PopulatePageList(Collection <DictionaryEntry> deCollection) { siteMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl("SiteMapData"); siteMapDataSource.SiteMapProvider = "mojosite" + siteSettings.SiteId.ToString(CultureInfo.InvariantCulture); SiteMapNode siteMapNode = siteMapDataSource.Provider.RootNode; PopulatePageDictionary(deCollection, siteMapNode, string.Empty); }
private void PopulatePageArray() { siteMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl("SiteMapData"); siteMapDataSource.SiteMapProvider = "Csite" + siteSettings.SiteId.ToString(CultureInfo.InvariantCulture); SiteMapNode siteMapNode = siteMapDataSource.Provider.RootNode; CSiteMapProvider.PopulateArrayList(sitePages, siteMapNode); }
public static string GetRangeZoneIdsToSemiColonSeparatedString(int siteId, int parentZoneId) { SiteMapDataSource siteMapDataSource = new SiteMapDataSource(); siteMapDataSource.SiteMapProvider = "canhcamsite" + siteId.ToInvariantString(); SiteMapNode rootNode = siteMapDataSource.Provider.RootNode; SiteMapNode startingNode = null; if (rootNode == null) { return(null); } string listChildZoneIds = parentZoneId + ";"; if (parentZoneId > -1) { SiteMapNodeCollection allNodes = rootNode.GetAllNodes(); foreach (SiteMapNode childNode in allNodes) { gbSiteMapNode gbNode = childNode as gbSiteMapNode; if (gbNode == null) { continue; } if (Convert.ToInt32(gbNode.Key) == parentZoneId) { startingNode = gbNode; break; } } } else { startingNode = rootNode; } if (startingNode == null) { return(string.Empty); } SiteMapNodeCollection childNodes = startingNode.GetAllNodes(); foreach (gbSiteMapNode childNode in childNodes) { listChildZoneIds += childNode.Key + ";"; } return(listChildZoneIds); }
private void ShowChildPageMap() { SiteSettings siteSettings = CacheHelper.GetCurrentSiteSettings(); if (siteSettings == null) { return; } siteMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl("ChildPageSiteMapData"); siteMapDataSource.SiteMapProvider = "Csite" + siteSettings.SiteId.ToString(CultureInfo.InvariantCulture); if (siteMapDataSource == null) { return; } //SiteMapNode node // = siteMapDataSource.Provider.FindSiteMapNode(Request.RawUrl); //if (node != null) //{ // siteMapDataSource.StartingNodeUrl = Request.RawUrl; //} SiteMapNode node = siteMapDataSource.Provider.FindSiteMapNode(currentPage.Url); if (node != null) { siteMapDataSource.StartingNodeUrl = node.Url; } else { node = siteMapDataSource.Provider.FindSiteMapNode(Request.RawUrl); if (node != null) { siteMapDataSource.StartingNodeUrl = Request.RawUrl; } } SiteMap1.MenuItemDataBound += new MenuEventHandler(SiteMap_MenuItemDataBound); SiteMap1.Orientation = Orientation.Vertical; SiteMap1.PathSeparator = '|'; SiteMap1.MaximumDynamicDisplayLevels = maximumDynamicDisplayLevels; SiteMap1.DataSourceID = siteMapDataSource.ID; SiteMap1.DataBind(); }
private SiteMapDataSource GetSiteMapDataSource() { XmlSiteMapProvider xmlSiteMap = new XmlSiteMapProvider(); System.Collections.Specialized.NameValueCollection myCollection = new System.Collections.Specialized.NameValueCollection(1); myCollection.Add("siteMapFile", "Web.sitemap"); xmlSiteMap.Initialize("provider", myCollection); xmlSiteMap.BuildSiteMap(); SiteMapDataSource siteMap = new SiteMapDataSource(); return(siteMap); }
protected void MoveUpBtn_Click(object sender, ImageClickEventArgs e) { HtmlTable Table = (HtmlTable)LoginView1.FindControl("PageDetails"); TreeView pagesTV = (TreeView)LoginView1.FindControl("PagesTreeView"); SiteMapDataSource source = (SiteMapDataSource)LoginView1.FindControl("SiteMapDataSource1"); string temp = pagesTV.SelectedValue; string pageid = WebPageData.GetWebPageId(temp); editor = new SitemapEditor(); editor.MoveUp(pageid); editor.Save(); pagesTV.DataSource = source; pagesTV.DataBind(); }
/// <summary> /// Load time processing /// </summary> /// <param name="e">Event arguments</param> protected override void OnLoad(EventArgs e) { SiteMapDataSource siteMapDS = (SiteMapDataSource)this.Master.FindControl("siteMapDS"); if (String.IsNullOrEmpty(siteMapDS.StartingNodeUrl)) { siteMapDS.StartFromCurrentNode = true; siteMapDS.StartingNodeOffset = -2; } this.siteMapListControl.DataSource = siteMapDS; base.OnLoad(e); }
/// <summary> /// Set's up the Asp.net default Menu control for display inside our skinning engine /// </summary> private void SetupMenu() { if (aspnetMenu != null) { string randomId = Guid.NewGuid().ToString("N").Substring(0, 5); // make ready the scripts StringBuilder script = new StringBuilder(); script.AppendFormat("<script type=\"text/javascript\" language=\"Javascript\">\n"); script.AppendFormat(" function loadMenu_{0}() {{\n", randomId); string menuId = aspnetMenu.ClientID; SiteMapDataSource ds = new SiteMapDataSource(); var prov = SiteMapProviderFactory.GetSiteMap(Customer.Current, aspnetMenu.MaximumDynamicDisplayLevels); prov.MaximumDynamicDisplayLevels = aspnetMenu.MaximumDynamicDisplayLevels; ds.Provider = prov; aspnetMenu.DataSource = ds; aspnetMenu.AppRelativeTemplateSourceDirectory = "~/"; //aspnetMenu.MaximumDynamicDisplayLevels = AspDotNetStorefrontCommon.AppConfig.SiteDisplay.MaxMenuLevelSize; aspnetMenu.DataBind(); // now for the custom asp.net Menu javascript script.AppendFormat(" if({0}_Data) {{\n", menuId); script.AppendFormat(" {0}_Data.hoverClass = '{0}_DynamicHoverStyle';\n", menuId); script.AppendFormat(" {0}_Data.hoverHyperLinkClass = '{0}_DynamicHoverStyle';\n", menuId); script.AppendFormat(" {0}_Data.staticHoverClass = '{0}_StaticHoverStyle';\n", menuId); script.AppendFormat(" {0}_Data.staticHoverHyperLinkClass = '{0}_StaticHoverStyle';\n", menuId); script.AppendFormat(" }}\n"); // ending brace for loadMenu function script.AppendFormat(" }}\n"); script.AppendFormat(" $window_addLoad(loadMenu_{0});\n", randomId); script.AppendFormat("</script>\n"); Page.ClientScript.RegisterStartupScript(this.GetType(), randomId, script.ToString()); // fix for safari browsers if (Request.UserAgent != null) { if (Request.UserAgent.IndexOf("AppleWebKit") > 0) { Request.Browser.Adapters.Clear(); } } } }
public static SiteMapDataSource GetSiteMapDataSource(string strRole) { System.Collections.Specialized.NameValueCollection myCollection = new System.Collections.Specialized.NameValueCollection(1); myCollection.Add("siteMapFile", "~/Web.sitemap"); XmlSiteMapProvider xmlSiteMap = new XmlSiteMapProvider(); xmlSiteMap.Initialize("provider", myCollection); xmlSiteMap.BuildSiteMap(); SiteMapDataSource siteMap = new SiteMapDataSource(); siteMap.StartingNodeUrl = "~/" + strRole + "Dummy.aspx"; siteMap.ShowStartingNode = false; return siteMap; }
protected SiteMapDataSource GenerateSiteMapHierarchy(SqlDataSource dataSource) { SiteMapDataSource ret = new SiteMapDataSource(); DataSourceSelectArguments arg = new DataSourceSelectArguments("ParentID"); DataView dataView = dataSource.Select(arg) as DataView; DataTable table = dataView.Table; DataRow rowRootNode = table.Select("ParentID = 0")[0]; UnboundSiteMapProvider provider = new UnboundSiteMapProvider(rowRootNode["NavigateURL"].ToString(), rowRootNode["Text"].ToString()); AddNodeToProviderRecursive(provider.RootNode, rowRootNode["ID"].ToString(), table, provider); ret.Provider = provider; return(ret); }
private NavigationTreeNode CreateNavTree() { NavigationTreeNode navigationTreeNode = null; using (SiteMapDataSource siteMapDataSource = new SiteMapDataSource()) { SiteMapNode rootNode = siteMapDataSource.Provider.RootNode; navigationTreeNode = this.CreateDataContract(rootNode); if (navigationTreeNode == null || !navigationTreeNode.HasContentPage) { throw new CmdletAccessDeniedException(Strings.AccessDeniedMessage); } } return(navigationTreeNode); }
private SiteMapDataSource GetSiteMapDataSource() { XmlSiteMapProvider xmlSiteMap = new XmlSiteMapProvider(); System.Collections.Specialized.NameValueCollection myCollection = new System.Collections.Specialized.NameValueCollection(1); myCollection.Add("siteMapFile", "Web.sitemap"); xmlSiteMap.Initialize("provider", myCollection); xmlSiteMap.BuildSiteMap(); SiteMapDataSource siteMap = new SiteMapDataSource(); siteMap.ShowStartingNode = false; return siteMap; }
// Constructors public SiteMapDataSourceView(SiteMapDataSource owner, string name, System.Web.SiteMapNode node) { }
public SiteMapDataSourceView(SiteMapDataSource owner, string name, System.Web.SiteMapNodeCollection collection) { }
/// <summary> /// Create SmartPanel to render navigation tree. /// </summary> private PXSmartPanel CreateNavigationPanel(SiteMapNode node, bool active, object index) { string panelID = "sp" + index.ToString(); bool favorites = (node == null); string trId = favorites ? _favTreeID : ("tree" + index.ToString()); PXSmartPanel panel = new PXSmartPanel(); panel.ID = panelID; panel.Key = favorites ? _favorites : node.Key; panel.LoadOnDemand = !active; panel.AllowResize = panel.AllowMove = false; panel.RenderVisible = active; panel.AutoSize.Enabled = true; panel.Position = PanelPosition.Original; if ((this.IsCallback && !this.IsReloadMenuPanel) || active) { SiteMapDataSource ds = new SiteMapDataSource(); ds.ID = "ds" + index.ToString(); ds.ShowStartingNode = false; panel.Controls.Add(ds); PXSiteMapNode pxNode = node as PXSiteMapNode; Control content = null; PXWikiProvider wp = PXSiteMap.WikiProvider; if (favorites) { ds.Provider = PXSiteMap.FavoritesProvider; ds.StartingNodeUrl = System.Web.SiteMap.RootNode.Url; content = CreateTree(ds, trId); } else if (wp.FindSiteMapNodeFromKey(pxNode.NodeID) != null) { if (wp.GetWikiID(pxNode.Title) != Guid.Empty || wp.GetWikiIDFromUrl(pxNode.Url) != Guid.Empty) content = CreateWikiTree(pxNode, trId); if (PXSiteMap.IsPortal) this.moduleLink.Visible = true; } else { INavigateUIData dataItem = node as INavigateUIData; if (string.IsNullOrEmpty(dataItem.NavigateUrl)) { PXSiteMap.Provider.SetCurrentNode(PXSiteMap.Provider.FindSiteMapNodeFromKey(node.Key)); ds.StartFromCurrentNode = true; } else ds.StartingNodeUrl = dataItem.NavigateUrl; content = CreateTree(ds, trId); } if (content != null) panel.Controls.Add(content); } return panel; }
//--------------------------------------------------------------------------- /// <summary> /// Create default menu tree control with specified name and data source. /// </summary> private PXTreeView CreateTree(SiteMapDataSource ds, string controlName) { PXTreeView tree = new PXTreeView(); tree.DataSourceID = ds.ID; tree.ID = controlName; tree.ShowRootNode = false; tree.FastExpand = true; tree.Target = "main"; tree.ApplyStyleSheetSkin(this); tree.NodeDataBound += new PXTreeNodeEventHandler(tree_NodeDataBound); tree.DataBound += tree_DataBound; tree.ShowDefaultImages = tree.ShowLines = false; tree.Synchronize += new PXTreeSyncEventHandler(tree_Synchronize); tree.CssClass += " menuTree"; tree.ExclusiveExpand = this.IsContextNavigation(); if(PXSiteMap.IsPortal) tree.SearchUrl = this.ResolveUrl("~/Search/WikiSP.aspx") + "?globalsearchcaption=0adv=1&query="; else tree.SearchUrl = this.ResolveUrl("~/Search/Entity.aspx") + "?globalsearchcaption=1&isWiki=0" + "&query="; return tree; }