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
This commit is contained in:
Nathan Heskew
2011-03-29 14:33:18 -07:00
parent 2d2ff2d9a4
commit e1b24f8678

View File

@@ -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(@"<span class=""{1}"" id=""{2}"">{0}</span>", Html.Encode(sectionHeaderText), Html.Encode(itemClassName), Html.Encode(itemId)))
: new HtmlString(string.Format(@"<span class=""{1}"">{0}</span>", Html.Encode(sectionHeaderText), Html.Encode(itemClassName)));