diff --git a/application/menunode.class.inc.php b/application/menunode.class.inc.php index b4db18ae0..1ac728074 100644 --- a/application/menunode.class.inc.php +++ b/application/menunode.class.inc.php @@ -291,7 +291,17 @@ class ApplicationMenu * @param string $sMenuGroupIdx * @param array $aExtraParams * - * @return array + * @return array { + * array { + * sId: string, + * sTitle: string, + * sLabel: string, + * bHasCount: bolean, + * sUrl: string url + * bOpenInNewWindow: bolean + * aSubMenuNodes: same structure recursively + * } + * } $aSubMenuNodes * @throws \DictExceptionMissingString * @throws \Exception * @since 3.0.0 @@ -320,12 +330,13 @@ class ApplicationMenu } $aSubMenuNodes[] = [ - 'sId' => $oSubMenuNode->GetMenuId(), - 'sTitle' => $oSubMenuNode->GetTitle(), - 'bHasCount' => $oSubMenuNode->HasCount(), - 'sUrl' => $oSubMenuNode->GetHyperlink($aExtraParams), + 'sId' => $oSubMenuNode->GetMenuId(), + 'sTitle' => $oSubMenuNode->GetTitle(), + 'sLabel' => $oSubMenuNode->GetLabel(), + 'bHasCount' => $oSubMenuNode->HasCount(), + 'sUrl' => $oSubMenuNode->GetHyperlink($aExtraParams), 'bOpenInNewWindow' => $oSubMenuNode->IsHyperLinkInNewWindow(), - 'aSubMenuNodes' => static::GetSubMenuNodes($sSubMenuItemIdx, $aExtraParams), + 'aSubMenuNodes' => static::GetSubMenuNodes($sSubMenuItemIdx, $aExtraParams), ]; } @@ -746,7 +757,7 @@ abstract class MenuNode } /** - * @return string + * @return string The "+" dictionary entry for this menu if exists, otherwise the Title (if we have a parent title, will output parentTitle / currentTitle) */ public function GetLabel() { @@ -758,7 +769,6 @@ abstract class MenuNode } else { $sRet = $this->GetTitle(); } - //$sRet = $this->GetTitle(); } return $sRet; } diff --git a/templates/base/layouts/navigation-menu/menu-node.html.twig b/templates/base/layouts/navigation-menu/menu-node.html.twig index a998e47ef..482fa16e0 100644 --- a/templates/base/layouts/navigation-menu/menu-node.html.twig +++ b/templates/base/layouts/navigation-menu/menu-node.html.twig @@ -2,7 +2,7 @@ {% if aMenuNode.sUrl is not empty %} {% set sTarget = (aMenuNode.bOpenInNewWindow == true) ? 'target="_blank"' : '' %} - {{ aMenuNode.sTitle }} + {{ aMenuNode.sTitle }} {% if aMenuNode.bHasCount %} {# Counters will be shown once the background update is done (see JS widget) #} @@ -10,7 +10,7 @@ {% else %} - {{ aMenuNode.sTitle }} + {{ aMenuNode.sTitle }} {% endif %} {% if aMenuNode.aSubMenuNodes is defined and aMenuNode.aSubMenuNodes|length > 0 %} @@ -20,4 +20,4 @@ {% endfor %} {% endif %} - \ No newline at end of file +