Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_topBarTopMenu.twig « templates « CoreHome « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f839e4223f3b0989268c8e3b03468007f57e328b (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<div id="topRightBar">
    {% for label,menu in topMenu %}
        {% if menu._html is defined %}
            {{ menu._html|raw }}
        {% elseif (menu._url.module == currentModule and (menu._url.action is empty or menu._url.action == currentAction)) %}
            <span class="topBarElem topBarElemActive"><strong>{{ label|translate }}</strong></span>
        {% else %}
            <span class="topBarElem" {% if menu._tooltip is defined %}title="{{ menu._tooltip }}"{% endif %}>
                <a id="topmenu-{{ menu._url.module|lower }}" href="index.php{{ menu._url|urlRewriteWithParameters }}">{{ label|translate }}</a>
            </span>
        {% endif %}
        |
    {% endfor %}

    {% set helloAlias %}
    {% if userAlias is not empty %}
        {{ userAlias|raw }}
    {% else %}
        {{ userLogin|raw }}
    {% endif %}
    {% endset %}

    {% macro userMenuItem(label, menu, currentModule, currentAction) %}

        <a class="item {% if (menu._url.module == currentModule and (menu._url.action is empty or menu._url.action == currentAction)) %}active{% endif %}"
           href="index.php{{ menu._url|urlRewriteWithParameters }}"
           id="usermenu-{{ menu._url.module|lower }}-{{ menu._url.action|default('index')|lower }}"
           {% if menu._tooltip is defined %}title="{{ menu._tooltip }}"{% endif %}
                >{{ label|translate }}</a>

    {% endmacro %}

    <span class="topBarElem">
        <div id="userMenu"
             tooltip="{{ 'General_HelloUser'|translate(helloAlias|trim)|rawSafeDecoded }}"
             menu-title="{{ helloAlias|trim }}"
             piwik-menudropdown>

            {% if userLogin != 'anonymous' %}
                {% if isAdminLayout is defined %}
                    <a class="item active">{{ 'General_Settings'|translate }}</a>
                {% else %}
                    <a class="item" href="index.php?module=CoreAdminHome">{{ 'General_Settings'|translate }}</a>
                {% endif %}
            {% endif %}

            {% for lev1UserLabel,lev1UserMenu in userMenu if lev1UserLabel|slice(0,1) != '_' %}

                {% if userLogin != 'anonymous' or not loop.first %}
                    <hr class="item separator"/>
                {% endif %}

                {% if lev1UserMenu._hasSubmenu is defined and lev1UserMenu._hasSubmenu %}
                    {% if lev1UserLabel %}
                        <a class="item disabled category">{{ lev1UserLabel|translate }}</a>
                    {% endif %}

                    {% for lev2Label,lev2Menu in lev1UserMenu if lev2Label|slice(0,1) != '_' %}
                        {{ _self.userMenuItem(lev2Label, lev2Menu, currentModule, currentAction) }}
                    {% endfor %}
                {% else %}
                    {{ _self.userMenuItem(lev1UserLabel, lev1UserMenu, currentModule, currentAction) }}
                {% endif %}

            {% endfor %}
        </div>
    </span>

    | <span class="topBarElem">
        {% if userLogin == 'anonymous' %}
            <a href='index.php?module={{ loginModule }}'>{{ 'Login_LogIn'|translate }}</a>
        {% else %}
            <a href='index.php?module={{ loginModule }}&amp;action=logout'>{{ 'General_Logout'|translate }}</a>
        {% endif %}
    </span>
</div>