1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

[ticket/17151] Adjust form macros to adhere to coding guidelines

PHPBB3-17151
This commit is contained in:
Marc Alexander
2023-06-25 16:23:56 +02:00
parent 51d27979ce
commit d6e3daf291
4 changed files with 21 additions and 17 deletions

View File

@@ -1,6 +1,10 @@
{% apply replace({"\n": ' ', "\t": ''}) %}
<input
{% if CLASS %}class="{{ CLASS }}" {% endif %}
{% if ID %}id="{{ ID }}" {% endif %}
{% for attribute, attribute_value in DATA %}
data-{{ attribute|e }}="{{ attribute_value|e('html_attr') }}"
{% endfor %}
type="{{ TYPE }}"
name="{{ NAME }}"
{% if SIZE %}size="{{ SIZE }}" {% endif %}
@@ -10,9 +14,5 @@
{% if STEP %}step="{{ STEP }}" {% endif %}
{% if TYPE == 'password' %}autocomplete="off" {% endif %}
{% if CHECKED %}checked="checked" {% endif %}
{% if CLASS %}class="{{ CLASS }}" {% endif %}
{% for attribute, attribute_value in DATA %}
data-{{ attribute|e }}="{{ attribute_value|e('html_attr') }}"
{% endfor %}
value="{{ VALUE }}">
{% endapply %}

View File

@@ -1,12 +1,13 @@
{% 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 ID %}id="{{ ID }}" {% endif %}
{% for attribute, attribute_value in DATA %}
data-{{ attribute|e }}="{{ attribute_value|e('html_attr') }}"
{% endfor %}
name="{{ NAME }}"
{% if TOGGLEABLE %}data-togglable-settings="true" {% endif %}
{% if MULTIPLE %}multiple="multiple" {% endif %}
{% if SIZE %}size="{{ SIZE }}" {% endif %}>
{% endapply %}
@@ -14,10 +15,10 @@
{% 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 %}>
{% endfor %}
label="{{ element.label }}">
{% endapply %}
{% for option in element.options %}
<option value="{{ option.value }}"{% if option.selected %} selected="selected"{% endif %}{% if option.disabled %} disabled="disabled" class="disabled-option"{% endif %}>{{ option.label }}</option>

View File

@@ -1,9 +1,10 @@
{% apply replace({"\n": ' ', '\t': ''}) %}
<textarea
{% if CLASS %}class="{{ CLASS }}" {% endif %}
id="{{ ID }}"
{% for attribute, attribute_value in DATA %}
data-{{ attribute|e }}="{{ attribute_value|e('html_attr') }}"
{% endfor %}
name="{{ NAME }}"
rows="{{ ROWS }}"
cols="{{ COLS }}">
{{ CONTENT }}
</textarea>
{% endapply %}
cols="{{ COLS }}">{% endapply %}{{ CONTENT }}</textarea>