Example #1
0
        public virtual ActionResult UserNavigation()
        {
            //SecurityUser user = SecurityUser.GetByUserName("DevMc");
            //UserNavigation unav = new UserNavigation(user, systemId);

            //return PartialView("_UserNavigation", unav.MenuItems);

            return(PartialView("_UserNavigation", NavSession.GetMenu()));
        }
Example #2
0
        public virtual ActionResult UserNavigationTabs(int tabMenuId, string themeColour)
        {
            //if (string.IsNullOrEmpty(themeColour))
            //{
            //    ViewBag.ThemeColour = "steel";
            //}
            //else
            //{
            //    ViewBag.ThemeColour = themeColour;
            //}



            //int selectedTabMenuId = tabMenuId;
            //SecurityUser user = SecurityUser.GetByUserName("DevMc");
            //UserNavigation unav = new UserNavigation(user, systemId);

            //if (selectedTabMenuId <= 0)
            //{
            //    try
            //    {
            //        selectedTabMenuId = unav.MenuItems.FirstOrDefault().Children.FirstOrDefault().Children.FirstOrDefault().Id;
            //    }
            //    catch
            //    {
            //    }
            //}
            //var tabMenus = unav.MenuItems.SelectMany(s => s.Children).SelectMany(t => t.Children);

            //return PartialView("_UserNavigationTabs", tabMenus);

            var menu = NavSession.GetMenu();

            if (string.IsNullOrEmpty(themeColour))
            {
                ViewBag.ThemeColour = "steel";
            }
            else
            {
                ViewBag.ThemeColour = themeColour;
            }

            CurrentMenuFinder menuFinder = new CurrentMenuFinder();

            menuFinder.UpdateCurrentPage();

            if (menu != null)
            {
                var tabMenus = menuFinder.GetTabs();
                return(PartialView("_UserNavigationTabs", tabMenus));
            }

            return(PartialView("_UserNavigationTabs", new Spectrum.SharedKernel.Navigation.TabMenuItem[] {}));
        }