protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //Get the Administration menu item from the cache
            ENTMenuItemBO administrationMenuItem = Globals.GetMenuItems(Cache).GetByMenuItemName("Administration");

            //Create a node for each child element of the administrative menu.
            CreateChildNodes(tvMenuDescriptions.Nodes, administrationMenuItem.ChildMenuItems);
        }
    }
Exemplo n.º 2
0
        private string GetActiveTab(ENTMenuItemBO subMenu)
        {
            string menu = "<li class=\"current\"><a href=\"" + RootPath + subMenu.Url + "\"><b>" + subMenu.MenuItemName +
                          "</b></a>";

            foreach (var subItem in subMenu.ChildMenuItems)
            {
                menu += "<ul class=\"subMenu\">"
                        //+"<a href=\"" + RootPath + subItem.Url + "\">"
                        //+ subItem.MenuItemName
                        //+ "</a>"
                        + "</ul>";
            }
            menu += "</li>";
            return(menu);
        }
Exemplo n.º 3
0
        protected override void RenderContents(HtmlTextWriter writer)
        {
            base.RenderContents(writer);

            string html;

            // Get the parent menu item for the current menu item.  The parent will be
            // the one with a null ParentMenuItemId
            if (MenuItems != null)
            {
                ENTMenuItemBO topMenuItem = MenuItems.GetTopMenuItem(CurrentMenuItemName);
                html = "<ul class=\"glossymenu\">";

                // Loop around the top level items
                foreach (var mi in MenuItems)
                {
                    if (mi.HasAccessToMenu(UserAccount, Roles))
                    {
                        // Check if this is the selected menu tab.
                        if (mi.MenuItemName == topMenuItem.MenuItemName)
                        {
                            html += GetActiveTab(mi);
                        }
                        else
                        {
                            html += GetInactiveTab(mi);
                        }
                    }
                }

                html += "</ul>";
            }
            else
            {
                html = "<div>Top Menu Goes Here</div>";
            }

            writer.Write(html);
        }
Exemplo n.º 4
0
 private string GetInactiveTab(ENTMenuItemBO subMenu)
 {
     return("<li><a href=\"" + RootPath + subMenu.Url + "\"><b>" + subMenu.MenuItemName + "</b></a></li>");
 }