mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-19 15:01:33 +02:00
[ticket/17100] Use twig functions for form elements
PHPBB3-17100
This commit is contained in:
26
phpBB/styles/all/template/macros/forms/select.twig
Normal file
26
phpBB/styles/all/template/macros/forms/select.twig
Normal file
@@ -0,0 +1,26 @@
|
||||
{% apply replace({"\n": ' ', "\t": ''}) %}
|
||||
<select
|
||||
{% if ID %}id="{{ ID }}" {% endif %}
|
||||
{% if CLASS %}class="{{ CLASS }}" {% endif %}
|
||||
name="{{ NAME }}"
|
||||
{% if TOGGLEABLE %}data-togglable-settings="true" {% endif %}
|
||||
{% if SIZE %}size="{{ SIZE }}" {% endif %}>
|
||||
{% endapply %}
|
||||
{% for element in OPTIONS %}
|
||||
{% if not GROUP_ONLY and element.options %}
|
||||
{% apply replace({"\n": ' ', '\t': ''}) %}
|
||||
<optgroup
|
||||
label="{{ element.label }}"
|
||||
{% for key, value in element.data %}
|
||||
data-{{ key }}="{{ value }}"
|
||||
{% endfor %}>
|
||||
{% endapply %}
|
||||
{% for option in element.options %}
|
||||
<option value="{{ option.value }}"{% if option.selected %} selected="selected"{% endif %}>{{ option.label }}</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
{% else %}
|
||||
<option value="{{ element.value }}"{% if element.selected %} selected="selected"{% endif %}>{{ element.label }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
Reference in New Issue
Block a user