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

pluginSettings.twig « templates « CoreAdminHome « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5c817d11f711a3a20cf9c3baa417df0b36a1be03 (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
{% extends 'admin.twig' %}

{% block content %}

<div id="pluginsSettings">
    {% import 'macros.twig' as piwik %}
    {% import 'ajaxMacros.twig' as ajax %}

    <p>
        {{ 'CoreAdminHome_PluginSettingsIntro'|translate }}
        {% for pluginName, settings in pluginSettings %}
            <a href="#{{ pluginName|e('html_attr') }}">{{ pluginName }}</a>{% if not loop.last %}, {% endif %}
        {% endfor %}
    </p>

    <input type="hidden" name="setpluginsettingsnonce" value="{{ nonce }}">

    {% for pluginName, settings in pluginSettings %}

        <h2 id="{{ pluginName|e('html_attr') }}">{{ pluginName }}</h2>

        {% if settings.getIntroduction %}
            <p class="pluginIntroduction">
                {{ settings.getIntroduction }}
            </p>
        {% endif %}

        <table class="adminTable" id="pluginSettings" data-pluginname="{{ pluginName|e('html_attr') }}">

        {% for name, setting in settings.getSettingsForCurrentUser %}
            {% set settingValue = setting.getValue %}

            {% if pluginName in firstSuperUserSettingNames|keys and name == firstSuperUserSettingNames[pluginName] %}
                <tr>
                    <td colspan="3">
                        <h3 class="superUserSettings">{{ 'MobileMessaging_Settings_SuperAdmin'|translate }}</h3>
                    </td>
                </tr>
            {% endif %}

            {% if setting.introduction %}
                <tr>
                    <td colspan="3">
                        <p class="settingIntroduction">
                            {{ setting.introduction }}
                        </p>
                    </td>
                </tr>
            {% endif %}

            <tr>
                <td class="columnTitle">
                    <span class="title">{{ setting.title }}</span>
                    <br />
                    <span class='form-description'>
                        {{ setting.description }}
                    </span>

                </td>
                <td class="columnField">
                    <fieldset>
                        <label>
                            {% if setting.uiControlType == 'select' or setting.uiControlType == 'multiselect' %}
                                <select
                                    {% for attr, val in setting.uiControlAttributes %}
                                        {{ attr|e('html_attr') }}="{{ val|e('html_attr') }}"
                                    {% endfor %}
                                    name="{{ setting.getKey|e('html_attr') }}"
                                    {% if setting.uiControlType == 'multiselect' %}multiple{% endif %}>

                                    {% for key, value in setting.availableValues %}
                                        <option value='{{ key }}'
                                                {% if settingValue is iterable and key in settingValue %}
                                                    selected='selected'
                                                {% elseif settingValue==key %}
                                                    selected='selected'
                                                {% endif %}>
                                            {{ value }}
                                        </option>
                                    {% endfor %}

                                </select>
                            {% elseif setting.uiControlType == 'textarea' %}
                                <textarea style="width: 176px;"
                                    {% for attr, val in setting.uiControlAttributes %}
                                        {{ attr|e('html_attr') }}="{{ val|e('html_attr') }}"
                                    {% endfor %}
                                    name="{{ setting.getKey|e('html_attr') }}"
                                    >
                                    {{- settingValue -}}
                                </textarea>
                            {% elseif setting.uiControlType == 'radio' %}

                                {% for key, value in setting.availableValues %}

                                    <input
                                        id="name-value-{{ loop.index }}"
                                        {% for attr, val in setting.uiControlAttributes %}
                                            {{ attr|e('html_attr') }}="{{ val|e('html_attr') }}"
                                        {% endfor %}
                                        {% if settingValue is sameas(key) %}
                                            checked="checked"
                                        {% endif %}
                                        type="radio"
                                        value="{{ key|e('html_attr') }}"
                                        name="{{ setting.getKey|e('html_attr') }}" />

                                    <label for="name-value-{{ loop.index }}">{{ value }}</label>

                                    <br />

                                {% endfor %}

                            {% else %}

                                <input
                                    {% for attr, val in setting.uiControlAttributes %}
                                        {{ attr|e('html_attr') }}="{{ val|e('html_attr') }}"
                                    {% endfor %}
                                    {% if setting.uiControlType == 'checkbox' %}
                                        value="1"
                                    {% endif %}
                                    {% if setting.uiControlType == 'checkbox' and settingValue %}
                                        checked="checked"
                                    {% endif %}
                                    type="{{ setting.uiControlType|e('html_attr') }}"
                                    name="{{ setting.getKey|e('html_attr') }}"
                                    value="{{ settingValue|e('html_attr') }}"
                                >

                            {% endif %}

                            {% if setting.defaultValue and setting.uiControlType != 'checkbox' %}
                                <br/>
                                <span class='form-description'>
                                    {{ 'General_Default'|translate }}
                                    {% if setting.defaultValue is iterable %}
                                        {{ setting.defaultValue|join(', ')|truncate(50) }}
                                    {% else %}
                                        {{ setting.defaultValue|truncate(50) }}
                                    {% endif %}
                                </span>
                            {% endif %}

                        </label>
                    </fieldset>
                </td>
                <td class="columnHelp">
                    {% if setting.inlineHelp %}
                        <div class="ui-widget">
                            <div class="ui-inline-help">
                                {{ setting.inlineHelp }}
                            </div>
                        </div>
                    {% endif %}
                </td>
            </tr>

        {% endfor %}

        </table>

    {% endfor %}

    <hr class="submitSeparator"/>

    {{ ajax.errorDiv('ajaxErrorPluginSettings') }}
    {{ ajax.loadingDiv('ajaxLoadingPluginSettings') }}

    <input type="submit" value="{{ 'General_Save'|translate }}" class="pluginsSettingsSubmit submit"/>

</div>
{% endblock %}