N°4852 - Navigation menu: Display "+" dict entries as a tooltip on sub-nodes (#380)

This commit is contained in:
Vincent Dumas
2022-12-23 15:48:52 +01:00
committed by GitHub
parent 9df9077595
commit 48645dd519
2 changed files with 21 additions and 11 deletions

View File

@@ -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;
}

View File

@@ -2,7 +2,7 @@
{% if aMenuNode.sUrl is not empty %}
{% set sTarget = (aMenuNode.bOpenInNewWindow == true) ? 'target="_blank"' : '' %}
<a class="ibo-navigation-menu--menu-node-title" data-role="ibo-navigation-menu--menu-node-title" href="{{ aMenuNode.sUrl }}" {{ sTarget|raw }}>
<span class="ibo-navigation-menu--menu-node-label" data-role="ibo-navigation-menu--menu-node-label" title="{{ aMenuNode.sTitle }}">{{ aMenuNode.sTitle }}</span>
<span class="ibo-navigation-menu--menu-node-label" data-role="ibo-navigation-menu--menu-node-label" title="{{ aMenuNode.sLabel }}">{{ aMenuNode.sTitle }}</span>
{% if aMenuNode.bHasCount %}
{# Counters will be shown once the background update is done (see JS widget) #}
<span class="ibo-navigation-menu--menu-node-counter ibo-is-hidden" data-menu-id="{{ aMenuNode.sId }}"></span>
@@ -10,7 +10,7 @@
</a>
{% else %}
<span class="ibo-navigation-menu--menu-node-title" data-role="ibo-navigation-menu--menu-node-title">
<span class="ibo-navigation-menu--menu-node-label" data-role="ibo-navigation-menu--menu-node-label" title="{{ aMenuNode.sTitle }}">{{ aMenuNode.sTitle }}</span>
<span class="ibo-navigation-menu--menu-node-label" data-role="ibo-navigation-menu--menu-node-label" title="{{ aMenuNode.sLabel }}">{{ aMenuNode.sTitle }}</span>
</span>
{% endif %}
{% if aMenuNode.aSubMenuNodes is defined and aMenuNode.aSubMenuNodes|length > 0 %}
@@ -20,4 +20,4 @@
{% endfor %}
</ul>
{% endif %}
</li>
</li>