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

590 lines 24.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Field settings panel in the form builder.
4 *
5 * @package Formidable
6 *
7 * @var array $field Field data.
8 * @var array $display Display options for each setting section.
9 * @var array $values Form values associated with the field.
10 * @var FrmFieldType $field_obj Field type handler.
11 * @var string $type_name Human-readable field type name.
12 * @var array $field_types Available field types this field can switch to.
13 * @var array $disabled_fields Field types that are disabled in the type dropdown.
14 * @var array $default_value_types Default value types available for this field.
15 * @var array $unique_values_label_atts Label attributes for the Unique checkbox.
16 * @var array $read_only_label_atts Label attributes for the Read Only checkbox.
17 * @var bool|null $show_upsell_for_unique_value Whether to show upsell for Unique.
18 * @var bool|null $show_upsell_for_read_only Whether to show upsell for Read Only.
19 * @var bool|null $show_upsell_for_before_after_contents Whether to show upsell for before/after contents.
20 * @var bool|null $show_upsell_for_autocomplete Whether to show upsell for autocomplete.
21 * @var bool|null $show_upsell_for_visibility Whether to show upsell for visibility.
22 */
23
24 if ( ! defined( 'ABSPATH' ) ) {
25 die( 'You are not allowed to call this page directly.' );
26 }
27 ?>
28 <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'] ); ?>">
29 <input type="hidden" name="frm_fields_submitted[]" value="<?php echo esc_attr( $field['id'] ); ?>" />
30 <input type="hidden" name="field_options[field_order_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['field_order'] ); ?>" />
31
32 <h3 aria-expanded="true">
33 <?php
34 printf(
35 /* translators: %s: Field type */
36 esc_html__( '%s Field', 'formidable' ),
37 esc_html( $type_name )
38 );
39 ?>
40 <span class="frm-sub-label frm-text-sm frm-text-grey-400">(ID <?php echo esc_html( $field['id'] ); ?>)</span>
41 </h3>
42
43 <div class="frm_grid_container frm-collapse-me" role="group">
44 <?php
45 if ( $field['type'] === 'captcha' && ! FrmFieldCaptcha::should_show_captcha() ) {
46 ?>
47 <div class="frm_warning_style frm-with-icon">
48 <?php FrmAppHelper::icon_by_class( 'frmfont frm_alert_icon', array( 'style' => 'width:24px' ) ); ?>
49 <span>
50 <?php
51 /* translators: %1$s: Link HTML, %2$s: End link */
52 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&t=captcha_settings" target="_blank">', '</a>' );
53 ?>
54 </span>
55 </div>
56 <?php
57 }
58
59 if ( $field['type'] === 'credit_card' && ! FrmAppHelper::pro_is_installed() ) {
60 if ( ! FrmStrpLiteConnectHelper::at_least_one_mode_is_setup() && ! FrmSquareLiteConnectHelper::at_least_one_mode_is_setup() && ! FrmPayPalLiteConnectHelper::at_least_one_mode_is_setup() ) {
61 FrmStrpLiteAppHelper::not_connected_warning();
62 } elseif ( ! FrmTransLiteActionsController::get_actions_for_form( $field['form_id'] ) ) {
63 ?>
64 <div class="frm_warning_style frm-with-icon">
65 <?php FrmAppHelper::icon_by_class( 'frmfont frm_alert_icon', array( 'style' => 'width:24px' ) ); ?>
66 <span>
67 <?php
68 /* translators: %1$s: Link HTML, %2$s: End link */
69 printf( esc_html__( 'Credit Cards will not work without %1$sadding a Stripe, Square, or PayPal action%2$s.', 'formidable' ), '<a href="?page=formidable&frm_action=settings&id=' . absint( $field['form_id'] ) . '&t=email_settings" target="_blank">', '</a>' );
70 ?>
71 </span>
72 </div>
73 <?php
74 }
75 }
76 ?>
77
78 <?php
79 if ( $field['type'] === FrmFieldGdprHelper::FIELD_TYPE && FrmFieldGdprHelper::hide_gdpr_field() ) {
80 ?>
81 <div class="frm_note_style">
82 <?php FrmAppHelper::icon_by_class( 'frmfont frm_alert_icon', array( 'style' => 'width:24px' ) ); ?>
83 <span>
84 <?php
85 /* translators: %1$s: Link HTML, %2$s: End link */
86 printf( esc_html__( 'GDPR field is disabled. Please enable it in the Formidable %1$sSettings%2$s.', 'formidable' ), '<a href="?page=formidable-settings" target="_blank">', '</a>' );
87 ?>
88 </span>
89 </div>
90 <?php
91 }
92 ?>
93
94 <?php
95 /**
96 * Fires before the field label in the field settings.
97 *
98 * @since 6.23
99 *
100 * @param array $field The field settings.
101 * @param array $display The display settings for the field.
102 * @param array $values The values associated with the field.
103 */
104 do_action( 'frm_field_options_before_label', $field, $display, $values );
105 ?>
106 <?php if ( $display['label'] ) { ?>
107 <p class="frm-mt-xs">
108 <label for="frm_name_<?php echo esc_attr( $field['id'] ); ?>">
109 <?php
110 // skipcq: PHP-W1020
111 echo esc_html( apply_filters( 'frm_builder_field_label', __( 'Field Label', 'formidable' ), $field ) );
112 ?>
113 </label>
114 <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'] ); ?>" />
115 </p>
116 <?php } else { ?>
117 <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'] ); ?>" />
118 <?php } ?>
119
120 <div class="frm-hide-empty frm-inline-flex frm-gap-sm frm-flex-wrap frm-items-center frm-my-xs">
121 <?php if ( $display['required'] ) { ?>
122 <div class="frm_form_field">
123 <label for="frm_req_field_<?php echo esc_attr( $field['id'] ); ?>" class="frm-mb-0">
124 <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 echo $display['readonly_required'] ? 'readonly onclick="return false;"' : ''; ?> <?php checked( ! empty( $field['required'] ) || ! empty( $display['readonly_required'] ) ); ?> />
125 <?php esc_html_e( 'Required', 'formidable' ); ?>
126 </label>
127 </div>
128 <?php
129 }
130
131 if ( $display['unique'] || ! empty( $show_upsell_for_unique_value ) ) {
132 ?>
133 <div class="frm_form_field">
134 <label <?php FrmAppHelper::array_to_html_params( $unique_values_label_atts, true ); ?>>
135 <input <?php FrmAppHelper::array_to_html_params( FrmSettingsUpsellHelper::get_unique_element_atts( $field ), true ); ?> />
136 <?php esc_html_e( 'Unique', 'formidable' ); ?>
137 </label>
138 </div>
139 <?php
140 }
141
142 if ( $display['read_only'] || ! empty( $show_upsell_for_read_only ) ) {
143 ?>
144 <div class="frm_form_field">
145 <label <?php FrmAppHelper::array_to_html_params( $read_only_label_atts, true ); ?>>
146 <input <?php FrmAppHelper::array_to_html_params( FrmSettingsUpsellHelper::get_read_only_element_atts( $field ), true ); ?> />
147 <?php esc_html_e( 'Read Only', 'formidable' ); ?>
148 </label>
149 </div>
150 <?php
151 }
152 do_action( 'frm_field_options_form_top', $field, $display, $values );
153 ?>
154 </div>
155
156 <?php
157 if ( $display['range'] ) {
158 include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/number-range.php';
159 }
160
161 $field_obj->show_primary_options( compact( 'field', 'display', 'values' ) );
162
163 if ( $display['format'] ) {
164 include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/format-dropdown.php';
165 FrmFieldsController::show_format_option( $field, true );
166 }
167 ?>
168
169 <?php if ( $display['css'] ) { ?>
170 <p class="frm-has-modal">
171 <label class="frm-h-stack-xs" for="frm_classes_<?php echo esc_attr( $field['id'] ); ?>">
172 <span><?php esc_html_e( 'CSS Layout Classes', 'formidable' ); ?></span>
173 <?php FrmAppHelper::tooltip_icon( __( 'Add a CSS class to the field container. Use our predefined classes to align multiple fields in single row.', 'formidable' ), array( 'class' => 'frm-flex' ) ); ?>
174 </label>
175 <span class="frm-with-right-icon frm-block">
176 <?php
177 $css_layout_classes_attrs = array(
178 'type' => 'text',
179 'name' => 'field_options[classes_' . $field['id'] . ']',
180 'value' => $field['classes'],
181 'class' => 'frm_classes frm-token-input-field',
182 'id' => 'frm_classes_' . $field['id'],
183 'data-changeme' => 'frm_field_id_' . $field['id'],
184 'data-changeatt' => 'class',
185 'data-sep' => ' ',
186 'data-shortcode' => '0',
187 );
188 ?>
189 <input <?php FrmAppHelper::array_to_html_params( $css_layout_classes_attrs, true ); ?> />
190 <?php
191 FrmAppHelper::icon_by_class(
192 'frmfont frm_more_horiz_solid_icon frm-show-inline-modal frm-input-icon',
193 array(
194 'data-open' => 'frm-layout-classes-box',
195 'title' => esc_attr__( 'Toggle Options', 'formidable' ),
196 'tabindex' => '0',
197 )
198 );
199 ?>
200 </span>
201 </p>
202 <?php
203 }//end if
204 ?>
205 </div>
206
207 <?php
208
209 $field_obj->show_field_choices( compact( 'field', 'display', 'values' ) );
210
211 if ( $display['clear_on_focus'] ) {
212 do_action( 'frm_extra_field_display_options', $field );
213 }
214
215 /**
216 * Fires after printing the primary options section of field.
217 *
218 * @since 5.0.04 Added `$display` and `$values`.
219 *
220 * @param array $field Field data.
221 * @param array{field_obj:FrmFieldType, display:array, values:array} $data
222 */
223 do_action( 'frm_before_field_options', $field, compact( 'field_obj', 'display', 'values' ) );
224
225 ?>
226 <h3 class="frm-collapsed" aria-expanded="false" tabindex="0" role="button" aria-label="<?php esc_attr_e( 'Collapsible Advanced Settings', 'formidable' ); ?>" aria-controls="collapsible-section">
227 <?php esc_html_e( 'Advanced', 'formidable' ); ?>
228 <?php FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown8_icon', array( 'aria-hidden' => 'true' ) ); ?>
229 </h3>
230
231 <div class="frm_grid_container frm-collapse-me" role="group">
232 <?php if ( $display['default'] ) { ?>
233 <div class="frm-has-modal frm-flex-col">
234 <?php $field_obj->show_default_value_setting( $field, $field_obj, $default_value_types, $display ); ?>
235
236 <div class="frm-hide-empty frm-flex-col frm-gap-sm frm-mb-sm frm-toggle-group">
237 <?php
238 foreach ( $default_value_types as $type => $default_value_type ) {
239 if ( 'default_value' === $type ) {
240 continue;
241 }
242
243 // Backwards compatibility "@since 6.24".
244 if ( FrmAppHelper::pro_is_connected() && ! is_callable( array( 'FrmProHtmlHelper', 'echo_radio_group' ) ) ) {
245 switch ( $type ) {
246 case 'calc':
247 $default_value_type['data'] = array(
248 'show' => '#calc-for-{id}',
249 'disable' => '#default-value-for-{id}',
250 );
251 break;
252 case 'get_values_field':
253 $default_value_type['class'] = '';
254 $default_value_type['data'] = array(
255 'show' => '.frm-lookup-box-{id}',
256 'disable' => '#default-value-for-{id}',
257 );
258 break;
259 }
260 }
261
262 $toggle_args = array(
263 'echo' => true,
264 'show_labels' => true,
265 'on_label' => $default_value_type['title'],
266 'checked' => isset( $default_value_type['current'] ),
267 'input_html' => array(
268 'data-group-name' => 'default-value',
269 'class' => $default_value_type['class'],
270 ),
271 );
272
273 foreach ( $default_value_type['data'] as $data_key => $data_value ) {
274 $toggle_args['input_html'][ 'data-' . $data_key ] = $data_value . ( str_ends_with( $data_value, '-' ) ? $field['id'] : '' );
275 }
276
277 ?>
278 <div class="frm-flex frm-gap-xs frm-items-center">
279 <?php
280 FrmHtmlHelper::toggle(
281 'frm-default-type-' . $type . '-' . $field['id'],
282 'default_type_' . $type . '[' . $field['id'] . ']',
283 $toggle_args
284 );
285
286 if ( ! empty( $default_value_type['tooltip'] ) ) {
287 FrmAppHelper::tooltip_icon( $default_value_type['tooltip'], array( 'class' => 'frm-flex' ) );
288 }
289 ?>
290 </div>
291 <?php
292 }//end foreach
293 ?>
294 </div>
295
296 <?php
297 /**
298 * Fires after printing the default value setting.
299 *
300 * @param array $field
301 * @param array $display
302 * @param array $default_value_types
303 */
304 do_action( 'frm_default_value_setting', compact( 'field', 'display', 'default_value_types' ) );
305 ?>
306 </div>
307 <?php
308 }//end if
309
310 $field_obj->show_after_default( compact( 'field', 'display' ) );
311
312 if ( $display['clear_on_focus'] ) {
313 ?>
314 <p class="frm-flex-col">
315 <label for="frm_placeholder_<?php echo esc_attr( $field['id'] ); ?>">
316 <?php esc_html_e( 'Placeholder Text', 'formidable' ); ?>
317 </label>
318 <?php
319 if ( $display['type'] === 'textarea' || $display['type'] === 'rte' ) {
320 ?>
321 <textarea name="field_options[placeholder_<?php echo esc_attr( $field['id'] ); ?>]" id="frm_placeholder_<?php echo esc_attr( $field['id'] ); ?>" rows="2" data-changeme="field_<?php echo esc_attr( $field['field_key'] ); ?>" data-changeatt="placeholder"><?php
322 echo FrmAppHelper::esc_textarea( $field['placeholder'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
323 ?></textarea>
324 <?php
325 } else {
326 ?>
327 <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" />
328 <?php
329 }
330 ?>
331 </p>
332 <?php
333 }//end if
334
335 if ( $display['description'] ) {
336 include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/field-description.php';
337 }
338
339 /**
340 * Fires after displaying the field description in a form settings.
341 *
342 * @since 6.19
343 *
344 * @param array $args {
345 * Array containing the field data.
346 *
347 * @type array $field The field settings.
348 * @type array $display The display settings for the field.
349 * @type array $values The values associated with the field.
350 * }
351 */
352 do_action( 'frm_field_options_after_description', compact( 'field', 'display', 'values' ) );
353
354 // Field Size
355 if ( $display['size'] && ! in_array( $field['type'], array( 'select', 'data', 'time' ), true ) ) {
356 $display_max = $display['max'];
357 include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/pixels-wide.php';
358 }
359
360 if ( ! empty( $show_upsell_for_before_after_contents ) ) {
361 include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/upsell/before-after-contents.php';
362 }
363
364 if ( ! empty( $show_upsell_for_autocomplete ) ) {
365 include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/upsell/autocomplete.php';
366 }
367
368 if ( ! empty( $show_upsell_for_visibility ) ) {
369 include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/upsell/visibility.php';
370 }
371
372 if ( $display['show_image'] ) {
373 ?>
374 <p class="frm_form_field">
375 <label class="frm-force-flex frm-gap-xs" for="frm_show_image_<?php echo esc_attr( $field['id'] ); ?>">
376 <input class="frm-m-0" 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 ); ?> />
377 <span class="-frm-mt-2xs"><?php esc_html_e( 'If this URL points to an image, show to image on the entries listing page.', 'formidable' ); ?></span>
378 </label>
379 </p>
380 <?php } ?>
381
382 <?php if ( $display['captcha_size'] ) { ?>
383 <p class="frm6 frm_first frm_form_field">
384 <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' ); ?>">
385 <?php esc_html_e( 'Captcha Size', 'formidable' ); ?>
386 </label>
387 <select name="field_options[captcha_size_<?php echo esc_attr( $field['id'] ); ?>]" id="field_options_captcha_size_<?php echo esc_attr( $field['id'] ); ?>">
388 <option value="normal" <?php selected( $field['captcha_size'], 'normal' ); ?>>
389 <?php esc_html_e( 'Normal', 'formidable' ); ?>
390 </option>
391 <option value="compact" <?php selected( $field['captcha_size'], 'compact' ); ?>>
392 <?php esc_html_e( 'Compact', 'formidable' ); ?>
393 </option>
394 </select>
395 </p>
396 <?php } ?>
397 <?php if ( $display['captcha_theme'] ) { ?>
398 <p class="frm6 frm_form_field">
399 <label for="captcha_theme_<?php echo esc_attr( $field['field_key'] ); ?>">
400 <?php esc_html_e( 'Captcha Theme', 'formidable' ); ?>
401 </label>
402 <select name="field_options[captcha_theme_<?php echo esc_attr( $field['id'] ); ?>]" id="captcha_theme_<?php echo esc_attr( $field['field_key'] ); ?>">
403 <option value="light" <?php selected( $field['captcha_theme'], 'light' ); ?>>
404 <?php esc_html_e( 'Light', 'formidable' ); ?>
405 </option>
406 <option value="dark" <?php selected( $field['captcha_theme'], 'dark' ); ?>>
407 <?php esc_html_e( 'Dark', 'formidable' ); ?>
408 </option>
409 <?php if ( $display['captcha_theme_auto_option'] ) { ?>
410 <option value="auto" <?php selected( $field['captcha_theme'], 'auto' ); ?>>
411 <?php esc_html_e( 'Auto', 'formidable' ); ?>
412 </option>
413 <?php } ?>
414 </select>
415 </p>
416 <?php } ?>
417
418 <?php do_action( 'frm_field_options', compact( 'field', 'display', 'values' ) ); ?>
419
420 <?php if ( $display['required'] ) { ?>
421 <p class="frm6 frm_form_field frm_required_details<?php echo esc_attr( $field['id'] . ( $field['required'] ? '' : ' frm_hidden' ) ); ?>">
422 <label for="field_options_required_indicator_<?php echo esc_attr( $field['id'] ); ?>">
423 <?php esc_html_e( 'Required Field Indicator', 'formidable' ); ?>
424 </label>
425 <input type="text" id="field_options_required_indicator_<?php echo esc_attr( $field['id'] ); ?>" name="field_options[required_indicator_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['required_indicator'] ); ?>" />
426 </p>
427 <?php } ?>
428
429 <?php if ( $display['label_position'] ) { ?>
430 <p class="frm6 frm_form_field">
431 <label for="field_options_label_<?php echo esc_attr( $field['id'] ); ?>"><?php esc_html_e( 'Label Position', 'formidable' ); ?></label>
432 <select id="field_options_label_<?php echo esc_attr( $field['id'] ); ?>" name="field_options[label_<?php echo esc_attr( $field['id'] ); ?>]">
433 <option value="" <?php selected( $field['label'], '' ); ?>>
434 <?php esc_html_e( 'Default', 'formidable' ); ?>
435 </option>
436 <?php
437 foreach ( FrmStylesHelper::get_single_label_positions( $field ) as $pos => $pos_label ) {
438 if ( ! $display['clear_on_focus'] && 'inside' === $pos ) {
439 // Don't allow inside labels for fields without placeholders.
440 continue;
441 }
442 FrmHtmlHelper::echo_dropdown_option(
443 $pos_label,
444 $pos === $field['label'],
445 array(
446 'value' => $pos,
447 )
448 );
449 }
450
451 if ( $field['type'] === 'divider' ) {
452 FrmHtmlHelper::echo_dropdown_option(
453 __( 'Center', 'formidable' ),
454 'center' === $field['label'],
455 array(
456 'value' => 'center',
457 )
458 );
459 }
460 ?>
461 </select>
462 </p>
463 <?php
464 }//end if
465 ?>
466
467 <p class="frm6 frm_form_field">
468 <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' ); ?>">
469 <?php esc_html_e( 'Field Key', 'formidable' ); ?>
470 </label>
471 <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'] ); ?>"/>
472 </p>
473
474 <?php if ( count( $field_types ) > 1 ) { ?>
475 <p class="frm6 frm_form_field">
476 <label for="field_options_type_<?php echo esc_attr( $field['id'] ); ?>">
477 <?php esc_html_e( 'Field Type', 'formidable' ); ?>
478 </label>
479 <select name="field_options[type_<?php echo esc_attr( $field['id'] ); ?>]" id="field_options_type_<?php echo esc_attr( $field['id'] ); ?>">
480 <?php
481 foreach ( $field_types as $fkey => $ftype ) {
482 // We need to avoid the word "select" in POST requests.
483 // When "dropdown" is sent as a type value, we'll map it back to "select" with PHP.
484 $type_option_value = 'select' === $fkey ? 'dropdown' : $fkey;
485 $type_option_params = array( 'value' => $type_option_value );
486
487 if ( array_key_exists( $fkey, $disabled_fields ) ) {
488 $type_option_params['disabled'] = 'disabled';
489 }
490
491 FrmHtmlHelper::echo_dropdown_option(
492 is_array( $ftype ) ? $ftype['name'] : $ftype,
493 $fkey === $field['type'],
494 $type_option_params
495 );
496 unset( $fkey, $ftype, $type_option_value, $type_option_params );
497 }
498 ?>
499 </select>
500 </p>
501 <?php } else { ?>
502 <input type="hidden" id="field_options_type_<?php echo esc_attr( $field['id'] ); ?>" value="<?php echo esc_attr( $field['type'] ); ?>" />
503 <?php
504 }//end if
505 ?>
506
507 <table class="form-table frm-mt-0">
508 <?php
509 $field_obj->show_options( $field, $display, $values );
510 do_action( 'frm_field_options_form', $field, $display, $values );
511 ?>
512 </table>
513 </div>
514
515 <?php if ( $display['required'] || $display['invalid'] || $display['unique'] || $display['conf_field'] ) { ?>
516 <?php
517 $hidden_invalid = FrmField::is_field_type( $field, 'text' ) && ! FrmField::is_option_true( $field, 'format' ) && FrmField::is_option_empty( $field, 'max' );
518 $has_validation = ( $display['invalid'] && ! $hidden_invalid ) || $field['required'] || FrmField::is_option_true( $field, 'unique' ) || FrmField::is_option_true( $field, 'conf_field' );
519 ?>
520 <div class="frm_validation_msg <?php echo esc_attr( $has_validation ? '' : 'frm_hidden' ); ?>">
521 <h3 class="frm-collapsed" aria-expanded="false" tabindex="0" role="button" aria-label="<?php esc_attr_e( 'Collapsible Validation Messages Settings', 'formidable' ); ?>" aria-controls="collapsible-section">
522 <?php
523 esc_html_e( 'Validation Messages', 'formidable' );
524 FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown8_icon', array( 'aria-hidden' => 'true' ) );
525 ?>
526 </h3>
527
528 <div class="frm_validation_box frm-collapse-me" role="group">
529 <?php if ( $display['required'] ) { ?>
530 <p class="frm_required_details<?php echo esc_attr( $field['id'] . ( $field['required'] ? '' : ' frm_hidden' ) ); ?>">
531 <label for="field_options_blank_<?php echo esc_attr( $field['id'] ); ?>">
532 <?php esc_html_e( 'Required', 'formidable' ); ?>
533 </label>
534 <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'] ); ?>" />
535 </p>
536 <?php } ?>
537
538 <?php if ( $display['invalid'] ) { ?>
539 <p class="frm_invalid_msg<?php echo esc_attr( $field['id'] . ( $hidden_invalid ? ' frm_hidden' : '' ) ); ?>">
540 <label for="field_options_invalid_<?php echo esc_attr( $field['id'] ); ?>">
541 <?php esc_html_e( 'Invalid Format', 'formidable' ); ?>
542 </label>
543 <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'] ); ?>" />
544 </p>
545 <?php
546 }
547
548 if ( $display['unique'] ) {
549 ?>
550 <p class="frm_unique_details<?php echo esc_attr( $field['id'] . ( $field['unique'] ? '' : ' frm_hidden' ) ); ?>">
551 <label for="field_options_unique_msg_<?php echo esc_attr( $field['id'] ); ?>">
552 <?php esc_html_e( 'Unique', 'formidable' ); ?>
553 </label>
554 <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'] ); ?>" />
555 </p>
556 <?php
557 }
558
559 if ( $display['conf_field'] ) {
560 ?>
561 <p class="frm_conf_details<?php echo esc_attr( $field['id'] . ( $field['conf_field'] ? '' : ' frm_hidden' ) ); ?>">
562 <label for="field_options_conf_msg_<?php echo esc_attr( $field['id'] ); ?>">
563 <?php esc_html_e( 'Confirmation', 'formidable' ); ?>
564 </label>
565 <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'] ); ?>" />
566 </p>
567 <?php
568 }
569
570 /**
571 * @since 6.28
572 *
573 * @param array $display
574 * @param array $field
575 */
576 do_action( 'frm_field_validation_messages', $display, $field );
577 ?>
578 </div>
579 </div>
580 <?php
581 }//end if
582 ?>
583
584 <?php do_action( 'frm_after_field_options', compact( 'field', 'display', 'values' ) ); ?>
585
586 <?php if ( $display['conf_field'] ) { ?>
587 <input type="hidden" name="field_options[conf_desc_<?php echo esc_attr( $field['id'] ); ?>]" value="<?php echo esc_attr( $field['conf_desc'] ); ?>" />
588 <?php } ?>
589 </div>
590