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

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