/// <summary> /// obtm a informao das seces e constroi os objectos que /// representam a sua informao no menu (SectionMenuLink) /// </summary> /// <returns>o contentor com os objectos menuLink que representam a /// a informao das seces</returns> private ArrayList calculateMotherSections() { ArrayList sectionsCollection = ((SectionCollection)SectionUtility.getAllSections()).getOrderedSections(); ArrayList menuSection = new ArrayList(); int menuLevel = getMenuLevel(); foreach (SectionInfo sectionInfo in sectionsCollection) { if (!sectionInfo.isVisible) { continue; } if (sectionInfo.sectionName.CompareTo("Admin") == 0) { if (!checkRole("admin")) { continue; } } if (sectionInfo.sectionParentId <= menuLevel) { SectionMenuLink link = new SectionMenuLink(sectionInfo.sectionName, sectionInfo.sectionPath); menuSection.Add(link); } } return(menuSection); }
private ArrayList getOrderedSections() { lock (sync) { ArrayList orderedSections = (ArrayList)Context.Cache["SubSectionsMenu"]; if (orderedSections == null) { orderedSections = ((SectionCollection)SectionUtility.getAllSections()).getOrderedSections(); Context.Cache["SubSectionsMenu"] = orderedSections; } return(orderedSections); } }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); commandMenu.DataSource = SectionUtility.getAllSections(); commandMenu.DataBind(); }