Tab "Settings" is always present in the dashboard

Nov 9, 2011 at 12:50 AM
Edited Nov 9, 2011 at 1:05 AM

I found a bug in AdminMenu.cs file when you generate the menu item "Settings".
When I select an other theme, the tab remains active.
I fixed it with this code:

using Orchard.Localization;
using Orchard.UI.Navigation;
using Orchard.Themes.Services;

namespace Mango
{
    public class AdminMenu : INavigationProvider {

        ISiteThemeService _siteThemeService;

        public AdminMenu(ISiteThemeService siteThemeService)
        {
            _siteThemeService = siteThemeService;
        }

        public Localizer T { get; set; }
        public string MenuName { get { return "admin"; } }

        public void GetNavigation(NavigationBuilder builder)
        {
            var siteTheme = _siteThemeService.GetSiteTheme();
            if (siteTheme.Name == "SuperClassic")
                builder.Add(T("Themes"),
                    menu => menu.Add(T("Settings"), "3", item => item.Action("Index", "Admin", new { area = "SuperClassic" }).LocalNav())
                );

        }
    }
}

What do you think on it?

Feb 10, 2013 at 5:44 PM
Loved it.