Skip to content

Commit

Permalink
MAGETWO-37904: [GitHub] Admin menu with 1 submenu item does not show …
Browse files Browse the repository at this point in the history
…the subitem #1292

- fixes for sub items
  • Loading branch information
mazhalai committed Jun 2, 2015
1 parent d247738 commit f382e08
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions app/code/Magento/Backend/Block/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -455,28 +455,14 @@ public function renderNavigation($menu, $level = 0, $limit = 0, $colBrakes = [])
}

$id = $this->getJsId($menuItem->getId());
if (count($menu) > 0 || $level != 1) {
$output .= '<li ' . $this->getUiId(
$menuItem->getId()
) . ' class="item-' . $itemClass . ' ' . $this->_renderItemCssClass(
$menuItem,
$level
) . ($level == 0 ? '" id="' . $id . '" aria-haspopup="true' : '')
. '" role="menu-item">' . $this->_renderAnchor(
$menuItem,
$level
) . $this->_addSubMenu(
$menuItem,
$level,
$limit,
$id
) . '</li>';
$subMenu = $this->_addSubMenu($menuItem, $level, $limit, $id);
if ((count($menu) > 1 || $level != 1) || ((count($menu) === 1) && ($menuItem->getUrl() !== '#') )) {
$output .= '<li ' . $this->getUiId($menuItem->getId())
. ' class="item-' . $itemClass . ' ' . $this->_renderItemCssClass($menuItem, $level)
. ($level == 0 ? '" id="' . $id . '" aria-haspopup="true' : '')
. '" role="menu-item">' . $this->_renderAnchor($menuItem, $level) . $subMenu . '</li>';
} else {
$output .= $this->_addSubMenu(
$menuItem,
$level,
$limit,
$id);
$output .= $subMenu;
}

$itemPosition++;
Expand Down

0 comments on commit f382e08

Please sign in to comment.