blob: 09b42c03b772ffc1334f20fbef7b32c89739cf60 (
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
|
{% if option_is_disabled %}
{% set tr_class = tr_class ~ ' disabled-field' %}
{% endif %}
<tr{% if tr_class %} class="{{ tr_class }}"{% endif %}>
<th>
<label for="{{ path }}">{{ name|raw }}</label>
{% if doc is not empty %}
<span class="doc">
<a href="{{ doc }}" target="documentation">{{- get_image('b_help', 'Documentation'|trans) -}}</a>
</span>
{% endif %}
{% if option_is_disabled %}
<span class="disabled-notice" title="{% trans 'This setting is disabled, it will not be applied to your configuration.' %}">
{% trans 'Disabled' %}
</span>
{% endif %}
{% if description is not empty %}
<small>{{ description|raw }}</small>
{% endif %}
</th>
<td>
{% if type == 'text' %}
<input type="text" name="{{ path }}" id="{{ path }}" value="{{ value }}" class="w-75{{ not value_is_default ? (has_errors ? ' custom field-error' : ' custom') }}">
{% elseif type == 'password' %}
<input type="password" name="{{ path }}" id="{{ path }}" value="{{ value }}" class="w-75{{ not value_is_default ? (has_errors ? ' custom field-error' : ' custom') }}">
{% elseif type == 'short_text' and value is not iterable %}
{# https://github.com/phpmyadmin/phpmyadmin/issues/11505 #}
<input type="text" size="25" name="{{ path }}" id="{{ path }}" value="{{ value }}" class="{{ not value_is_default ? (has_errors ? 'custom field-error' : 'custom') }}">
{% elseif type == 'number_text' %}
<input type="number" name="{{ path }}" id="{{ path }}" value="{{ value }}" class="{{ not value_is_default ? (has_errors ? 'custom field-error' : 'custom') }}">
{% elseif type == 'checkbox' %}
<span class="checkbox{{ not value_is_default ? (has_errors ? ' custom field-error' : ' custom') }}">
<input type="checkbox" name="{{ path }}" id="{{ path }}"{{ value ? ' checked' }}>
</span>
{% elseif type == 'select' %}
<select name="{{ path }}" id="{{ path }}" class="w-75{{ not value_is_default ? (has_errors ? ' custom field-error' : ' custom') }}">
{% for key, val in select_values %}
{% if val is same as(true) %}{% set val = 'Yes'|trans %}{% elseif val is same as(false) %}{% set val = 'No'|trans %}{% endif %}
<option value="{{ key }}"{{ key is same as(value) or (value is same as(true) and key is same as(1)) or (value is same as(false) and key is same as(0)) ? ' selected' }}{{ key in select_values_disabled ? ' disabled' }}>{{ val }}</option>
{% endfor %}
</select>
{% elseif type == 'list' %}
<textarea cols="35" rows="5" name="{{ path }}" id="{{ path }}" class="{{ not value_is_default ? (has_errors ? 'custom field-error' : 'custom') }}">
{%- for key, val in value %}{% if key != 'wrapper_params' %}{{ val }}{{ not loop.last ? "\n" }}{% endif %}{% endfor -%}
</textarea>
{% endif %}
{% if is_setup and comment %}
<a class="userprefs-comment" title="{{ comment }}">{{ get_image('b_tblops', 'Comment'|trans) }}</a>
{% endif %}
{% if set_value %}
<a class="set-value hide" href="#{{ path }}={{ set_value }}" title="{{ 'Set value: %s'|trans|format(set_value) }}">
{{- get_image('b_edit', 'Set value: %s'|trans|format(set_value)) -}}
</a>
{% endif %}
{% if show_restore_default %}
<a class="restore-default hide" href="#{{ path }}" title="{% trans 'Restore default value' %}">
{{- get_image('s_reload', 'Restore default value'|trans) -}}
</a>
{% endif %}
{# This must match with displayErrors() in scripts/config.js. #}
{% if has_errors %}
<dl class="inline_errors">
{% for error in errors %}
<dd>{{ error|raw }}</dd>
{% endfor %}
</dl>
{% endif %}
</td>
{% if is_setup and allows_customization is not null %}
<td class="userprefs-allow" title="{% trans 'Allow users to customize this value' %}">
<input type="checkbox" name="{{ path }}-userprefs-allow"{{ allows_customization ? ' checked' }} aria-label="{% trans 'Allow users to customize this value' %}">
</td>
{% elseif is_setup %}
<td> </td>
{% endif %}
</tr>
|