From e1b24f8678ccff502c8b4cdd391eb4f99badfe44 Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Tue, 29 Mar 2011 14:33:18 -0700 Subject: [PATCH] Cleaning up the menu for when a user with limited admin access is given orphaned admin menu headers. work item: 17420 --HG-- branch : 1.x --- src/Orchard.Web/Themes/TheAdmin/Views/Menu.cshtml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Orchard.Web/Themes/TheAdmin/Views/Menu.cshtml b/src/Orchard.Web/Themes/TheAdmin/Views/Menu.cshtml index 88091e6a6..2a942f332 100644 --- a/src/Orchard.Web/Themes/TheAdmin/Views/Menu.cshtml +++ b/src/Orchard.Web/Themes/TheAdmin/Views/Menu.cshtml @@ -39,6 +39,11 @@ : Html.Link(sectionHeaderText, (string)firstOfTheSecond.Href, new { @class = itemClassName }); } else { + // if the header isn't linked and there are no children there's no reason for this item in the menu other than to look pretty + if (secondLevelMenuItems.Count() == 0) { + continue; + } + sectionHeaderMarkup = HasText(itemId) ? new HtmlString(string.Format(@"{0}", Html.Encode(sectionHeaderText), Html.Encode(itemClassName), Html.Encode(itemId))) : new HtmlString(string.Format(@"{0}", Html.Encode(sectionHeaderText), Html.Encode(itemClassName)));