PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 3.06.06
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v3.06.06
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-forms / settings.php

settings.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 3.06.06, at classes/views/frm-forms/settings.php

388 lines 18.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <div id="form_settings_page" class="frm_wrap">
2 <div id="poststuff" class="frm_page_container">
3
4 <div id="post-body" class="metabox-holder columns-2">
5 <div id="post-body-content">
6
7 <?php
8 FrmAppHelper::get_admin_header(
9 array(
10 'label' => __( 'Settings', 'formidable' ),
11 'form' => $form,
12 )
13 );
14
15 // Add form messages
16 require( FrmAppHelper::plugin_path() . '/classes/views/shared/errors.php' );
17 ?>
18
19 <form method="post" class="frm_form_settings">
20 <input type="hidden" name="id" id="form_id" value="<?php echo (int) $id; ?>" />
21 <input type="hidden" name="frm_action" value="update_settings" />
22 <?php wp_nonce_field( 'process_form_nonce', 'process_form' ); ?>
23
24 <div class="meta-box-sortables">
25 <div class="categorydiv postbox" id="frm-categorydiv">
26 <div class="inside frm-help-tabs">
27 <div id="contextual-help-back"></div>
28 <div id="contextual-help-columns">
29 <div class="contextual-help-tabs">
30 <ul class="frm-category-tabs frm-form-setting-tabs">
31 <?php $a = FrmAppHelper::simple_get( 't', 'sanitize_title', 'advanced_settings' ); ?>
32 <li class="<?php echo esc_attr( 'advanced_settings' === $a ? 'tabs active' : '' ); ?>">
33 <a href="#advanced_settings"><?php esc_html_e( 'General', 'formidable' ) ?></a>
34 </li>
35 <li class="<?php echo esc_attr( 'email_settings' === $a ? 'tabs active' : '' ); ?>">
36 <a href="#email_settings"><?php esc_html_e( 'Form Actions', 'formidable' ); ?></a>
37 </li>
38 <li class="<?php echo esc_attr( 'html_settings' === $a ? 'class="tabs active"' : '' ); ?>">
39 <a href="#html_settings"><?php esc_html_e( 'Customize HTML', 'formidable' ) ?></a>
40 </li>
41 <?php
42 foreach ( $sections as $key => $section ) {
43 if ( isset( $section['name'] ) ) {
44 $sec_name = $section['name'];
45 $sec_anchor = $section['anchor'];
46 } else {
47 $sec_name = $key;
48 $sec_anchor = $key;
49 }
50 ?>
51 <li class="<?php echo esc_attr( $a === $sec_anchor . '_settings' ? 'tabs active' : '' ); ?>">
52 <a href="#<?php echo esc_attr( $sec_anchor ) ?>_settings">
53 <?php echo esc_html( ucfirst( $sec_name ) ); ?>
54 </a>
55 </li>
56 <?php } ?>
57 </ul>
58 </div>
59 <div class="advanced_settings tabs-panel <?php echo esc_attr( $a === 'advanced_settings' ? 'frm_block' : 'frm_hidden' ); ?>">
60
61 <?php if ( ! $values['is_template'] ) { ?>
62 <h3 id="frm_shortcode" class="<?php echo esc_attr( $first_h3 ) ?>">
63 <?php esc_html_e( 'Form Shortcodes', 'formidable' ); ?>
64 </h3>
65 <a href="#edit_frm_shortcode" class="edit-frm_shortcode hide-if-no-js" tabindex='4'><?php esc_html_e( 'Show', 'formidable' ); ?></a>
66 <div id="frm_shortcodediv" class="hide-if-js">
67 <p class="howto"><?php esc_html_e( 'Insert on a page, post, or text widget', 'formidable' ); ?>:</p>
68 <p><input type="text" readonly="readonly" class="frm_select_box" value="[formidable id=<?php echo esc_attr( $id ); ?>]" />
69 <input type="text" readonly="readonly" class="frm_select_box" value="[formidable id=<?php echo esc_attr( $id ); ?> title=true description=true]" />
70 </p>
71
72 <p class="howto"><?php esc_html_e( 'Insert in a template', 'formidable' ); ?>:</p>
73 <p><input type="text" readonly="readonly" class="frm_select_box frm_insert_in_template" value="&lt;?php echo FrmFormsController::get_form_shortcode( array( 'id' => <?php echo absint( $id ) ?>, 'title' => false, 'description' => false ) ); ?&gt;" /></p>
74
75 <p><a href="#edit_frm_shortcode" class="cancel-frm_shortcode hide-if-no-js"><?php esc_html_e( 'Hide', 'formidable' ); ?></a></p>
76 </div>
77 <?php $first_h3 = ''; ?>
78
79 <?php if ( has_action( 'frm_settings_buttons' ) ) { ?>
80 <h3 class="<?php echo esc_attr( $first_h3 ) ?>">
81 <?php esc_html_e( 'Form Settings', 'formidable' ); ?>
82 </h3>
83 <div class="misc-pub-section">
84 <?php do_action( 'frm_settings_buttons', $values ); ?>
85 <div class="clear"></div>
86 </div>
87 <?php $first_h3 = ''; ?>
88 <?php } ?>
89 <?php } ?>
90
91 <h3 class="<?php echo esc_attr( $first_h3 ) ?>">
92 <?php esc_html_e( 'On Submit', 'formidable' ); ?>
93 <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Choose what will happen after the user submits this form.', 'formidable' ); ?>"></span>
94 </h3>
95
96 <!--On Submit Section-->
97 <table class="form-table">
98 <tr>
99 <td class="frm_175_width">
100 <select name="options[success_action]" id="success_action">
101 <option value="message" <?php selected( $values['success_action'], 'message' ); ?>>
102 <?php esc_html_e( 'Show Message', 'formidable' ) ?>
103 </option>
104 <option value="redirect" <?php selected( $values['success_action'], 'redirect' ); ?>>
105 <?php esc_html_e( 'Redirect to URL', 'formidable' ) ?>
106 </option>
107 <option value="page" <?php selected( $values['success_action'], 'page' ); ?>>
108 <?php esc_html_e( 'Show Page Content', 'formidable' ) ?>
109 </option>
110 </select>
111 </td>
112 <td>
113 <span class="success_action_redirect_box success_action_box<?php echo ( $values['success_action'] == 'redirect' ) ? '' : ' frm_hidden'; ?>">
114 <input type="text" name="options[success_url]" id="success_url" value="<?php echo esc_attr( isset( $values['success_url'] ) ? $values['success_url'] : '' ); ?>" placeholder="http://example.com" />
115 </span>
116
117 <span class="success_action_page_box success_action_box<?php echo esc_attr( $values['success_action'] === 'page' ? '' : ' frm_hidden' ); ?>">
118 <label><?php esc_html_e( 'Use Content from Page', 'formidable' ); ?></label>
119 <?php FrmAppHelper::wp_pages_dropdown( 'options[success_page_id]', $values['success_page_id'] ) ?>
120 </span>
121
122 </td>
123 </tr>
124 <tr class="frm_show_form_opt success_action_message_box success_action_box<?php echo esc_attr( $values['success_action'] == 'message' ? '' : ' frm_hidden' ); ?>">
125 <td colspan="2">
126 <label for="show_form">
127 <input type="checkbox" name="options[show_form]" id="show_form" value="1" <?php checked( $values['show_form'], 1 ) ?> />
128 <?php esc_html_e( 'Show the form with the confirmation message', 'formidable' ) ?>
129 </label>
130 </td>
131 </tr>
132 <tr>
133 <td colspan="2">
134 <label for="no_save">
135 <input type="checkbox" name="options[no_save]" id="no_save" value="1" <?php checked( $values['no_save'], 1 ); ?> />
136 <?php esc_html_e( 'Do not store entries submitted from this form', 'formidable' ) ?>
137 </label>
138 </td>
139 </tr>
140 <?php if ( function_exists( 'akismet_http_post' ) ) { ?>
141 <tr>
142 <td colspan="2"><?php esc_html_e( 'Use Akismet to check entries for spam for', 'formidable' ) ?>
143 <select name="options[akismet]">
144 <option value="">
145 <?php esc_html_e( 'no one', 'formidable' ) ?>
146 </option>
147 <option value="1" <?php selected( $values['akismet'], 1 ) ?>>
148 <?php esc_html_e( 'everyone', 'formidable' ) ?>
149 </option>
150 <option value="logged" <?php selected( $values['akismet'], 'logged' ) ?>>
151 <?php esc_html_e( 'visitors who are not logged in', 'formidable' ) ?>
152 </option>
153 </select>
154 </td>
155 </tr>
156 <?php } ?>
157 </table>
158
159 <!--AJAX Section-->
160 <h3><?php esc_html_e( 'AJAX', 'formidable' ) ?>
161 <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Make stuff happen in the background without a page refresh', 'formidable' ) ?>" ></span>
162 </h3>
163 <table class="form-table">
164 <tr>
165 <td>
166 <label for="ajax_load">
167 <input type="checkbox" name="options[ajax_load]" id="ajax_load" value="1"<?php echo ( $values['ajax_load'] ) ? ' checked="checked"' : ''; ?> /> <?php esc_html_e( 'Load and save form builder page with AJAX', 'formidable' ) ?>
168 </label>
169 <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Recommended for long forms.', 'formidable' ) ?>" ></span>
170 </td>
171 </tr>
172 <?php do_action( 'frm_add_form_ajax_options', $values ); ?>
173 <tr>
174 <td>
175 <label for="js_validate">
176 <input type="checkbox" name="options[js_validate]" id="js_validate" value="1" <?php checked( $values['js_validate'], 1 ); ?> />
177 <?php esc_html_e( 'Validate this form with javascript', 'formidable' ); ?>
178 </label>
179 <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Required fields, email format, and number format can be checked instantly in your browser. You may want to turn this option off if you have any customizations to remove validation messages on certain fields.', 'formidable' ) ?>"></span>
180 </td>
181 </tr>
182 </table>
183 <?php FrmTipsHelper::pro_tip( 'get_form_settings_tip', 'p' ); ?>
184
185 <!--Permissions Section-->
186 <?php do_action( 'frm_add_form_perm_options', $values ); ?>
187
188 <!--Styling & Buttons Section-->
189 <h3><?php esc_html_e( 'Styling & Buttons', 'formidable' ) ?>
190 <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Select a style for this form and set the text for your buttons.', 'formidable' ) ?>" ></span>
191 </h3>
192 <table class="form-table">
193 <tr>
194 <td class="frm_left_label">
195 <label for="custom_style"><?php esc_html_e( 'Style Template', 'formidable' ) ?></label>
196 </td>
197 <td><select name="options[custom_style]" id="custom_style">
198 <option value="1" <?php selected( $values['custom_style'], 1 ) ?>>
199 <?php esc_html_e( 'Always use default', 'formidable' ) ?>
200 </option>
201 <?php foreach ( $styles as $s ) { ?>
202 <option value="<?php echo esc_attr( $s->ID ) ?>" <?php selected( $s->ID, $values['custom_style'] ) ?>>
203 <?php echo esc_html( $s->post_title . ( empty( $s->menu_order ) ? '' : ' (' . __( 'default', 'formidable' ) . ')' ) ) ?>
204 </option>
205 <?php } ?>
206 <option value="0" <?php selected( $values['custom_style'], 0 ); selected( $values['custom_style'], '' ) ?>>
207 <?php esc_html_e( 'Do not use Formidable styling', 'formidable' ) ?>
208 </option>
209 </select></td>
210 </tr>
211 <tr>
212 <td><label><?php esc_html_e( 'Submit Button Text', 'formidable' ) ?></label></td>
213 <td>
214 <input type="text" name="options[submit_value]" value="<?php echo esc_attr( $values['submit_value'] ); ?>" />
215 </td>
216 </tr>
217 <?php do_action( 'frm_add_form_button_options', $values ); ?>
218 </table>
219
220 <!--Message Section-->
221 <h3 id="frm_messages_header" class="<?php echo esc_attr( ( ( isset( $values['edit_action'] ) && $values['edit_action'] === 'message' && isset( $values['editable'] ) && $values['editable'] == 1 ) || $values['success_action'] === 'message' || isset( $values['save_draft'] ) && $values['save_draft'] == 1 ) ? '' : 'frm_hidden' ); ?>">
222 <?php esc_html_e( 'Messages', 'formidable' ); ?>
223 <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'Set up your confirmation messages.', 'formidable' ) ?>" ></span>
224 </h3>
225 <table class="form-table">
226 <tr class="success_action_message_box success_action_box<?php echo esc_attr( $values['success_action'] === 'message' ? '' : ' frm_hidden' ); ?>">
227 <td>
228 <div><?php esc_html_e( 'On Submit', 'formidable' ) ?></div>
229 <textarea id="success_msg" name="options[success_msg]" cols="50" rows="2" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea( $values['success_msg'] ); // WPCS: XSS ok. ?></textarea>
230 </td>
231 </tr>
232 <?php do_action( 'frm_add_form_msg_options', $values ); ?>
233 </table>
234
235 <!--Misc Section-->
236 <h3><?php esc_html_e( 'Miscellaneous', 'formidable' ); ?></h3>
237 <table class="form-table">
238 <tr>
239 <td>
240 <label for="frm_form_key"><?php esc_html_e( 'Form Key', 'formidable' ) ?></label>
241 </td>
242 <td>
243 <input type="text" id="frm_form_key" name="form_key" class="frm_long_input" value="<?php echo esc_attr( $values['form_key'] ); ?>" />
244 </td>
245 </tr>
246 <tr>
247 <td>
248 <label for="frm_form_description"><?php esc_html_e( 'Form Description', 'formidable' ) ?></label>
249 </td>
250 <td>
251 <textarea id="frm_form_description" name="description" cols="50" rows="5" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea( $values['description'] ); // WPCS: XSS ok. ?></textarea>
252 </td>
253 </tr>
254 <?php do_action( 'frm_additional_form_options', $values ); ?>
255 </table>
256 </div>
257
258
259 <div id="frm_notification_settings" class="frm_email_settings email_settings tabs-panel widgets-holder-wrap <?php echo esc_attr( $a === 'email_settings' ? ' frm_block' : ' frm_hidden' ); ?>">
260 <?php FrmTipsHelper::pro_tip( 'get_form_action_tip', 'p' ); ?>
261 <div id="frm_email_addon_menu" class="manage-menus">
262 <h3><?php esc_html_e( 'Add New Action', 'formidable' ) ?></h3>
263 <ul class="frm_actions_list">
264 <?php
265
266 //For each add-on, add an li, class, and javascript function. If active, add an additional class.
267 $included = false;
268 foreach ( $action_controls as $action_control ) {
269 $classes = ( isset( $action_control->action_options['active'] ) && $action_control->action_options['active'] ) ? 'frm_active_action ' : 'frm_inactive_action ';
270 $classes .= $action_control->action_options['classes'];
271
272 if ( ! $included && strpos( $classes, 'frm_show_upgrade' ) ) {
273 $included = true;
274 FrmAppController::include_upgrade_overlay();
275 }
276 $upgrade_label = sprintf( esc_html__( '%s form actions', 'formidable' ), $action_control->action_options['tooltip'] );
277
278 $install_data = '';
279 if ( strpos( $classes, 'frm_inactive_action' ) !== false ) {
280 $upgrading = FrmAddonsController::install_link( $action_control->action_options['plugin'] );
281 if ( isset( $upgrading['url'] ) ) {
282 $install_data = json_encode( $upgrading );
283 }
284 }
285 ?>
286 <li>
287 <a href="javascript:void(0)" class="frm_<?php echo esc_attr( $action_control->id_base ) ?>_action frm_bstooltip <?php echo esc_attr( $classes ); ?>" title="<?php echo esc_attr( $action_control->action_options['tooltip'] ) ?>" data-limit="<?php echo esc_attr( isset( $action_control->action_options['limit'] ) ? $action_control->action_options['limit'] : '99' ); ?>" data-actiontype="<?php echo esc_attr( $action_control->id_base ) ?>" data-upgrade="<?php echo esc_attr( $upgrade_label ); ?>" data-oneclick="<?php echo esc_attr( $install_data ); ?>" data-medium="settings-<?php echo esc_attr( $action_control->id_base ); ?>"></a>
288 </li>
289 <?php
290 unset( $actions_icon, $classes );
291 }
292 ?>
293 </ul>
294 </div>
295 <div class="frm_no_actions">
296 <div class="inner_actions">
297 <img src="<?php echo esc_url( FrmAppHelper::plugin_url() . '/images/sketch_arrow1.png' ); ?>" alt=""/>
298 <div class="clear"></div>
299 <?php esc_html_e( 'Click an action to add it to this form', 'formidable' ) ?>
300 </div>
301 </div>
302 <?php FrmFormActionsController::list_actions( $form, $values ); ?>
303
304 </div>
305
306 <div id="html_settings" class="tabs-panel <?php echo esc_attr( $a === 'html_settings' ) ? ' frm_block' : ' frm_hidden'; ?>">
307
308 <div class="frm_field_html_box frm_top_container">
309 <p>
310 <label><?php esc_html_e( 'Form Classes', 'formidable' ) ?></label>
311 <input type="text" name="options[form_class]" value="<?php echo esc_attr( $values['form_class'] ) ?>" />
312 </p>
313 <div class="clear"></div>
314
315 <p>
316 <label><?php esc_html_e( 'Before Fields', 'formidable' ) ?></label>
317 <textarea name="options[before_html]" rows="4" id="before_html" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea( $values['before_html'] ); // WPCS: XSS ok. ?></textarea>
318 </p>
319
320 <div id="add_html_fields">
321 <?php
322 if ( isset( $values['fields'] ) ) {
323 foreach ( $values['fields'] as $field ) {
324 if ( FrmFieldFactory::field_has_html( $field['type'] ) ) {
325 ?>
326 <p>
327 <label><?php echo esc_html( $field['name'] ) ?></label>
328 <textarea name="field_options[custom_html_<?php echo esc_attr( $field['id'] ); ?>]" rows="7" id="custom_html_<?php echo esc_attr( $field['id'] ); ?>" class="field_custom_html frm_long_input"><?php echo FrmAppHelper::esc_textarea( $field['custom_html'] ); // WPCS: XSS ok. ?></textarea>
329 </p>
330 <?php
331 }
332 unset( $field );
333 }
334 }
335 ?>
336 </div>
337
338 <p><label><?php esc_html_e( 'After Fields', 'formidable' ) ?></label>
339 <textarea name="options[after_html]" rows="3" id="after_html" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea( $values['after_html'] ); // WPCS: XSS ok. ?></textarea>
340 </p>
341
342 <p><label><?php esc_html_e( 'Submit Button', 'formidable' ) ?></label>
343 <textarea name="options[submit_html]" rows="3" id="submit_html" class="frm_long_input"><?php echo FrmAppHelper::esc_textarea( $values['submit_html'] ); // WPCS: XSS ok. ?></textarea>
344 </p>
345 </div>
346 </div>
347
348 <?php
349 foreach ( $sections as $key => $section ) {
350 if ( isset( $section['anchor'] ) ) {
351 $sec_anchor = $section['anchor'];
352 } else {
353 $sec_anchor = $key;
354 }
355 ?>
356 <div id="<?php echo esc_attr( $sec_anchor ) ?>_settings" class="tabs-panel <?php echo ( $a === $sec_anchor . '_settings' ) ? ' frm_block' : ' frm_hidden'; ?>">
357 <?php
358 if ( isset( $section['class'] ) ) {
359 call_user_func( array( $section['class'], $section['function'] ), $values );
360 } else {
361 call_user_func( ( isset( $section['function'] ) ? $section['function'] : $section ), $values );
362 }
363 ?>
364 </div>
365 <?php } ?>
366
367 <?php do_action( 'frm_add_form_option_section', $values ); ?>
368 <div class="clear"></div>
369 </div>
370 </div>
371 </div>
372
373 </div>
374
375 <p>
376 <button class="button-primary frm_button_submit" type="submit" >
377 <?php esc_html_e( 'Update', 'formidable' ); ?>
378 </button>
379 </p>
380 </form>
381
382
383 </div>
384 <?php require( FrmAppHelper::plugin_path() . '/classes/views/frm-forms/sidebar-settings.php' ); ?>
385 </div>
386 </div>
387 </div>
388