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: f6d724b418c5107fb3a0a1d87afb2d1f4f2d646a (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
{% extends 'admin.twig' %}

{% block content %}

    {% import 'macros.twig' as piwik %}
    {% import 'ajaxMacros.twig' as ajax %}

    <p>
        Here you can change the settings for the following 3rd party plugins:
        {% 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" style='width:820px;' id="pluginSettings" data-pluginname="{{ pluginName|e('html_attr') }}">

        {% for setting in settings.getSettingsForCurrentUser %}
            {% set settingValue = settings.getSettingValue(setting) %}

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

            <tr>
                <td style='width:400px'>
                    {{ setting.title }}
                    <br />
                    <span class='form-description'>
                        {{ setting.description }}
                    </span>

                </td>
                <td style='width:220px'>
                    <fieldset>
                        <label>
                            {% if setting.field == 'select' or setting.field == 'multiselect' %}
                                <select
                                    {% for attr, val in setting.fieldAttributes %}
                                        {{ attr|e('html_attr') }}="{{ val|e('html_attr') }}"
                                    {% endfor %}
                                    name="{{ setting.getKey|e('html_attr') }}"
                                    {% if setting.field == 'multiselect' %}multiple{% endif %}>

                                    {% for key, value in setting.fieldOptions %}
                                        <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.field == 'textarea' %}
                                <textarea style="width: 176px;"
                                    {% for attr, val in setting.fieldAttributes %}
                                        {{ attr|e('html_attr') }}="{{ val|e('html_attr') }}"
                                    {% endfor %}
                                    name="{{ setting.getKey|e('html_attr') }}"
                                    >
                                    {{- settingValue -}}
                                </textarea>
                            {% else %}

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

                            {% endif %}

                            {% if setting.defaultValue and setting.field != '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 style="width:200px">
                    {% if setting.inlineHelp %}
                        <div class="ui-widget">
                            <div class="ui-inline-help ui-state-highlight ui-corner-all">
                                <span class="ui-icon ui-icon-info" style="float:left;margin-right:.3em;"></span>
                                {{ setting.inlineHelp }}
                            </div>
                        </div>
                    {% endif %}
                </td>
            </tr>

        {% endfor %}

        </table>

    {% endfor %}

    <hr style="background-color: #DADADA;height: 1px;border: 0px;"/>

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

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

{% endblock %}