PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.4
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.4
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 6.4, at classes/views/frm-fields/back-end/settings.php

372 lines 17.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( 'You are not allowed to call this page directly.' );
4 }
5 ?>
6 <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'] ); ?>">
7 <input type="hidden" name="frm_fields_submitted[]" value="<?php echo esc_attr( $field['id'] ); ?>" />
8 <input type="hidden" name="field_options[field_order_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['field_order'] ); ?>"/>
9
10 <div class="frm-sub-label alignright">
11 (ID <?php echo esc_html( $field['id'] ); ?>)
12 </div>
13 <h3>
14 <?php
15 printf(
16 /* translators: %s: Field type */
17 esc_html__( '%s Field', 'formidable' ),
18 esc_html( $type_name )
19 );
20 ?>
21 </h3>
22
23 <div class="frm_grid_container frm-collapse-me">
24 <?php
25 if ( $field['type'] === 'captcha' && ! FrmFieldCaptcha::should_show_captcha() ) {
26 ?>
27 <div class="frm_warning_style frm-with-icon">
28 <?php FrmAppHelper::icon_by_class( 'frm_icon_font frm_alert_icon', array( 'style' => 'width:24px' ) ); ?>
29 <span>
30 <?php
31 /* translators: %1$s: Link HTML, %2$s: End link */
32 printf( esc_html__( 'Captchas will not be used until the Site and Secret Keys are %1$sset up%2$s.', 'formidable' ), '<a href="?page=formidable-settings" target="_blank">', '</a>' );
33 ?>
34 </span>
35 </div>
36 <?php } ?>
37 <?php if ( $display['label'] ) { ?>
38 <p>
39 <label for="frm_name_<?php echo esc_attr( $field['id'] ); ?>">
40 <?php echo esc_html( apply_filters( 'frm_builder_field_label', __( 'Field Label', 'formidable' ), $field ) ); ?>
41 </label>
42 <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'] ); ?>" />
43 </p>
44 <?php } else { ?>
45 <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'] ); ?>" />
46 <?php } ?>
47
48 <p class="frm-hide-empty">
49 <?php if ( $display['required'] ) { ?>
50 <label for="frm_req_field_<?php echo esc_attr( $field['id'] ); ?>" class="frm_inline_label">
51 <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 ); ?> />
52 <?php esc_html_e( 'Required', 'formidable' ); ?>
53 </label>
54 <?php
55 }
56
57 if ( $display['unique'] ) {
58 ?>
59 <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" />
60 <?php esc_html_e( 'Unique', 'formidable' ); ?>
61 </label>
62 <?php
63 }
64
65 if ( $display['read_only'] ) {
66 ?>
67 <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' ); ?>" >
68 <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 ); ?>/>
69 <?php esc_html_e( 'Read Only', 'formidable' ); ?>
70 </label>
71 <?php
72 }
73
74 do_action( 'frm_field_options_form_top', $field, $display, $values );
75 ?>
76 </p>
77
78 <?php
79 if ( $display['range'] ) {
80 include( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/number-range.php' );
81 }
82
83 $field_obj->show_primary_options( compact( 'field', 'display', 'values' ) );
84
85 ?>
86
87 <?php if ( $display['css'] ) { ?>
88 <p class="frm-has-modal">
89 <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' ); ?>">
90 <?php esc_html_e( 'CSS Layout Classes', 'formidable' ); ?>
91 </label>
92 <span class="frm-with-right-icon">
93 <?php
94 FrmAppHelper::icon_by_class(
95 'frm_icon_font frm_more_horiz_solid_icon frm-show-inline-modal',
96 array(
97 'data-open' => 'frm-layout-classes-box',
98 'title' => esc_attr__( 'Toggle Options', 'formidable' ),
99 )
100 );
101 ?>
102 <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" />
103 </span>
104 </p>
105 <?php } ?>
106 </div>
107
108 <?php
109
110 $field_obj->show_field_choices( compact( 'field', 'display', 'values' ) );
111
112 if ( $display['clear_on_focus'] ) {
113 do_action( 'frm_extra_field_display_options', $field );
114 }
115
116 /**
117 * Fires after printing the primary options section of field.
118 *
119 * @since 5.0.04 Added `$display` and `$values`.
120 *
121 * @param array $field Field data.
122 * @param FrmFieldType $field_obj Field type object.
123 * @param array $display Display data.
124 * @param array $values Field values.
125 */
126 do_action( 'frm_before_field_options', $field, compact( 'field_obj', 'display', 'values' ) );
127
128 ?>
129
130 <h3 class="frm-collapsed">
131 <?php esc_html_e( 'Advanced', 'formidable' ); ?>
132 <?php FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown6_icon', array( 'aria-hidden' => 'true' ) ); ?>
133 </h3>
134 <div class="frm_grid_container frm-collapse-me">
135
136 <?php if ( $display['default'] ) { ?>
137 <div class="frm-has-modal">
138 <?php if ( count( $default_value_types ) > 1 ) { ?>
139 <span class="frm-default-switcher">
140 <?php foreach ( $default_value_types as $def_name => $link ) { ?>
141 <a href="#" title="<?php echo esc_attr( $link['title'] ); ?>" class="<?php echo esc_attr( $link['class'] ); ?>" data-toggleclass="frm_hidden frm-open"
142 <?php foreach ( $link['data'] as $data_key => $data_value ) { ?>
143 data-<?php echo esc_attr( $data_key ); ?>="<?php echo esc_attr( $data_value . ( substr( $data_value, -1 ) === '-' ? $field['id'] : '' ) ); ?>"
144 <?php } ?>
145 <?php if ( isset( $link['data']['frmshow'] ) ) { ?>
146 data-frmhide=".frm-inline-modal,.default-value-section-<?php echo esc_attr( $field['id'] ); ?>"
147 <?php } ?>
148 >
149 <?php FrmAppHelper::icon_by_class( $link['icon'] ); ?>
150 </a>
151 <?php } ?>
152 </span>
153 <?php } ?>
154 <?php $field_obj->show_default_value_setting( $field, $field_obj, $default_value_types, $display ); ?>
155 <?php do_action( 'frm_default_value_setting', compact( 'field', 'display', 'default_value_types' ) ); ?>
156 </div>
157 <?php } ?>
158
159 <?php $field_obj->show_after_default( compact( 'field', 'display' ) ); ?>
160
161 <?php if ( $display['clear_on_focus'] ) { ?>
162 <p>
163 <label for="frm_placeholder_<?php echo esc_attr( $field['id'] ); ?>">
164 <?php esc_html_e( 'Placeholder Text', 'formidable' ); ?>
165 </label>
166 <?php
167 if ( $display['type'] === 'textarea' || $display['type'] === 'rte' ) {
168 ?>
169 <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
170 echo FrmAppHelper::esc_textarea( $field['placeholder'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
171 ?></textarea>
172 <?php
173 } else {
174 ?>
175 <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" />
176 <?php
177 }
178 ?>
179 </p>
180 <?php } ?>
181
182 <?php
183 if ( $display['description'] ) {
184 include( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/field-description.php' );
185 }
186
187 // Field Size
188 if ( $display['size'] && ! in_array( $field['type'], array( 'select', 'data', 'time' ) ) ) {
189 $display_max = $display['max'];
190 include( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/pixels-wide.php' );
191 }
192 ?>
193
194 <?php if ( $display['show_image'] ) { ?>
195 <p>
196 <label for="frm_show_image_<?php echo esc_attr( $field['id'] ); ?>">
197 <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 ); ?> />
198 <?php esc_html_e( 'If this URL points to an image, show to image on the entries listing page.', 'formidable' ); ?>
199 </label>
200 </p>
201 <?php } ?>
202
203 <?php if ( $display['captcha_size'] && $frm_settings->re_type !== 'invisible' && $frm_settings->active_captcha === 'recaptcha' ) { ?>
204 <p class="frm6 frm_first frm_form_field">
205 <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' ); ?>">
206 <?php esc_html_e( 'ReCaptcha Type', 'formidable' ); ?>
207 </label>
208 <select name="field_options[captcha_size_<?php echo esc_attr( $field['id'] ); ?>]" id="field_options_captcha_size_<?php echo esc_attr( $field['id'] ); ?>">
209 <option value="normal" <?php selected( $field['captcha_size'], 'normal' ); ?>>
210 <?php esc_html_e( 'Normal', 'formidable' ); ?>
211 </option>
212 <option value="compact" <?php selected( $field['captcha_size'], 'compact' ); ?>>
213 <?php esc_html_e( 'Compact', 'formidable' ); ?>
214 </option>
215 </select>
216 </p>
217 <p class="frm6 frm_form_field">
218 <label for="captcha_theme_<?php echo esc_attr( $field['field_key'] ); ?>">
219 <?php esc_html_e( 'reCAPTCHA Color', 'formidable' ); ?>
220 </label>
221 <select name="field_options[captcha_theme_<?php echo esc_attr( $field['id'] ); ?>]" id="captcha_theme_<?php echo esc_attr( $field['field_key'] ); ?>">
222 <option value="light" <?php selected( $field['captcha_theme'], 'light' ); ?>>
223 <?php esc_html_e( 'Light', 'formidable' ); ?>
224 </option>
225 <option value="dark" <?php selected( $field['captcha_theme'], 'dark' ); ?>>
226 <?php esc_html_e( 'Dark', 'formidable' ); ?>
227 </option>
228 </select>
229 </p>
230 <?php } ?>
231
232 <?php
233 if ( $display['format'] ) {
234 FrmFieldsController::show_format_option( $field );
235 }
236 ?>
237
238 <?php do_action( 'frm_field_options', compact( 'field', 'display', 'values' ) ); ?>
239
240 <?php if ( $display['required'] ) { ?>
241 <p class="frm6 frm_form_field frm_required_details<?php echo esc_attr( $field['id'] . ( $field['required'] ? '' : ' frm_hidden' ) ); ?>">
242 <label>
243 <?php esc_html_e( 'Required Field Indicator', 'formidable' ); ?>
244 </label>
245 <input type="text" name="field_options[required_indicator_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['required_indicator'] ); ?>" />
246 </p>
247 <?php } ?>
248
249 <?php if ( $display['label_position'] ) { ?>
250 <p class="frm6 frm_form_field">
251 <label><?php esc_html_e( 'Label Position', 'formidable' ); ?></label>
252 <select name="field_options[label_<?php echo esc_attr( $field['id'] ); ?>]">
253 <option value="" <?php selected( $field['label'], '' ); ?>>
254 <?php esc_html_e( 'Default', 'formidable' ); ?>
255 </option>
256 <?php
257 foreach ( FrmStylesHelper::get_single_label_positions() as $pos => $pos_label ) {
258 if ( ! $display['clear_on_focus'] && 'inside' === $pos ) {
259 // Don't allow inside labels for fields without placeholders.
260 continue;
261 }
262 ?>
263 <option value="<?php echo esc_attr( $pos ); ?>"<?php selected( $field['label'], $pos ); ?>>
264 <?php echo esc_html( $pos_label ); ?>
265 </option>
266 <?php } ?>
267 <?php if ( $field['type'] === 'divider' ) { ?>
268 <option value="center" <?php selected( $field['label'], 'center' ); ?>>
269 <?php esc_html_e( 'Center', 'formidable' ); ?>
270 </option>
271 <?php } ?>
272 </select>
273 </p>
274 <?php } ?>
275
276 <p class="frm6 frm_form_field">
277 <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' ); ?>">
278 <?php esc_html_e( 'Field Key', 'formidable' ); ?>
279 </label>
280 <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'] ); ?>"/>
281 </p>
282
283 <?php if ( count( $field_types ) > 1 ) { ?>
284 <p class="frm6 frm_form_field">
285 <label for="field_options_type_<?php echo esc_attr( $field['id'] ); ?>">
286 <?php esc_html_e( 'Field Type', 'formidable' ); ?>
287 </label>
288 <select name="field_options[type_<?php echo esc_attr( $field['id'] ); ?>]" id="field_options_type_<?php echo esc_attr( $field['id'] ); ?>">
289 <?php foreach ( $field_types as $fkey => $ftype ) { ?>
290 <option value="<?php echo esc_attr( $fkey ); ?>" <?php echo ( $fkey === $field['type'] ) ? ' selected="selected"' : ''; ?> <?php echo array_key_exists( $fkey, $disabled_fields ) ? 'disabled="disabled"' : ''; ?>>
291 <?php echo esc_html( is_array( $ftype ) ? $ftype['name'] : $ftype ); ?>
292 </option>
293 <?php
294 unset( $fkey, $ftype );
295 }
296 ?>
297 </select>
298 </p>
299 <?php } else { ?>
300 <input type="hidden" id="field_options_type_<?php echo esc_attr( $field['id'] ); ?>" value="<?php echo esc_attr( $field['type'] ); ?>" />
301 <?php } ?>
302
303 <table class="form-table frm-mt-0">
304 <?php $field_obj->show_options( $field, $display, $values ); ?>
305 <?php do_action( 'frm_field_options_form', $field, $display, $values ); ?>
306 </table>
307 </div>
308
309 <?php if ( $display['required'] || $display['invalid'] || $display['unique'] || $display['conf_field'] ) { ?>
310 <?php
311 $hidden_invalid = FrmField::is_field_type( $field, 'text' ) && ! FrmField::is_option_true( $field, 'format' ) && FrmField::is_option_empty( $field, 'max' );
312 $has_validation = ( ( $display['invalid'] && ! $hidden_invalid ) || $field['required'] || FrmField::is_option_true( $field, 'unique' ) || FrmField::is_option_true( $field, 'conf_field' ) );
313 ?>
314 <div class="frm_validation_msg <?php echo esc_attr( $has_validation ? '' : 'frm_hidden' ); ?>">
315 <h3 class="frm-collapsed">
316 <?php esc_html_e( 'Validation Messages', 'formidable' ); ?>
317 <?php FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown6_icon', array( 'aria-hidden' => 'true' ) ); ?>
318 </h3>
319
320 <div class="frm_validation_box frm-collapse-me">
321 <?php if ( $display['required'] ) { ?>
322 <p class="frm_required_details<?php echo esc_attr( $field['id'] . ( $field['required'] ? '' : ' frm_hidden' ) ); ?>">
323 <label for="field_options_blank_<?php echo esc_attr( $field['id'] ); ?>">
324 <?php esc_html_e( 'Required', 'formidable' ); ?>
325 </label>
326 <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'] ); ?>"/>
327 </p>
328 <?php } ?>
329
330 <?php if ( $display['invalid'] ) { ?>
331 <p class="frm_invalid_msg<?php echo esc_attr( $field['id'] . ( $hidden_invalid ? ' frm_hidden' : '' ) ); ?>">
332 <label for="field_options_invalid_<?php echo esc_attr( $field['id'] ); ?>">
333 <?php esc_html_e( 'Invalid Format', 'formidable' ); ?>
334 </label>
335 <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'] ); ?>"/>
336 </p>
337 <?php
338 }
339
340 if ( $display['unique'] ) {
341 ?>
342 <p class="frm_unique_details<?php echo esc_attr( $field['id'] . ( $field['unique'] ? '' : ' frm_hidden' ) ); ?>">
343 <label for="field_options_unique_msg_<?php echo esc_attr( $field['id'] ); ?>">
344 <?php esc_html_e( 'Unique', 'formidable' ); ?>
345 </label>
346 <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'] ); ?>" />
347 </p>
348 <?php
349 }
350
351 if ( $display['conf_field'] ) {
352 ?>
353 <p class="frm_conf_details<?php echo esc_attr( $field['id'] . ( $field['conf_field'] ? '' : ' frm_hidden' ) ); ?>">
354 <label for="field_options_conf_msg_<?php echo esc_attr( $field['id'] ); ?>">
355 <?php esc_html_e( 'Confirmation', 'formidable' ); ?>
356 </label>
357 <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'] ); ?>" />
358 </p>
359 <?php
360 }
361 ?>
362 </div>
363 </div>
364 <?php } ?>
365
366 <?php do_action( 'frm_after_field_options', compact( 'field', 'display', 'values' ) ); ?>
367
368 <?php if ( $display['conf_field'] ) { ?>
369 <input type="hidden" name="field_options[conf_desc_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['conf_desc'] ); ?>" />
370 <?php } ?>
371 </div>
372