[ Index ] |
PHP Cross Reference of phpBB-3.2.11-deutsch |
[Summary view] [Print] [Text view]
1 {% use "form_div_layout.html.twig" %} 2 3 {# Widgets #} 4 5 {% block form_widget_simple -%} 6 {% if type is not defined or type not in ['file', 'hidden'] %} 7 {%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-control')|trim}) -%} 8 {% endif %} 9 {{- parent() -}} 10 {%- endblock form_widget_simple %} 11 12 {% block textarea_widget -%} 13 {% set attr = attr|merge({class: (attr.class|default('') ~ ' form-control')|trim}) %} 14 {{- parent() -}} 15 {%- endblock textarea_widget %} 16 17 {% block button_widget -%} 18 {% set attr = attr|merge({class: (attr.class|default('btn-default') ~ ' btn')|trim}) %} 19 {{- parent() -}} 20 {%- endblock %} 21 22 {% block money_widget -%} 23 {% set prepend = not (money_pattern starts with '{{') %} 24 {% set append = not (money_pattern ends with '}}') %} 25 {% if prepend or append %} 26 <div class="input-group"> 27 {% if prepend %} 28 <span class="input-group-addon">{{ money_pattern|form_encode_currency }}</span> 29 {% endif %} 30 {{- block('form_widget_simple') -}} 31 {% if append %} 32 <span class="input-group-addon">{{ money_pattern|form_encode_currency }}</span> 33 {% endif %} 34 </div> 35 {% else %} 36 {{- block('form_widget_simple') -}} 37 {% endif %} 38 {%- endblock money_widget %} 39 40 {% block percent_widget -%} 41 <div class="input-group"> 42 {{- block('form_widget_simple') -}} 43 <span class="input-group-addon">%</span> 44 </div> 45 {%- endblock percent_widget %} 46 47 {% block datetime_widget -%} 48 {% if widget == 'single_text' %} 49 {{- block('form_widget_simple') -}} 50 {% else -%} 51 {% set attr = attr|merge({class: (attr.class|default('') ~ ' form-inline')|trim}) -%} 52 <div {{ block('widget_container_attributes') }}> 53 {{- form_errors(form.date) -}} 54 {{- form_errors(form.time) -}} 55 {{- form_widget(form.date, { datetime: true } ) -}} 56 {{- form_widget(form.time, { datetime: true } ) -}} 57 </div> 58 {%- endif %} 59 {%- endblock datetime_widget %} 60 61 {% block date_widget -%} 62 {% if widget == 'single_text' %} 63 {{- block('form_widget_simple') -}} 64 {% else -%} 65 {% set attr = attr|merge({class: (attr.class|default('') ~ ' form-inline')|trim}) -%} 66 {% if datetime is not defined or not datetime -%} 67 <div {{ block('widget_container_attributes') -}}> 68 {%- endif %} 69 {{- date_pattern|replace({ 70 '{{ year }}': form_widget(form.year), 71 '{{ month }}': form_widget(form.month), 72 '{{ day }}': form_widget(form.day), 73 })|raw -}} 74 {% if datetime is not defined or not datetime -%} 75 </div> 76 {%- endif -%} 77 {% endif %} 78 {%- endblock date_widget %} 79 80 {% block time_widget -%} 81 {% if widget == 'single_text' %} 82 {{- block('form_widget_simple') -}} 83 {% else -%} 84 {% set attr = attr|merge({class: (attr.class|default('') ~ ' form-inline')|trim}) -%} 85 {% if datetime is not defined or false == datetime -%} 86 <div {{ block('widget_container_attributes') -}}> 87 {%- endif -%} 88 {{- form_widget(form.hour) }}{% if with_minutes %}:{{ form_widget(form.minute) }}{% endif %}{% if with_seconds %}:{{ form_widget(form.second) }}{% endif %} 89 {% if datetime is not defined or false == datetime -%} 90 </div> 91 {%- endif -%} 92 {% endif %} 93 {%- endblock time_widget %} 94 95 {% block choice_widget_collapsed -%} 96 {% set attr = attr|merge({class: (attr.class|default('') ~ ' form-control')|trim}) %} 97 {{- parent() -}} 98 {%- endblock %} 99 100 {% block choice_widget_expanded -%} 101 {% if '-inline' in label_attr.class|default('') -%} 102 {%- for child in form %} 103 {{- form_widget(child, { 104 parent_label_class: label_attr.class|default(''), 105 translation_domain: choice_translation_domain, 106 }) -}} 107 {% endfor -%} 108 {%- else -%} 109 <div {{ block('widget_container_attributes') }}> 110 {%- for child in form %} 111 {{- form_widget(child, { 112 parent_label_class: label_attr.class|default(''), 113 translation_domain: choice_translation_domain, 114 }) -}} 115 {% endfor -%} 116 </div> 117 {%- endif %} 118 {%- endblock choice_widget_expanded %} 119 120 {% block checkbox_widget -%} 121 {%- set parent_label_class = parent_label_class|default(label_attr.class|default('')) -%} 122 {% if 'checkbox-inline' in parent_label_class %} 123 {{- form_label(form, null, { widget: parent() }) -}} 124 {% else -%} 125 <div class="checkbox"> 126 {{- form_label(form, null, { widget: parent() }) -}} 127 </div> 128 {%- endif %} 129 {%- endblock checkbox_widget %} 130 131 {% block radio_widget -%} 132 {%- set parent_label_class = parent_label_class|default(label_attr.class|default('')) -%} 133 {% if 'radio-inline' in parent_label_class %} 134 {{- form_label(form, null, { widget: parent() }) -}} 135 {% else -%} 136 <div class="radio"> 137 {{- form_label(form, null, { widget: parent() }) -}} 138 </div> 139 {%- endif %} 140 {%- endblock radio_widget %} 141 142 {# Labels #} 143 144 {% block form_label -%} 145 {%- set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' control-label')|trim}) -%} 146 {{- parent() -}} 147 {%- endblock form_label %} 148 149 {% block choice_label -%} 150 {# remove the checkbox-inline and radio-inline class, it's only useful for embed labels #} 151 {%- set label_attr = label_attr|merge({class: label_attr.class|default('')|replace({'checkbox-inline': '', 'radio-inline': ''})|trim}) -%} 152 {{- block('form_label') -}} 153 {% endblock %} 154 155 {% block checkbox_label -%} 156 {%- set label_attr = label_attr|merge({'for': id}) -%} 157 158 {{- block('checkbox_radio_label') -}} 159 {%- endblock checkbox_label %} 160 161 {% block radio_label -%} 162 {%- set label_attr = label_attr|merge({'for': id}) -%} 163 164 {{- block('checkbox_radio_label') -}} 165 {%- endblock radio_label %} 166 167 {% block checkbox_radio_label %} 168 {# Do not display the label if widget is not defined in order to prevent double label rendering #} 169 {% if widget is defined %} 170 {% if required %} 171 {% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) %} 172 {% endif %} 173 {% if parent_label_class is defined %} 174 {% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ parent_label_class)|trim}) %} 175 {% endif %} 176 {% if label is not same as(false) and label is empty %} 177 {%- if label_format is not empty -%} 178 {% set label = label_format|replace({ 179 '%name%': name, 180 '%id%': id, 181 }) %} 182 {%- else -%} 183 {% set label = name|humanize %} 184 {%- endif -%} 185 {% endif %} 186 <label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}> 187 {{- widget|raw }} {{ label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans({}, translation_domain)) -}} 188 </label> 189 {% endif %} 190 {% endblock checkbox_radio_label %} 191 192 {# Rows #} 193 194 {% block form_row -%} 195 <div class="form-group{% if (not compound or force_error|default(false)) and not valid %} has-error{% endif %}"> 196 {{- form_label(form) -}} 197 {{- form_widget(form) -}} 198 {{- form_errors(form) -}} 199 </div> 200 {%- endblock form_row %} 201 202 {% block button_row -%} 203 <div class="form-group"> 204 {{- form_widget(form) -}} 205 </div> 206 {%- endblock button_row %} 207 208 {% block choice_row -%} 209 {% set force_error = true %} 210 {{- block('form_row') }} 211 {%- endblock choice_row %} 212 213 {% block date_row -%} 214 {% set force_error = true %} 215 {{- block('form_row') }} 216 {%- endblock date_row %} 217 218 {% block time_row -%} 219 {% set force_error = true %} 220 {{- block('form_row') }} 221 {%- endblock time_row %} 222 223 {% block datetime_row -%} 224 {% set force_error = true %} 225 {{- block('form_row') }} 226 {%- endblock datetime_row %} 227 228 {% block checkbox_row -%} 229 <div class="form-group{% if not valid %} has-error{% endif %}"> 230 {{- form_widget(form) -}} 231 {{- form_errors(form) -}} 232 </div> 233 {%- endblock checkbox_row %} 234 235 {% block radio_row -%} 236 <div class="form-group{% if not valid %} has-error{% endif %}"> 237 {{- form_widget(form) -}} 238 {{- form_errors(form) -}} 239 </div> 240 {%- endblock radio_row %} 241 242 {# Errors #} 243 244 {% block form_errors -%} 245 {% if errors|length > 0 -%} 246 {% if form is not rootform %}<span class="help-block">{% else %}<div class="alert alert-danger">{% endif %} 247 <ul class="list-unstyled"> 248 {%- for error in errors -%} 249 <li><span class="glyphicon glyphicon-exclamation-sign"></span> {{ error.message }}</li> 250 {%- endfor -%} 251 </ul> 252 {% if form is not rootform %}</span>{% else %}</div>{% endif %} 253 {%- endif %} 254 {%- endblock form_errors %}
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Nov 11 20:33:01 2020 | Cross-referenced by PHPXref 0.7.1 |