blob: 1d45c7282e35393683b2a3e1835944b86e3330ba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
{{ postEvent("Template.beforeTopBar", userAlias, userLogin, topMenu) }}
<ul role="menubar" class="navbar-right">
{% macro menuItemLabel(label, icon) %}
{% if icon is defined and icon and icon starts with 'icon-' %}
<span class="{{ icon|striptags }}"></span>
{% else %}
{{ label|translate }}
{% endif %}
{% endmacro %}
{% macro topMenuItem(label, menu, currentModule, currentAction) %}
{% if menu._html is defined %}
{{ menu._html|raw }}
{% else %}
<a {% if menu._tooltip is defined %}title="{{ menu._tooltip }}"{% endif %}
class="topBarElem {% if (menu._url.module == currentModule and (menu._url.action is empty or menu._url.action == currentAction)) %}active{% endif %}"
id="topmenu-{{ menu._url.module|lower }}"
href="index.php{{ menu._url|urlRewriteWithParameters }}" tabindex="3">{{ _self.menuItemLabel(label, menu._icon) }}</a>
{% endif %}
{% endmacro %}
{% if topMenuModule is not defined %}
{% set topMenuModule = currentModule %}
{% set topMenuAction = currentAction %}
{% endif %}
{% spaceless %}
{% for label,menu in topMenu %}
<li role="menuitem">{{ _self.topMenuItem(label, menu, topMenuModule, topMenuAction) }}</li>
{% endfor %}
{% endspaceless %}
</ul>
|