PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 4.05.02
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v4.05.02
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / views / frm-fields / back-end / settings.php

settings.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 4.05.02, at classes/views/frm-fields/back-end/settings.php

383 lines 18.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <div class="frm-single-settings frm_hidden frm-fields frm-type-<?php echo esc_attr( $field['type'] ); ?>" id="frm-single-settings-<?php echo esc_attr( $field['id'] ); ?>" data-fid="<?php echo esc_attr( $field['id'] ); ?>">
2 <input type="hidden" name="frm_fields_submitted[]" value="<?php echo esc_attr( $field['id'] ); ?>" />
3 <input type="hidden" name="field_options[field_order_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['field_order'] ); ?>"/>
4
5 <div class="frm-sub-label alignright">
6 (ID <?php echo esc_html( $field['id'] ); ?>)
7 </div>
8 <h3>
9 <?php
10 printf(
11 /* translators: %s: Field type */
12 esc_html__( '%s Field', 'formidable' ),
13 esc_html( $type_name )
14 );
15 ?>
16 </h3>
17
18 <div class="frm_grid_container frm-collapse-me">
19 <?php if ( $display['label'] ) { ?>
20 <p>
21 <label for="frm_name_<?php echo esc_attr( $field['id'] ); ?>">
22 <?php echo esc_html( apply_filters( 'frm_builder_field_label', __( 'Field Label', 'formidable' ), $field ) ); ?>
23 </label>
24 <input type="text" name="field_options[name_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['name'] ); ?>" id="frm_name_<?php echo esc_attr( $field['id'] ); ?>" data-changeme="field_label_<?php echo esc_attr( $field['id'] ); ?>" />
25 </p>
26 <?php } else { ?>
27 <input type="hidden" name="field_options[name_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['name'] ); ?>" id="frm_name_<?php echo esc_attr( $field['id'] ); ?>" />
28 <?php } ?>
29
30 <p class="frm-hide-empty">
31 <?php if ( $display['required'] ) { ?>
32 <label for="frm_req_field_<?php echo esc_attr( $field['id'] ); ?>" class="frm_inline_label">
33 <input type="checkbox" id="frm_req_field_<?php echo esc_attr( $field['id'] ); ?>" class="frm_req_field" name="field_options[required_<?php echo esc_attr( $field['id'] ); ?>]" value="1" <?php checked( $field['required'], 1 ); ?> />
34 <?php esc_html_e( 'Required', 'formidable' ); ?>
35 </label>
36 <?php
37 }
38
39 if ( $display['unique'] ) {
40 ?>
41 <label for="frm_uniq_field_<?php echo esc_attr( $field['id'] ); ?>" class="frm_inline_label frm_help" title="<?php esc_attr_e( 'Unique: Do not allow the same response multiple times. For example, if one user enters \'Joe\', then no one else will be allowed to enter the same name.', 'formidable' ); ?>"><input type="checkbox" name="field_options[unique_<?php echo esc_attr( $field['id'] ); ?>]" id="frm_uniq_field_<?php echo esc_attr( $field['id'] ); ?>" value="1" <?php checked( $field['unique'], 1 ); ?> class="frm_mark_unique" />
42 <?php esc_html_e( 'Unique', 'formidable' ); ?>
43 </label>
44 <?php
45 }
46
47 if ( $display['read_only'] ) {
48 ?>
49 <label for="frm_read_only_field_<?php echo esc_attr( $field['id'] ); ?>" class="frm_inline_label frm_help" title="<?php esc_attr_e( 'Read Only: Show this field but do not allow the field value to be edited from the front-end.', 'formidable' ); ?>" >
50 <input type="checkbox" id="frm_read_only_field_<?php echo esc_attr( $field['id'] ); ?>" name="field_options[read_only_<?php echo esc_attr( $field['id'] ); ?>]" value="1" <?php checked( $field['read_only'], 1 ); ?>/>
51 <?php esc_html_e( 'Read Only', 'formidable' ); ?>
52 </label>
53 <?php
54 }
55
56 do_action( 'frm_field_options_form_top', $field, $display, $values );
57 ?>
58 </p>
59
60 <?php
61 if ( $display['range'] ) {
62 include( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/number-range.php' );
63 }
64
65 $field_obj->show_primary_options( compact( 'field', 'display', 'values' ) );
66
67 ?>
68
69 <?php if ( $display['css'] ) { ?>
70 <p class="frm-has-modal">
71 <label for="frm_classes_<?php echo esc_attr( $field['id'] ); ?>" class="frm_help" title="<?php esc_attr_e( 'Add a CSS class to the field container. Use our predefined classes to align multiple fields in single row.', 'formidable' ); ?>">
72 <?php esc_html_e( 'CSS Layout Classes', 'formidable' ); ?>
73 </label>
74 <span class="frm-with-right-icon">
75 <?php
76 FrmAppHelper::icon_by_class(
77 'frm_icon_font frm_more_horiz_solid_icon frm-show-inline-modal',
78 array(
79 'data-open' => 'frm-layout-classes-box',
80 'title' => esc_attr__( 'Toggle Options', 'formidable' ),
81 )
82 );
83 ?>
84 <input type="text" name="field_options[classes_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['classes'] ); ?>" class="frm_classes" id="frm_classes_<?php echo esc_attr( $field['id'] ); ?>" data-changeme="frm_field_id_<?php echo esc_attr( $field['id'] ); ?>" data-changeatt="class" data-sep=" " data-shortcode="0" />
85 </span>
86 </p>
87 <?php } ?>
88 </div>
89
90 <?php
91
92 $field_obj->show_field_choices( compact( 'field', 'display', 'values' ) );
93
94 if ( $display['clear_on_focus'] ) {
95 do_action( 'frm_extra_field_display_options', $field );
96 }
97
98 do_action( 'frm_before_field_options', $field );
99
100 ?>
101
102 <h3 class="frm-collapsed">
103 <?php esc_html_e( 'Advanced', 'formidable' ); ?>
104 <i class="frm_icon_font frm_arrowdown6_icon"></i>
105 </h3>
106 <div class="frm_grid_container frm-collapse-me">
107
108 <?php if ( $display['default'] ) { ?>
109 <div class="frm-has-modal">
110 <?php if ( count( $default_value_types ) > 1 ) { ?>
111 <span class="frm-default-switcher">
112 <?php foreach ( $default_value_types as $def_name => $link ) { ?>
113 <a href="#" title="<?php echo esc_attr( $link['title'] ); ?>" class="<?php echo esc_attr( $link['class'] ); ?>" data-toggleclass="frm_hidden frm-open"
114 <?php foreach ( $link['data'] as $data_key => $data_value ) { ?>
115 data-<?php echo esc_attr( $data_key ); ?>="<?php echo esc_attr( $data_value . ( substr( $data_value, -1 ) === '-' ? $field['id'] : '' ) ); ?>"
116 <?php } ?>
117 <?php if ( isset( $link['data']['frmshow'] ) ) { ?>
118 data-frmhide=".frm-inline-modal,.default-value-section-<?php echo esc_attr( $field['id'] ); ?>"
119 <?php } ?>
120 >
121 <?php FrmAppHelper::icon_by_class( $link['icon'] ); ?>
122 </a>
123 <?php } ?>
124 </span>
125 <?php } ?>
126
127 <p class="frm-has-modal default-value-section-<?php echo esc_attr( $field['id'] . ( isset( $default_value_types['default_value']['current'] ) ? '' : ' frm_hidden' ) ); ?>" id="default-value-for-<?php echo esc_attr( $field['id'] ); ?>">
128 <label for="frm_default_value_<?php echo esc_attr( $field['id'] ); ?>">
129 <?php esc_html_e( 'Default Value', 'formidable' ); ?>
130 </label>
131 <span class="frm-with-right-icon">
132 <?php
133 $special_default = ( isset( $field['post_field'] ) && $field['post_field'] === 'post_category' ) || $field['type'] === 'data';
134 FrmAppHelper::icon_by_class(
135 'frm_icon_font frm_more_horiz_solid_icon frm-show-inline-modal',
136 array(
137 'data-open' => $special_default ? 'frm-tax-box-' . $field['id'] : 'frm-smart-values-box',
138 'title' => esc_attr__( 'Toggle Options', 'formidable' ),
139 )
140 );
141 unset( $special_default );
142
143 if ( isset( $display['default_value'] ) && $display['default_value'] ) {
144 $default_name = 'field_options[dyn_default_value_' . $field['id'] . ']';
145 $default_value = isset( $field['dyn_default_value'] ) ? $field['dyn_default_value'] : '';
146 } else {
147 $default_name = 'default_value_' . $field['id'];
148 $default_value = $field['default_value'];
149 }
150 $field_obj->default_value_to_string( $default_value );
151
152 if ( $display['type'] === 'textarea' || $display['type'] === 'rte' ) {
153 ?>
154 <textarea name="<?php echo esc_attr( $default_name ); ?>" class="default-value-field" id="frm_default_value_<?php echo esc_attr( $field['id'] ); ?>" rows="3" data-changeme="field_<?php echo esc_attr( $field['field_key'] ); ?>"><?php
155 echo FrmAppHelper::esc_textarea( $default_value ); // WPCS: XSS ok.
156 ?></textarea>
157 <?php
158 } else {
159 ?>
160 <input type="text" name="<?php echo esc_attr( $default_name ); ?>" value="<?php echo esc_attr( $default_value ); ?>" id="frm_default_value_<?php echo esc_attr( $field['id'] ); ?>" class="default-value-field" data-changeme="field_<?php echo esc_attr( $field['field_key'] ); ?>" data-changeatt="value" data-sep="<?php echo esc_attr( $field_obj->displayed_field_type( $field ) ? ',' : '' ); ?>" />
161 <?php
162 }
163 ?>
164 </span>
165 </p>
166 <?php do_action( 'frm_default_value_setting', compact( 'field', 'display', 'default_value_types' ) ); ?>
167 </div>
168 <?php } ?>
169
170 <?php $field_obj->show_after_default( compact( 'field', 'display' ) ); ?>
171
172 <?php if ( $display['clear_on_focus'] ) { ?>
173 <p>
174 <label for="frm_placeholder_<?php echo esc_attr( $field['id'] ); ?>">
175 <?php esc_html_e( 'Placeholder Text', 'formidable' ); ?>
176 </label>
177 <?php
178 if ( $display['type'] === 'textarea' || $display['type'] === 'rte' ) {
179 ?>
180 <textarea name="field_options[placeholder_<?php echo esc_attr( $field['id'] ); ?>]" id="frm_placeholder_<?php echo esc_attr( $field['id'] ); ?>" rows="3" data-changeme="field_<?php echo esc_attr( $field['field_key'] ); ?>" data-changeatt="placeholder"><?php
181 echo FrmAppHelper::esc_textarea( $field['placeholder'] ); // WPCS: XSS ok.
182 ?></textarea>
183 <?php
184 } else {
185 ?>
186 <input type="text" name="field_options[placeholder_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['placeholder'] ); ?>" id="frm_placeholder_<?php echo esc_attr( $field['id'] ); ?>" data-changeme="field_<?php echo esc_attr( $field['field_key'] ); ?>" data-changeatt="placeholder" />
187 <?php
188 }
189 ?>
190 </p>
191 <?php } ?>
192
193 <?php
194 if ( $display['description'] ) {
195 include( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/field-description.php' );
196 }
197
198 // Field Size
199 if ( $display['size'] && ! in_array( $field['type'], array( 'select', 'data', 'time' ) ) ) {
200 $display_max = $display['max'];
201 include( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/pixels-wide.php' );
202 }
203 ?>
204
205 <?php if ( $display['show_image'] ) { ?>
206 <p>
207 <label for="frm_show_image_<?php echo esc_attr( $field['id'] ); ?>">
208 <input type="checkbox" id="frm_show_image_<?php echo esc_attr( $field['id'] ); ?>" name="field_options[show_image_<?php echo esc_attr( $field['id'] ); ?>]" value="1" <?php checked( $field['show_image'], 1 ); ?> />
209 <?php esc_html_e( 'If this URL points to an image, show to image on the entries listing page.', 'formidable' ); ?>
210 </label>
211 </p>
212 <?php } ?>
213
214 <?php if ( $display['captcha_size'] && $frm_settings->re_type !== 'invisible' ) { ?>
215 <p class="frm6 frm_first frm_form_field">
216 <label for="field_options_captcha_size_<?php echo esc_attr( $field['id'] ); ?>" class="frm_help" title="<?php esc_attr_e( 'Set the size of the captcha field. The compact option is best if your form is in a small area.', 'formidable' ); ?>">
217 <?php esc_html_e( 'ReCaptcha Type', 'formidable' ); ?>
218 </label>
219 <select name="field_options[captcha_size_<?php echo esc_attr( $field['id'] ); ?>]" id="field_options_captcha_size_<?php echo esc_attr( $field['id'] ); ?>">
220 <option value="normal" <?php selected( $field['captcha_size'], 'normal' ); ?>>
221 <?php esc_html_e( 'Normal', 'formidable' ); ?>
222 </option>
223 <option value="compact" <?php selected( $field['captcha_size'], 'compact' ); ?>>
224 <?php esc_html_e( 'Compact', 'formidable' ); ?>
225 </option>
226 </select>
227 </p>
228 <p class="frm6 frm_form_field">
229 <label for="captcha_theme_<?php echo esc_attr( $field['field_key'] ); ?>">
230 <?php esc_html_e( 'reCAPTCHA Color', 'formidable' ); ?>
231 </label>
232 <select name="field_options[captcha_theme_<?php echo esc_attr( $field['id'] ); ?>]" id="captcha_theme_<?php echo esc_attr( $field['field_key'] ); ?>">
233 <option value="light" <?php selected( $field['captcha_theme'], 'light' ); ?>>
234 <?php esc_html_e( 'Light', 'formidable' ); ?>
235 </option>
236 <option value="dark" <?php selected( $field['captcha_theme'], 'dark' ); ?>>
237 <?php esc_html_e( 'Dark', 'formidable' ); ?>
238 </option>
239 </select>
240 </p>
241 <?php } ?>
242
243 <?php
244 if ( $display['format'] ) {
245 FrmFieldsController::show_format_option( $field );
246 }
247 ?>
248
249 <?php do_action( 'frm_field_options', compact( 'field', 'display', 'values' ) ); ?>
250
251 <?php if ( $display['required'] ) { ?>
252 <p class="frm6 frm_form_field frm_required_details<?php echo esc_attr( $field['id'] . ( $field['required'] ? '' : ' frm_hidden' ) ); ?>">
253 <label>
254 <?php esc_html_e( 'Required Field Indicator', 'formidable' ); ?>
255 </label>
256 <input type="text" name="field_options[required_indicator_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['required_indicator'] ); ?>" />
257 </p>
258 <?php } ?>
259
260 <?php if ( $display['label_position'] ) { ?>
261 <p class="frm6 frm_form_field">
262 <label><?php esc_html_e( 'Label Position', 'formidable' ); ?></label>
263 <select name="field_options[label_<?php echo esc_attr( $field['id'] ); ?>]">
264 <option value="" <?php selected( $field['label'], '' ); ?>>
265 <?php esc_html_e( 'Default', 'formidable' ); ?>
266 </option>
267 <?php
268 foreach ( FrmStylesHelper::get_single_label_positions() as $pos => $pos_label ) {
269 if ( ! $display['clear_on_focus'] && 'inside' === $pos ) {
270 // Don't allow inside labels for fields without placeholders.
271 continue;
272 }
273 ?>
274 <option value="<?php echo esc_attr( $pos ); ?>"<?php selected( $field['label'], $pos ); ?>>
275 <?php echo esc_html( $pos_label ); ?>
276 </option>
277 <?php } ?>
278 <?php if ( $field['type'] === 'divider' ) { ?>
279 <option value="center" <?php selected( $field['label'], 'center' ); ?>>
280 <?php esc_html_e( 'Center', 'formidable' ); ?>
281 </option>
282 <?php } ?>
283 </select>
284 </p>
285 <?php } ?>
286
287 <p class="frm6 frm_form_field">
288 <label for="field_options_field_key_<?php echo esc_attr( $field['id'] ); ?>" class="frm_help" title="<?php esc_attr_e( 'The field key can be used as an alternative to the field ID in many cases.', 'formidable' ); ?>">
289 <?php esc_html_e( 'Field Key', 'formidable' ); ?>
290 </label>
291 <input type="text" name="field_options[field_key_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['field_key'] ); ?>" id="field_options_field_key_<?php echo esc_attr( $field['id'] ); ?>"/>
292 </p>
293
294 <?php if ( count( $field_types ) > 1 ) { ?>
295 <p class="frm6 frm_form_field">
296 <label for="field_options_type_<?php echo esc_attr( $field['id'] ); ?>">
297 <?php esc_html_e( 'Field Type', 'formidable' ); ?>
298 </label>
299 <select name="field_options[type_<?php echo esc_attr( $field['id'] ); ?>]" id="field_options_type_<?php echo esc_attr( $field['id'] ); ?>">
300 <?php foreach ( $field_types as $fkey => $ftype ) { ?>
301 <option value="<?php echo esc_attr( $fkey ); ?>" <?php echo ( $fkey === $field['type'] ) ? ' selected="selected"' : ''; ?> <?php echo array_key_exists( $fkey, $disabled_fields ) ? 'disabled="disabled"' : ''; ?>>
302 <?php echo esc_html( is_array( $ftype ) ? $ftype['name'] : $ftype ); ?>
303 </option>
304 <?php
305 unset( $fkey, $ftype );
306 }
307 ?>
308 </select>
309 </p>
310 <?php } else { ?>
311 <input type="hidden" id="field_options_type_<?php echo esc_attr( $field['id'] ); ?>" value="<?php echo esc_attr( $field['type'] ); ?>" />
312 <?php } ?>
313
314 <table class="form-table frm_no_top_margin">
315 <?php $field_obj->show_options( $field, $display, $values ); ?>
316 <?php do_action( 'frm_field_options_form', $field, $display, $values ); ?>
317 </table>
318 </div>
319
320 <?php if ( $display['required'] || $display['invalid'] || $display['unique'] || $display['conf_field'] ) { ?>
321 <?php
322 $hidden_invalid = FrmField::is_field_type( $field, 'text' ) && ! FrmField::is_option_true( $field, 'format' );
323 $has_validation = ( ( $display['invalid'] && ! $hidden_invalid ) || $field['required'] || FrmField::is_option_true( $field, 'unique' ) || FrmField::is_option_true( $field, 'conf_field' ) );
324 ?>
325 <div class="frm_validation_msg <?php echo esc_attr( $has_validation ? '' : 'frm_hidden' ); ?>">
326 <h3 class="frm-collapsed">
327 <?php esc_html_e( 'Validation Messages', 'formidable' ); ?>
328 <i class="frm_icon_font frm_arrowdown6_icon"></i>
329 </h3>
330
331 <div class="frm_validation_box frm-collapse-me">
332 <?php if ( $display['required'] ) { ?>
333 <p class="frm_required_details<?php echo esc_attr( $field['id'] . ( $field['required'] ? '' : ' frm_hidden' ) ); ?>">
334 <label for="field_options_blank_<?php echo esc_attr( $field['id'] ); ?>">
335 <?php esc_html_e( 'Required', 'formidable' ); ?>
336 </label>
337 <input type="text" name="field_options[blank_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['blank'] ); ?>" id="field_options_blank_<?php echo esc_attr( $field['id'] ); ?>"/>
338 </p>
339 <?php } ?>
340
341 <?php if ( $display['invalid'] ) { ?>
342 <p class="frm_invalid_msg<?php echo esc_attr( $field['id'] . ( $hidden_invalid ? ' frm_hidden' : '' ) ); ?>">
343 <label for="field_options_invalid_<?php echo esc_attr( $field['id'] ); ?>">
344 <?php esc_html_e( 'Invalid Format', 'formidable' ); ?>
345 </label>
346 <input type="text" name="field_options[invalid_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['invalid'] ); ?>" id="field_options_invalid_<?php echo esc_attr( $field['id'] ); ?>"/>
347 </p>
348 <?php
349 }
350
351 if ( $display['unique'] ) {
352 ?>
353 <p class="frm_unique_details<?php echo esc_attr( $field['id'] . ( $field['unique'] ? '' : ' frm_hidden' ) ); ?>">
354 <label for="field_options_unique_msg_<?php echo esc_attr( $field['id'] ); ?>">
355 <?php esc_html_e( 'Unique', 'formidable' ); ?>
356 </label>
357 <input type="text" name="field_options[unique_msg_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['unique_msg'] ); ?>" id="field_options_unique_msg_<?php echo esc_attr( $field['id'] ); ?>" />
358 </p>
359 <?php
360 }
361
362 if ( $display['conf_field'] ) {
363 ?>
364 <p class="frm_conf_details<?php echo esc_attr( $field['id'] . ( $field['conf_field'] ? '' : ' frm_hidden' ) ); ?>">
365 <label for="field_options_conf_msg_<?php echo esc_attr( $field['id'] ); ?>">
366 <?php esc_html_e( 'Confirmation', 'formidable' ); ?>
367 </label>
368 <input type="text" name="field_options[conf_msg_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['conf_msg'] ); ?>" id="field_options_conf_msg_<?php echo esc_attr( $field['id'] ); ?>" />
369 </p>
370 <?php
371 }
372 ?>
373 </div>
374 </div>
375 <?php } ?>
376
377 <?php do_action( 'frm_after_field_options', compact( 'field', 'display', 'values' ) ); ?>
378
379 <?php if ( $display['conf_field'] ) { ?>
380 <input type="hidden" name="field_options[conf_desc_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['conf_desc'] ); ?>" />
381 <?php } ?>
382 </div>
383