blob: e69e9c1978b840c8b8fb669d1a3ba601693f1350 (
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, userMenu) }}
<ul 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 }}">{{ _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>{{ _self.topMenuItem(label, menu, topMenuModule, topMenuAction) }}</li>
{% endfor %}
{% endspaceless %}
</ul>
|