Formidable Forms – Form Builder for WordPress - Version 2.0.22

Version Description

  • Add an upgrade banner when affiliate links are active
  • Add permission checks in addition to nonce for several actions for extra security
  • Don't allow javascript to be saved in field choices
  • Include the admin_url params inside the function to resolve a conflict with WPML
  • Prevent XML breaking with US character
  • Fix rand() error with float some users are seeing with PHP7
  • Pro Features: *
  • Add the option to automatically delete files when a file is replaced, and and entry is deleted
  • Allow a prefix and/or suffix along with the [auto_id] shortcode
  • Add is_draft shortcode for views. This allows [is_draft], [if is_draft equals="1"]-draft-[/if is_draft], and [if is_draft equals="0"]-complete-[/if is_draft]
  • Add frm_no_entries_message filter to adjust the output when there are no entries found
  • Add frm_search_for_dynamic_text hook for searching numeric values in Dynamic fields
  • Add the saved value into the array and json response. The entries fetched using FrmEntriesController::show_entry_shortcode were only returning the displayed value. This adds the saved value to the array as well. This covers user id, dynamic fields, radio, dropdown, and checkbox fields anytime the saved and displayed values are different.
  • Add filter on add/remove fields to allow translations
  • Default new number fields to use "any" step
  • Fix conditional logic dependent on a paragraph field
  • Fix date fields inside form loaded with in-place-edit
Download this release

Release Info

Developer sswells
Plugin Icon 128x128 Formidable Forms – Form Builder for WordPress
Version 2.0.22
Comparing to
See all releases

Code changes from version 2.0.21 to 2.0.22

classes/controllers/FrmAddonsController.php CHANGED
@@ -6,7 +6,7 @@ class FrmAddonsController {
6
  add_submenu_page( 'formidable', 'Formidable | '. __( 'AddOns', 'formidable' ), __( 'AddOns', 'formidable' ), 'frm_view_forms', 'formidable-addons', 'FrmAddonsController::list_addons' );
7
 
8
  $affiliate = FrmAppHelper::get_affiliate();
9
- if ( ! empty( $affiliate ) ) {
10
  add_submenu_page( 'formidable', 'Formidable | '. __( 'Upgrade to Pro', 'formidable' ), __( 'Upgrade to Pro', 'formidable' ), 'frm_view_forms', 'formidable-pro-upgrade', 'FrmAddonsController::upgrade_to_pro' );
11
  }
12
  }
@@ -45,6 +45,7 @@ class FrmAddonsController {
45
  $plugin_order = array(
46
  'formidable-pro', 'mailchimp', 'registration-lite',
47
  'paypal-standard', 'bootstrap-modal', 'math-captcha',
 
48
  );
49
  $ordered_addons = array();
50
  foreach ( $plugin_order as $plugin ) {
@@ -85,12 +86,16 @@ class FrmAddonsController {
85
  }
86
 
87
  public static function get_licenses() {
 
 
 
88
  $license = get_option('frmpro-credentials');
89
  if ( $license && is_array( $license ) && isset( $license['license'] ) ) {
90
  $url = 'http://formidablepro.com/frm-edd-api/licenses?l='. urlencode( base64_encode( $license['license'] ) );
91
  $licenses = self::send_api_request( $url, array( 'name' => 'frm_api_licence', 'expires' => 60 * 60 * 5 ) );
92
  echo json_encode( $licenses );
93
  }
 
94
  wp_die();
95
  }
96
 
6
  add_submenu_page( 'formidable', 'Formidable | '. __( 'AddOns', 'formidable' ), __( 'AddOns', 'formidable' ), 'frm_view_forms', 'formidable-addons', 'FrmAddonsController::list_addons' );
7
 
8
  $affiliate = FrmAppHelper::get_affiliate();
9
+ if ( ! empty( $affiliate ) && ! FrmAppHelper::pro_is_installed() ) {
10
  add_submenu_page( 'formidable', 'Formidable | '. __( 'Upgrade to Pro', 'formidable' ), __( 'Upgrade to Pro', 'formidable' ), 'frm_view_forms', 'formidable-pro-upgrade', 'FrmAddonsController::upgrade_to_pro' );
11
  }
12
  }
45
  $plugin_order = array(
46
  'formidable-pro', 'mailchimp', 'registration-lite',
47
  'paypal-standard', 'bootstrap-modal', 'math-captcha',
48
+ 'zapier',
49
  );
50
  $ordered_addons = array();
51
  foreach ( $plugin_order as $plugin ) {
86
  }
87
 
88
  public static function get_licenses() {
89
+ FrmAppHelper::permission_check('frm_change_settings');
90
+ check_ajax_referer( 'frm_ajax', 'nonce' );
91
+
92
  $license = get_option('frmpro-credentials');
93
  if ( $license && is_array( $license ) && isset( $license['license'] ) ) {
94
  $url = 'http://formidablepro.com/frm-edd-api/licenses?l='. urlencode( base64_encode( $license['license'] ) );
95
  $licenses = self::send_api_request( $url, array( 'name' => 'frm_api_licence', 'expires' => 60 * 60 * 5 ) );
96
  echo json_encode( $licenses );
97
  }
98
+
99
  wp_die();
100
  }
101
 
classes/controllers/FrmAppController.php CHANGED
@@ -91,6 +91,8 @@ class FrmAppController {
91
  }
92
 
93
  public static function pro_get_started_headline() {
 
 
94
  // Don't display this error as we're upgrading the thing, or if the user shouldn't see the message
95
  if ( 'upgrade-plugin' == FrmAppHelper::simple_get( 'action', 'sanitize_title' ) || ! current_user_can( 'update_plugins' ) ) {
96
  return;
@@ -116,6 +118,27 @@ class FrmAppController {
116
  }
117
  }
118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  /**
120
  * If there are CURL problems on this server, wp_remote_post won't work for installing
121
  * Use a javascript fallback instead.
@@ -358,19 +381,16 @@ class FrmAppController {
358
  }
359
 
360
  public static function uninstall() {
 
361
  check_ajax_referer( 'frm_ajax', 'nonce' );
362
 
363
- if ( current_user_can( 'administrator' ) ) {
364
- $frmdb = new FrmDb();
365
- $frmdb->uninstall();
 
 
 
366
 
367
- //disable the plugin and redirect after uninstall so the tables don't get added right back
368
- deactivate_plugins( FrmAppHelper::plugin_folder() . '/formidable.php', false, false );
369
- echo esc_url_raw( admin_url( 'plugins.php?deactivate=true' ) );
370
- } else {
371
- $frm_settings = FrmAppHelper::get_settings();
372
- wp_die( $frm_settings->admin_permission );
373
- }
374
  wp_die();
375
  }
376
 
@@ -396,6 +416,7 @@ class FrmAppController {
396
  }
397
 
398
  public static function deauthorize() {
 
399
  check_ajax_referer( 'frm_ajax', 'nonce' );
400
 
401
  delete_option( 'frmpro-credentials' );
91
  }
92
 
93
  public static function pro_get_started_headline() {
94
+ self::maybe_show_upgrade_bar();
95
+
96
  // Don't display this error as we're upgrading the thing, or if the user shouldn't see the message
97
  if ( 'upgrade-plugin' == FrmAppHelper::simple_get( 'action', 'sanitize_title' ) || ! current_user_can( 'update_plugins' ) ) {
98
  return;
118
  }
119
  }
120
 
121
+ private static function maybe_show_upgrade_bar() {
122
+ $page = FrmAppHelper::simple_get( 'page', 'sanitize_title' );
123
+ if ( strpos( $page, 'formidable' ) !== 0 ) {
124
+ return;
125
+ }
126
+
127
+ if ( FrmAppHelper::pro_is_installed() ) {
128
+ return;
129
+ }
130
+
131
+ $affiliate = FrmAppHelper::get_affiliate();
132
+ if ( ! empty( $affiliate ) ) {
133
+ $tip = FrmTipsHelper::get_banner_tip();
134
+ ?>
135
+ <div class="update-nag frm-update-to-pro">
136
+ <?php echo FrmAppHelper::kses( $tip['tip'] ) ?> <span><?php echo FrmAppHelper::kses( $tip['call'] ) ?></span> <a href="<?php echo esc_url( FrmAppHelper::make_affiliate_url('https://formidablepro.com?banner=1&tip='. absint( $tip['num'] ) ) ) ?>" class="button">Upgrade to Pro</a>
137
+ </div>
138
+ <?php
139
+ }
140
+ }
141
+
142
  /**
143
  * If there are CURL problems on this server, wp_remote_post won't work for installing
144
  * Use a javascript fallback instead.
381
  }
382
 
383
  public static function uninstall() {
384
+ FrmAppHelper::permission_check('administrator');
385
  check_ajax_referer( 'frm_ajax', 'nonce' );
386
 
387
+ $frmdb = new FrmDb();
388
+ $frmdb->uninstall();
389
+
390
+ //disable the plugin and redirect after uninstall so the tables don't get added right back
391
+ deactivate_plugins( FrmAppHelper::plugin_folder() . '/formidable.php', false, false );
392
+ echo esc_url_raw( admin_url( 'plugins.php?deactivate=true' ) );
393
 
 
 
 
 
 
 
 
394
  wp_die();
395
  }
396
 
416
  }
417
 
418
  public static function deauthorize() {
419
+ FrmAppHelper::permission_check('frm_change_settings');
420
  check_ajax_referer( 'frm_ajax', 'nonce' );
421
 
422
  delete_option( 'frmpro-credentials' );
classes/controllers/FrmFieldsController.php CHANGED
@@ -3,6 +3,7 @@
3
  class FrmFieldsController {
4
 
5
  public static function load_field() {
 
6
  check_ajax_referer( 'frm_ajax', 'nonce' );
7
 
8
  $fields = $_POST['field'];
@@ -49,6 +50,7 @@ class FrmFieldsController {
49
  }
50
 
51
  public static function create() {
 
52
  check_ajax_referer( 'frm_ajax', 'nonce' );
53
 
54
  $field_type = FrmAppHelper::get_post_param( 'field', '', 'sanitize_text_field' );
@@ -84,6 +86,7 @@ class FrmFieldsController {
84
  }
85
 
86
  public static function update_form_id() {
 
87
  check_ajax_referer( 'frm_ajax', 'nonce' );
88
 
89
  $field_id = FrmAppHelper::get_post_param( 'field', 0, 'absint' );
@@ -100,6 +103,7 @@ class FrmFieldsController {
100
  }
101
 
102
  public static function edit_name( $field = 'name', $id = '' ) {
 
103
  check_ajax_referer( 'frm_ajax', 'nonce' );
104
 
105
  if ( empty($field) ) {
@@ -127,6 +131,7 @@ class FrmFieldsController {
127
  }
128
 
129
  public static function update_ajax_option() {
 
130
  check_ajax_referer( 'frm_ajax', 'nonce' );
131
 
132
  $field_id = FrmAppHelper::get_post_param( 'field', 0, 'absint' );
@@ -159,6 +164,7 @@ class FrmFieldsController {
159
  }
160
 
161
  public static function duplicate() {
 
162
  check_ajax_referer( 'frm_ajax', 'nonce' );
163
 
164
  global $wpdb;
@@ -208,6 +214,7 @@ class FrmFieldsController {
208
  }
209
 
210
  public static function destroy() {
 
211
  check_ajax_referer( 'frm_ajax', 'nonce' );
212
 
213
  $field_id = FrmAppHelper::get_post_param( 'field_id', 0, 'absint' );
@@ -219,6 +226,7 @@ class FrmFieldsController {
219
 
220
  //Add Single Option or Other Option
221
  public static function add_option() {
 
222
  check_ajax_referer( 'frm_ajax', 'nonce' );
223
 
224
  $id = FrmAppHelper::get_post_param( 'field_id', 0, 'absint' );
@@ -281,13 +289,14 @@ class FrmFieldsController {
281
  }
282
 
283
  public static function edit_option() {
 
284
  check_ajax_referer( 'frm_ajax', 'nonce' );
285
 
286
  $element_id = FrmAppHelper::get_post_param( 'element_id', '', 'sanitize_title' );
287
  $ids = explode( '-', $element_id );
288
  $id = FrmAppHelper::get_post_param( 'field_id', 0, 'absint' );
289
 
290
- $orig_update_value = $update_value = trim( FrmAppHelper::get_post_param( 'update_value' ) );
291
  if ( strpos( $element_id, 'key_' ) ) {
292
  $new_value = $update_value;
293
  } else {
@@ -299,7 +308,7 @@ class FrmFieldsController {
299
 
300
  $this_opt_id = end($ids);
301
  $this_opt = (array) $field->options[ $this_opt_id ];
302
- $other_opt = ( $this_opt_id && strpos( $this_opt_id, 'other') !== false ? true : false );
303
 
304
  $label = isset($this_opt['label']) ? $this_opt['label'] : reset($this_opt);
305
  $value = isset($this_opt['value']) ? $this_opt['value'] : '';
@@ -324,6 +333,7 @@ class FrmFieldsController {
324
  }
325
 
326
  public static function delete_option() {
 
327
  check_ajax_referer( 'frm_ajax', 'nonce' );
328
 
329
  $field_id = FrmAppHelper::get_post_param( 'field_id', 0, 'absint' );
@@ -366,9 +376,7 @@ class FrmFieldsController {
366
  }
367
 
368
  public static function import_choices() {
369
- if ( ! current_user_can( 'frm_edit_forms' ) ) {
370
- wp_die();
371
- }
372
 
373
  $field_id = absint( $_REQUEST['field_id'] );
374
 
@@ -413,6 +421,7 @@ class FrmFieldsController {
413
  }
414
 
415
  public static function import_options() {
 
416
  check_ajax_referer( 'frm_ajax', 'nonce' );
417
 
418
  if ( ! is_admin() || ! current_user_can('frm_edit_forms') ) {
@@ -474,7 +483,9 @@ class FrmFieldsController {
474
  }
475
 
476
  public static function update_order() {
 
477
  check_ajax_referer( 'frm_ajax', 'nonce' );
 
478
  $fields = FrmAppHelper::get_post_param( 'frm_field_id' );
479
  foreach ( (array) $fields as $position => $item ) {
480
  FrmField::update( absint( $item ), array( 'field_order' => absint( $position ) ) );
3
  class FrmFieldsController {
4
 
5
  public static function load_field() {
6
+ FrmAppHelper::permission_check('frm_edit_forms');
7
  check_ajax_referer( 'frm_ajax', 'nonce' );
8
 
9
  $fields = $_POST['field'];
50
  }
51
 
52
  public static function create() {
53
+ FrmAppHelper::permission_check('frm_edit_forms');
54
  check_ajax_referer( 'frm_ajax', 'nonce' );
55
 
56
  $field_type = FrmAppHelper::get_post_param( 'field', '', 'sanitize_text_field' );
86
  }
87
 
88
  public static function update_form_id() {
89
+ FrmAppHelper::permission_check('frm_edit_forms');
90
  check_ajax_referer( 'frm_ajax', 'nonce' );
91
 
92
  $field_id = FrmAppHelper::get_post_param( 'field', 0, 'absint' );
103
  }
104
 
105
  public static function edit_name( $field = 'name', $id = '' ) {
106
+ FrmAppHelper::permission_check('frm_edit_forms');
107
  check_ajax_referer( 'frm_ajax', 'nonce' );
108
 
109
  if ( empty($field) ) {
131
  }
132
 
133
  public static function update_ajax_option() {
134
+ FrmAppHelper::permission_check('frm_edit_forms');
135
  check_ajax_referer( 'frm_ajax', 'nonce' );
136
 
137
  $field_id = FrmAppHelper::get_post_param( 'field', 0, 'absint' );
164
  }
165
 
166
  public static function duplicate() {
167
+ FrmAppHelper::permission_check('frm_edit_forms');
168
  check_ajax_referer( 'frm_ajax', 'nonce' );
169
 
170
  global $wpdb;
214
  }
215
 
216
  public static function destroy() {
217
+ FrmAppHelper::permission_check('frm_edit_forms');
218
  check_ajax_referer( 'frm_ajax', 'nonce' );
219
 
220
  $field_id = FrmAppHelper::get_post_param( 'field_id', 0, 'absint' );
226
 
227
  //Add Single Option or Other Option
228
  public static function add_option() {
229
+ FrmAppHelper::permission_check('frm_edit_forms');
230
  check_ajax_referer( 'frm_ajax', 'nonce' );
231
 
232
  $id = FrmAppHelper::get_post_param( 'field_id', 0, 'absint' );
289
  }
290
 
291
  public static function edit_option() {
292
+ FrmAppHelper::permission_check('frm_edit_forms');
293
  check_ajax_referer( 'frm_ajax', 'nonce' );
294
 
295
  $element_id = FrmAppHelper::get_post_param( 'element_id', '', 'sanitize_title' );
296
  $ids = explode( '-', $element_id );
297
  $id = FrmAppHelper::get_post_param( 'field_id', 0, 'absint' );
298
 
299
+ $orig_update_value = $update_value = trim( FrmAppHelper::get_post_param( 'update_value', '', 'wp_kses_post' ) );
300
  if ( strpos( $element_id, 'key_' ) ) {
301
  $new_value = $update_value;
302
  } else {
308
 
309
  $this_opt_id = end($ids);
310
  $this_opt = (array) $field->options[ $this_opt_id ];
311
+ $other_opt = ( $this_opt_id && strpos( $this_opt_id, 'other') !== false );
312
 
313
  $label = isset($this_opt['label']) ? $this_opt['label'] : reset($this_opt);
314
  $value = isset($this_opt['value']) ? $this_opt['value'] : '';
333
  }
334
 
335
  public static function delete_option() {
336
+ FrmAppHelper::permission_check('frm_edit_forms');
337
  check_ajax_referer( 'frm_ajax', 'nonce' );
338
 
339
  $field_id = FrmAppHelper::get_post_param( 'field_id', 0, 'absint' );
376
  }
377
 
378
  public static function import_choices() {
379
+ FrmAppHelper::permission_check( 'frm_edit_forms', 'hide' );
 
 
380
 
381
  $field_id = absint( $_REQUEST['field_id'] );
382
 
421
  }
422
 
423
  public static function import_options() {
424
+ FrmAppHelper::permission_check('frm_edit_forms');
425
  check_ajax_referer( 'frm_ajax', 'nonce' );
426
 
427
  if ( ! is_admin() || ! current_user_can('frm_edit_forms') ) {
483
  }
484
 
485
  public static function update_order() {
486
+ FrmAppHelper::permission_check('frm_edit_forms');
487
  check_ajax_referer( 'frm_ajax', 'nonce' );
488
+
489
  $fields = FrmAppHelper::get_post_param( 'frm_field_id' );
490
  foreach ( (array) $fields as $position => $item ) {
491
  FrmField::update( absint( $item ), array( 'field_order' => absint( $position ) ) );
classes/controllers/FrmFormActionsController.php CHANGED
@@ -137,6 +137,7 @@ class FrmFormActionsController {
137
  }
138
 
139
  public static function add_form_action() {
 
140
  check_ajax_referer( 'frm_ajax', 'nonce' );
141
 
142
  global $frm_vars;
@@ -159,6 +160,7 @@ class FrmFormActionsController {
159
  }
160
 
161
  public static function fill_action() {
 
162
  check_ajax_referer( 'frm_ajax', 'nonce' );
163
 
164
  $action_key = absint( $_POST['action_id'] );
137
  }
138
 
139
  public static function add_form_action() {
140
+ FrmAppHelper::permission_check('frm_edit_forms');
141
  check_ajax_referer( 'frm_ajax', 'nonce' );
142
 
143
  global $frm_vars;
160
  }
161
 
162
  public static function fill_action() {
163
+ FrmAppHelper::permission_check('frm_edit_forms');
164
  check_ajax_referer( 'frm_ajax', 'nonce' );
165
 
166
  $action_key = absint( $_POST['action_id'] );
classes/controllers/FrmFormsController.php CHANGED
@@ -209,6 +209,7 @@ class FrmFormsController {
209
  * @since 2.0
210
  */
211
  public static function _create_from_template() {
 
212
  check_ajax_referer( 'frm_ajax', 'nonce' );
213
 
214
  $current_form = FrmAppHelper::get_param( 'this_form', '', 'get', 'absint' );
@@ -441,6 +442,7 @@ class FrmFormsController {
441
  }
442
 
443
  public static function get_shortcode_opts() {
 
444
  check_ajax_referer( 'frm_ajax', 'nonce' );
445
 
446
  $shortcode = FrmAppHelper::get_post_param( 'shortcode', '', 'sanitize_text_field' );
@@ -581,7 +583,7 @@ class FrmFormsController {
581
  }
582
 
583
  if ( $form->parent_form_id ) {
584
- wp_die( sprintf(__( 'You are trying to edit a child form. Please edit from %1$shere%2$s', 'formidable' ), '<a href="'. esc_url(admin_url('admin.php') .'?page=formidable&frm_action=edit&id='. $form->parent_form_id) .'">', '</a>' ));
585
  }
586
 
587
  $frm_field_selection = FrmField::field_selection();
@@ -729,6 +731,7 @@ class FrmFormsController {
729
  }
730
 
731
  public static function get_email_html() {
 
732
  check_ajax_referer( 'frm_ajax', 'nonce' );
733
  echo FrmEntryFormat::show_entry( array(
734
  'form_id' => FrmAppHelper::get_post_param( 'form_id', '', 'absint' ),
209
  * @since 2.0
210
  */
211
  public static function _create_from_template() {
212
+ FrmAppHelper::permission_check('frm_edit_forms');
213
  check_ajax_referer( 'frm_ajax', 'nonce' );
214
 
215
  $current_form = FrmAppHelper::get_param( 'this_form', '', 'get', 'absint' );
442
  }
443
 
444
  public static function get_shortcode_opts() {
445
+ FrmAppHelper::permission_check('frm_view_forms');
446
  check_ajax_referer( 'frm_ajax', 'nonce' );
447
 
448
  $shortcode = FrmAppHelper::get_post_param( 'shortcode', '', 'sanitize_text_field' );
583
  }
584
 
585
  if ( $form->parent_form_id ) {
586
+ wp_die( sprintf( __( 'You are trying to edit a child form. Please edit from %1$shere%2$s', 'formidable' ), '<a href="'. esc_url( admin_url( 'admin.php?page=formidable&frm_action=edit&id='. $form->parent_form_id ) ) . '">', '</a>' ));
587
  }
588
 
589
  $frm_field_selection = FrmField::field_selection();
731
  }
732
 
733
  public static function get_email_html() {
734
+ FrmAppHelper::permission_check('frm_view_forms');
735
  check_ajax_referer( 'frm_ajax', 'nonce' );
736
  echo FrmEntryFormat::show_entry( array(
737
  'form_id' => FrmAppHelper::get_post_param( 'form_id', '', 'absint' ),
classes/controllers/FrmStylesController.php CHANGED
@@ -55,11 +55,11 @@ class FrmStylesController {
55
  $version = FrmAppHelper::plugin_version();
56
  wp_enqueue_script( 'jquery-frm-themepicker', FrmAppHelper::plugin_url() . '/js/jquery/jquery-ui-themepicker.js', array( 'jquery' ), $version );
57
 
58
- wp_enqueue_style('frm-custom-theme', admin_url('admin-ajax.php') .'?action=frmpro_css');
59
 
60
  $style = apply_filters('frm_style_head', false);
61
  if ( $style ) {
62
- wp_enqueue_style('frm-single-custom-theme', admin_url('admin-ajax.php') .'?action=frmpro_load_css&flat=1&'. http_build_query($style->post_content));
63
  }
64
  }
65
 
@@ -116,7 +116,7 @@ class FrmStylesController {
116
  if ( is_readable( $uploads['basedir'] . $saved_css_path ) ) {
117
  $url = $uploads['baseurl'] . $saved_css_path;
118
  } else {
119
- $url = admin_url( 'admin-ajax.php' ) . '?action=frmpro_css';
120
  }
121
  $stylesheet_urls['formidable'] = $url;
122
  }
@@ -180,7 +180,7 @@ class FrmStylesController {
180
  $post_id = reset($id);
181
  }
182
  // include the CSS that includes this style
183
- echo '<link href="' . esc_url( admin_url( 'admin-ajax.php' ) . '?action=frmpro_css' ) . '" type="text/css" rel="Stylesheet" class="frm-custom-theme" />';
184
  $message = __( 'Your styling settings have been saved.', 'formidable' );
185
  }
186
 
@@ -297,6 +297,7 @@ class FrmStylesController {
297
  }
298
 
299
  public static function reset_styling() {
 
300
  check_ajax_referer( 'frm_ajax', 'nonce' );
301
 
302
  $frm_style = new FrmStyle();
55
  $version = FrmAppHelper::plugin_version();
56
  wp_enqueue_script( 'jquery-frm-themepicker', FrmAppHelper::plugin_url() . '/js/jquery/jquery-ui-themepicker.js', array( 'jquery' ), $version );
57
 
58
+ wp_enqueue_style( 'frm-custom-theme', admin_url('admin-ajax.php?action=frmpro_css' ) );
59
 
60
  $style = apply_filters('frm_style_head', false);
61
  if ( $style ) {
62
+ wp_enqueue_style( 'frm-single-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_load_css&flat=1' ) .'&'. http_build_query( $style->post_content ) );
63
  }
64
  }
65
 
116
  if ( is_readable( $uploads['basedir'] . $saved_css_path ) ) {
117
  $url = $uploads['baseurl'] . $saved_css_path;
118
  } else {
119
+ $url = admin_url( 'admin-ajax.php?action=frmpro_css' );
120
  }
121
  $stylesheet_urls['formidable'] = $url;
122
  }
180
  $post_id = reset($id);
181
  }
182
  // include the CSS that includes this style
183
+ echo '<link href="' . esc_url( admin_url( 'admin-ajax.php?action=frmpro_css' ) ) . '" type="text/css" rel="Stylesheet" class="frm-custom-theme" />';
184
  $message = __( 'Your styling settings have been saved.', 'formidable' );
185
  }
186
 
297
  }
298
 
299
  public static function reset_styling() {
300
+ FrmAppHelper::permission_check('frm_change_settings');
301
  check_ajax_referer( 'frm_ajax', 'nonce' );
302
 
303
  $frm_style = new FrmStyle();
classes/controllers/FrmXMLController.php CHANGED
@@ -51,7 +51,7 @@ class FrmXMLController {
51
  public static function form( $errors = array(), $message = '' ) {
52
  $where = array(
53
  'parent_form_id' => array( null, 0 ),
54
- 'status' => array( null, '', 'published' )
55
  );
56
  $forms = FrmForm::getAll( $where, 'name' );
57
 
@@ -355,7 +355,7 @@ class FrmXMLController {
355
  if ( ! is_array( $csv_field_ids ) ) {
356
  $csv_field_ids = explode( ',', $csv_field_ids );
357
  }
358
- if ( ! empty( $csv_field_ids ) ) {
359
  $where['fi.id'] = $csv_field_ids;
360
  }
361
  $csv_fields = FrmField::getAll( $where, 'field_order' );
51
  public static function form( $errors = array(), $message = '' ) {
52
  $where = array(
53
  'parent_form_id' => array( null, 0 ),
54
+ 'status' => array( null, '', 'published' ),
55
  );
56
  $forms = FrmForm::getAll( $where, 'name' );
57
 
355
  if ( ! is_array( $csv_field_ids ) ) {
356
  $csv_field_ids = explode( ',', $csv_field_ids );
357
  }
358
+ if ( ! empty( $csv_field_ids ) ) {
359
  $where['fi.id'] = $csv_field_ids;
360
  }
361
  $csv_fields = FrmField::getAll( $where, 'field_order' );
classes/helpers/FrmAppHelper.php CHANGED
@@ -10,7 +10,7 @@ class FrmAppHelper {
10
  /**
11
  * @since 2.0
12
  */
13
- public static $plug_version = '2.0.21';
14
 
15
  /**
16
  * @since 1.07.02
@@ -551,7 +551,7 @@ class FrmAppHelper {
551
  public static function post_edit_link( $post_id ) {
552
  $post = get_post($post_id);
553
  if ( $post ) {
554
- return '<a href="'. esc_url(admin_url('post.php') .'?post='. $post_id .'&action=edit') .'">'. self::truncate($post->post_title, 50) .'</a>';
555
  }
556
  return '';
557
  }
@@ -876,8 +876,7 @@ class FrmAppHelper {
876
  }
877
 
878
  if ( $user_id == 'current' ) {
879
- $user_ID = get_current_user_id();
880
- $user_id = $user_ID;
881
  } else {
882
  if ( is_email($user_id) ) {
883
  $user = get_user_by('email', $user_id);
@@ -910,10 +909,10 @@ class FrmAppHelper {
910
  /**
911
  * @param string $table_name
912
  * @param string $column
 
 
913
  */
914
- public static function get_unique_key( $name = '', $table_name, $column, $id = 0, $num_chars = 6 ) {
915
- global $wpdb;
916
-
917
  $key = '';
918
 
919
  if ( ! empty( $name ) ) {
@@ -954,8 +953,6 @@ class FrmAppHelper {
954
  return false;
955
  }
956
 
957
- global $frm_vars;
958
-
959
  if ( empty($post_values) ) {
960
  $post_values = stripslashes_deep($_POST);
961
  }
@@ -1296,7 +1293,7 @@ class FrmAppHelper {
1296
  'd' => array( __( 'day', 'formidable' ), __( 'days', 'formidable' ) ),
1297
  'h' => array( __( 'hour', 'formidable' ), __( 'hours', 'formidable' ) ),
1298
  'i' => array( __( 'minute', 'formidable' ), __( 'minutes', 'formidable' ) ),
1299
- 's' => array( __( 'second', 'formidable' ), __( 'seconds', 'formidable' ) )
1300
  );
1301
  }
1302
 
@@ -1773,10 +1770,10 @@ class FrmAppHelper {
1773
  }
1774
 
1775
  /**
 
1776
  * @since 1.07.10
1777
  *
1778
  * @param float $min_version The version the add-on requires
1779
- * @return echo The message on the plugins listing page
1780
  */
1781
  public static function min_version_notice( $min_version ) {
1782
  $frm_version = self::plugin_version();
10
  /**
11
  * @since 2.0
12
  */
13
+ public static $plug_version = '2.0.22';
14
 
15
  /**
16
  * @since 1.07.02
551
  public static function post_edit_link( $post_id ) {
552
  $post = get_post($post_id);
553
  if ( $post ) {
554
+ return '<a href="'. esc_url( admin_url('post.php?post='. $post_id .'&action=edit') ) .'">'. self::truncate( $post->post_title, 50 ) .'</a>';
555
  }
556
  return '';
557
  }
876
  }
877
 
878
  if ( $user_id == 'current' ) {
879
+ $user_id = get_current_user_id();
 
880
  } else {
881
  if ( is_email($user_id) ) {
882
  $user = get_user_by('email', $user_id);
909
  /**
910
  * @param string $table_name
911
  * @param string $column
912
+ * @param int $id
913
+ * @param int $num_chars
914
  */
915
+ public static function get_unique_key( $name = '', $table_name, $column, $id = 0, $num_chars = 5 ) {
 
 
916
  $key = '';
917
 
918
  if ( ! empty( $name ) ) {
953
  return false;
954
  }
955
 
 
 
956
  if ( empty($post_values) ) {
957
  $post_values = stripslashes_deep($_POST);
958
  }
1293
  'd' => array( __( 'day', 'formidable' ), __( 'days', 'formidable' ) ),
1294
  'h' => array( __( 'hour', 'formidable' ), __( 'hours', 'formidable' ) ),
1295
  'i' => array( __( 'minute', 'formidable' ), __( 'minutes', 'formidable' ) ),
1296
+ 's' => array( __( 'second', 'formidable' ), __( 'seconds', 'formidable' ) ),
1297
  );
1298
  }
1299
 
1770
  }
1771
 
1772
  /**
1773
+ * echo the message on the plugins listing page
1774
  * @since 1.07.10
1775
  *
1776
  * @param float $min_version The version the add-on requires
 
1777
  */
1778
  public static function min_version_notice( $min_version ) {
1779
  $frm_version = self::plugin_version();
classes/helpers/FrmCSVExportHelper.php CHANGED
@@ -172,7 +172,7 @@ class FrmCSVExportHelper{
172
  $field_value = isset( self::$entry->metas[ $col->id ] ) ? self::$entry->metas[ $col->id ] : false;
173
 
174
  $field_value = maybe_unserialize( $field_value );
175
- $field_value = apply_filters( 'frm_csv_value', $field_value, array( 'field' => $col, 'entry' => self::$entry, 'separator' => self::$separator, ) );
176
 
177
  if ( isset( $col->field_options['separate_value'] ) && $col->field_options['separate_value'] ) {
178
  $sep_value = FrmEntriesHelper::display_value( $field_value, $col, array(
@@ -303,4 +303,4 @@ class FrmCSVExportHelper{
303
  $value = str_replace( '"', '""', $value );
304
  return $value;
305
  }
306
- }
172
  $field_value = isset( self::$entry->metas[ $col->id ] ) ? self::$entry->metas[ $col->id ] : false;
173
 
174
  $field_value = maybe_unserialize( $field_value );
175
+ $field_value = apply_filters( 'frm_csv_value', $field_value, array( 'field' => $col, 'entry' => self::$entry, 'separator' => self::$separator ) );
176
 
177
  if ( isset( $col->field_options['separate_value'] ) && $col->field_options['separate_value'] ) {
178
  $sep_value = FrmEntriesHelper::display_value( $field_value, $col, array(
303
  $value = str_replace( '"', '""', $value );
304
  return $value;
305
  }
306
+ }
classes/helpers/FrmFormsHelper.php CHANGED
@@ -11,7 +11,7 @@ class FrmFormsHelper {
11
  }
12
 
13
  public static function get_direct_link( $key, $form = false ) {
14
- $target_url = esc_url(admin_url('admin-ajax.php') . '?action=frm_forms_preview&form='. $key);
15
  $target_url = apply_filters('frm_direct_link', $target_url, $key, $form);
16
 
17
  return $target_url;
@@ -551,7 +551,7 @@ BEFORE_HTML;
551
  }
552
 
553
  if ( $form_id ) {
554
- $val = '<a href="' . esc_url( admin_url( 'admin.php' ) . '?page=formidable&frm_action=edit&id=' . $form_id ) . '">' . ( '' == $name ? __( '(no title)' ) : FrmAppHelper::truncate( $name, 40 ) ) . '</a>';
555
  } else {
556
  $val = '';
557
  }
11
  }
12
 
13
  public static function get_direct_link( $key, $form = false ) {
14
+ $target_url = esc_url( admin_url( 'admin-ajax.php?action=frm_forms_preview&form='. $key ) );
15
  $target_url = apply_filters('frm_direct_link', $target_url, $key, $form);
16
 
17
  return $target_url;
551
  }
552
 
553
  if ( $form_id ) {
554
+ $val = '<a href="' . esc_url( admin_url( 'admin.php?page=formidable&frm_action=edit&id=' . $form_id ) ) . '">' . ( '' == $name ? __( '(no title)' ) : FrmAppHelper::truncate( $name, 40 ) ) . '</a>';
555
  } else {
556
  $val = '';
557
  }
classes/helpers/FrmFormsListHelper.php CHANGED
@@ -263,7 +263,7 @@ class FrmFormsListHelper extends FrmListHelper {
263
  $val = '<i class="frm_icon_font frm_forbid_icon frm_bstooltip" title="'. esc_attr('Entries are not being saved', 'formidable' ) .'"></i>';
264
  } else {
265
  $text = FrmEntry::getRecordCount($item->id);
266
- $val = (current_user_can('frm_view_entries')) ? '<a href="'. esc_url(admin_url('admin.php') .'?page=formidable-entries&form='. $item->id ) .'">'. $text .'</a>' : $text;
267
  unset($text);
268
  }
269
  break;
263
  $val = '<i class="frm_icon_font frm_forbid_icon frm_bstooltip" title="'. esc_attr('Entries are not being saved', 'formidable' ) .'"></i>';
264
  } else {
265
  $text = FrmEntry::getRecordCount($item->id);
266
+ $val = current_user_can('frm_view_entries') ? '<a href="'. esc_url( admin_url( 'admin.php?page=formidable-entries&form='. $item->id ) ) . '">' . $text . '</a>' : $text;
267
  unset($text);
268
  }
269
  break;
classes/helpers/FrmListHelper.php CHANGED
@@ -123,7 +123,7 @@ class FrmListHelper {
123
  if ( empty( $this->modes ) ) {
124
  $this->modes = array(
125
  'list' => __( 'List View' ),
126
- 'excerpt' => __( 'Excerpt View' )
127
  );
128
  }
129
  }
@@ -351,7 +351,7 @@ class FrmListHelper {
351
  return;
352
  }
353
 
354
- echo "<label for='bulk-action-selector-" . esc_attr( $which ) . "' class='screen-reader-text'>" . esc_attr__( 'Select bulk action' ) . "</label>";
355
  echo "<select name='action" . esc_attr( $two ) . "' id='bulk-action-selector-" . esc_attr( $which ) . "'>\n";
356
  echo "<option value='-1' selected='selected'>" . esc_attr__( 'Bulk Actions' ) . "</option>\n";
357
 
@@ -442,8 +442,10 @@ class FrmListHelper {
442
  <?php
443
  foreach ( $this->modes as $mode => $title ) {
444
  $classes = array( 'view-' . $mode );
445
- if ( $current_mode == $mode )
446
  $classes[] = 'current';
 
 
447
  printf(
448
  "<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",
449
  esc_url( add_query_arg( 'mode', $mode ) ),
@@ -1079,7 +1081,7 @@ class FrmListHelper {
1079
  'screen' => array(
1080
  'id' => $this->screen->id,
1081
  'base' => $this->screen->base,
1082
- )
1083
  );
1084
 
1085
  printf( "<script type='text/javascript'>list_args = %s;</script>\n", wp_json_encode( $args ) );
123
  if ( empty( $this->modes ) ) {
124
  $this->modes = array(
125
  'list' => __( 'List View' ),
126
+ 'excerpt' => __( 'Excerpt View' ),
127
  );
128
  }
129
  }
351
  return;
352
  }
353
 
354
+ echo "<label for='bulk-action-selector-" . esc_attr( $which ) . "' class='screen-reader-text'>" . esc_attr__( 'Select bulk action' ) . '</label>';
355
  echo "<select name='action" . esc_attr( $two ) . "' id='bulk-action-selector-" . esc_attr( $which ) . "'>\n";
356
  echo "<option value='-1' selected='selected'>" . esc_attr__( 'Bulk Actions' ) . "</option>\n";
357
 
442
  <?php
443
  foreach ( $this->modes as $mode => $title ) {
444
  $classes = array( 'view-' . $mode );
445
+ if ( $current_mode == $mode ) {
446
  $classes[] = 'current';
447
+ }
448
+
449
  printf(
450
  "<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",
451
  esc_url( add_query_arg( 'mode', $mode ) ),
1081
  'screen' => array(
1082
  'id' => $this->screen->id,
1083
  'base' => $this->screen->base,
1084
+ ),
1085
  );
1086
 
1087
  printf( "<script type='text/javascript'>list_args = %s;</script>\n", wp_json_encode( $args ) );
classes/helpers/FrmStylesHelper.php CHANGED
@@ -92,7 +92,6 @@ class FrmStylesHelper {
92
  <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-styles' ) ) ?>" class="nav-tab <?php echo ( '' == $active ) ? 'nav-tab-active' : '' ?>"><?php _e( 'Edit Styles', 'formidable' ) ?></a>
93
  <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-styles&frm_action=manage' ) ) ?>" class="nav-tab <?php echo ( 'manage' == $active ) ? 'nav-tab-active' : '' ?>"><?php _e( 'Manage Form Styles', 'formidable' ) ?></a>
94
  <a href="<?php echo esc_url( admin_url('admin.php?page=formidable-styles&frm_action=custom_css' ) ) ?>" class="nav-tab <?php echo ( 'custom_css' == $active ) ? 'nav-tab-active' : '' ?>"><?php _e( 'Custom CSS', 'formidable' ) ?></a>
95
- <?php FrmTipsHelper::pro_tip( 'get_styling_tip' ); ?>
96
  </h2>
97
  <?php
98
  }
92
  <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-styles' ) ) ?>" class="nav-tab <?php echo ( '' == $active ) ? 'nav-tab-active' : '' ?>"><?php _e( 'Edit Styles', 'formidable' ) ?></a>
93
  <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-styles&frm_action=manage' ) ) ?>" class="nav-tab <?php echo ( 'manage' == $active ) ? 'nav-tab-active' : '' ?>"><?php _e( 'Manage Form Styles', 'formidable' ) ?></a>
94
  <a href="<?php echo esc_url( admin_url('admin.php?page=formidable-styles&frm_action=custom_css' ) ) ?>" class="nav-tab <?php echo ( 'custom_css' == $active ) ? 'nav-tab-active' : '' ?>"><?php _e( 'Custom CSS', 'formidable' ) ?></a>
 
95
  </h2>
96
  <?php
97
  }
classes/helpers/FrmTipsHelper.php CHANGED
@@ -7,7 +7,9 @@ class FrmTipsHelper {
7
  return;
8
  }
9
 
10
- $tip = self::$callback();
 
 
11
  if ( $html == 'p' ) {
12
  echo '<p>';
13
  }
@@ -47,16 +49,22 @@ class FrmTipsHelper {
47
  'tip' => __( 'Cut down on back-and-forth with clients.', 'formidable' ),
48
  'call' => __( 'Allow file uploads in your form.', 'formidable' ),
49
  ),
 
 
 
 
 
50
  );
 
51
 
52
- return self::get_random_tip( $tips );
53
  }
54
 
55
  public static function get_form_settings_tip() {
56
  $tips = array(
57
  array(
58
  'link' => 'https://formidablepro.com/front-end-editing-tip',
59
- 'tip' => __( 'A site with dynamic, maintainable, user-generated content is within reach.', 'formidable' ),
60
  'call' => __( 'Add front-end editing.', 'formidable' ),
61
  ),
62
  array(
@@ -65,7 +73,7 @@ class FrmTipsHelper {
65
  'call' => __( 'Let logged-in users save a draft and return later.', 'formidable' ),
66
  ),
67
  );
68
- return self::get_random_tip( $tips );
69
  }
70
 
71
  public static function get_form_action_tip() {
@@ -77,32 +85,37 @@ class FrmTipsHelper {
77
  ),
78
  array(
79
  'link' => 'https://formidablepro.com/create-posts-tip',
80
- 'tip' => __( 'Allow anyone to create a blog post using your form.', 'formidable' ),
81
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
82
  ),
83
  array(
84
- 'link' => 'https://formidablepro.com/downloads/mailchimp/',
 
 
 
 
 
85
  'tip' => __( 'Grow your business with automated email follow-up.', 'formidable' ),
86
  'call' => __( 'Send leads straight to MailChimp.', 'formidable' ),
87
  ),
88
  array(
89
- 'link' => 'https://formidablepro.com/downloads/paypal-standard/',
90
  'tip' => __( 'Save hours and increase revenue by collecting payments with every submission.', 'formidable' ),
91
  'call' => __( 'Use PayPal with this form.', 'formidable' ),
92
  ),
93
  array(
94
- 'link' => 'https://formidablepro.com/downloads/registration-lite/',
95
  'tip' => __( 'Start building up your site membership.', 'formidable' ),
96
  'call' => __( 'Automatically create user accounts.', 'formidable' ),
97
  ),
98
  array(
99
- 'link' => 'https://formidablepro.com/downloads/twilio/',
100
  'tip' => __( 'Want a text when this form is submitted or when a payment is received?', 'formidable' ),
101
  'call' => __( 'Use Twilio with this form.', 'formidable' ),
102
  ),
103
  );
104
 
105
- return self::get_random_tip( $tips );
106
  }
107
 
108
  public static function get_styling_tip() {
@@ -113,7 +126,7 @@ class FrmTipsHelper {
113
  'call' => __( 'Use multiple stylesheets.', 'formidable' ),
114
  ),
115
  );
116
- return $tips[0];
117
  }
118
 
119
  public static function get_entries_tip() {
@@ -129,7 +142,8 @@ class FrmTipsHelper {
129
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
130
  ),
131
  );
132
- return self::get_random_tip( $tips );
 
133
  }
134
 
135
  public static function get_import_tip() {
@@ -140,7 +154,31 @@ class FrmTipsHelper {
140
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
141
  ),
142
  );
143
- return $tips[0];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  }
145
 
146
  public static function get_random_tip( $tips ) {
7
  return;
8
  }
9
 
10
+ $tips = self::$callback();
11
+ $tip = self::get_random_tip( $tips );
12
+
13
  if ( $html == 'p' ) {
14
  echo '<p>';
15
  }
49
  'tip' => __( 'Cut down on back-and-forth with clients.', 'formidable' ),
50
  'call' => __( 'Allow file uploads in your form.', 'formidable' ),
51
  ),
52
+ array(
53
+ 'link' => 'https://formidablepro.com/calculations-total-tip',
54
+ 'tip' => __( 'Need to calculate a total?', 'formidable' ),
55
+ 'call' => __( 'Upgrade to Pro.', 'formidable' ),
56
+ ),
57
  );
58
+ $tips = array_merge( $tips, self::get_form_settings_tip(), self::get_form_action_tip(), self::get_entries_tip() );
59
 
60
+ return $tips;
61
  }
62
 
63
  public static function get_form_settings_tip() {
64
  $tips = array(
65
  array(
66
  'link' => 'https://formidablepro.com/front-end-editing-tip',
67
+ 'tip' => __( 'A site with dynamic, user-generated content is within reach.', 'formidable' ),
68
  'call' => __( 'Add front-end editing.', 'formidable' ),
69
  ),
70
  array(
73
  'call' => __( 'Let logged-in users save a draft and return later.', 'formidable' ),
74
  ),
75
  );
76
+ return $tips;
77
  }
78
 
79
  public static function get_form_action_tip() {
85
  ),
86
  array(
87
  'link' => 'https://formidablepro.com/create-posts-tip',
88
+ 'tip' => __( 'Create blog posts or pages from the front-end.', 'formidable' ),
89
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
90
  ),
91
  array(
92
+ 'link' => 'https://formidablepro.com/front-end-posting-tip',
93
+ 'tip' => __( 'Make front-end posting easy.', 'formidable' ),
94
+ 'call' => __( 'Upgrade to Pro.', 'formidable' ),
95
+ ),
96
+ array(
97
+ 'link' => 'https://formidablepro.com/mailchimp-tip',
98
  'tip' => __( 'Grow your business with automated email follow-up.', 'formidable' ),
99
  'call' => __( 'Send leads straight to MailChimp.', 'formidable' ),
100
  ),
101
  array(
102
+ 'link' => 'https://formidablepro.com/paypal-tip',
103
  'tip' => __( 'Save hours and increase revenue by collecting payments with every submission.', 'formidable' ),
104
  'call' => __( 'Use PayPal with this form.', 'formidable' ),
105
  ),
106
  array(
107
+ 'link' => 'https://formidablepro.com/registration-tip',
108
  'tip' => __( 'Start building up your site membership.', 'formidable' ),
109
  'call' => __( 'Automatically create user accounts.', 'formidable' ),
110
  ),
111
  array(
112
+ 'link' => 'https://formidablepro.com/twilio-tip',
113
  'tip' => __( 'Want a text when this form is submitted or when a payment is received?', 'formidable' ),
114
  'call' => __( 'Use Twilio with this form.', 'formidable' ),
115
  ),
116
  );
117
 
118
+ return $tips;
119
  }
120
 
121
  public static function get_styling_tip() {
126
  'call' => __( 'Use multiple stylesheets.', 'formidable' ),
127
  ),
128
  );
129
+ return $tips;
130
  }
131
 
132
  public static function get_entries_tip() {
142
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
143
  ),
144
  );
145
+ $tips = array_merge( $tips, self::get_import_tip() );
146
+ return $tips;
147
  }
148
 
149
  public static function get_import_tip() {
154
  'call' => __( 'Upgrade to Pro.', 'formidable' ),
155
  ),
156
  );
157
+ return $tips;
158
+ }
159
+
160
+ public static function get_banner_tip() {
161
+ $tips = array(
162
+ array(
163
+ 'link' => 'https://formidablepro.com/',
164
+ 'tip' => __( 'Looking for more options to get professional results?', 'formidable' ),
165
+ 'call' => __( 'Take your forms to the next level.', 'formidable' ),
166
+ ),
167
+ array(
168
+ 'link' => 'https://formidablepro.com/',
169
+ 'tip' => __( 'Increase conversions in your long forms.', 'formidable' ),
170
+ 'call' => __( 'Add conditional logic, page breaks, and section headings.', 'formidable' ),
171
+ ),
172
+ array(
173
+ 'link' => 'https://formidablepro.com/',
174
+ 'tip' => __( 'Automate your business and increase revenue.', 'formidable' ),
175
+ 'call' => __( 'Collect instant payments, and send leads to MailChimp.', 'formidable' ),
176
+ ),
177
+ );
178
+ $random = rand( 0, count( $tips ) - 1 );
179
+ $tip = $tips[ $random ];
180
+ $tip['num'] = $random;
181
+ return $tip;
182
  }
183
 
184
  public static function get_random_tip( $tips ) {
classes/helpers/FrmXMLHelper.php CHANGED
@@ -385,7 +385,7 @@ class FrmXMLHelper {
385
  if ( ! isset( $form['options']['custom_style'] ) ) {
386
  return;
387
  }
388
-
389
  if ( is_numeric( $form['options']['custom_style'] ) ) {
390
  // Set to default
391
  $form['options']['custom_style'] = 1;
@@ -759,12 +759,25 @@ class FrmXMLHelper {
759
  return $str;
760
  }
761
 
 
 
762
  // $str = ent2ncr(esc_html($str));
763
  $str = '<![CDATA[' . str_replace( ']]>', ']]]]><![CDATA[>', $str ) . ']]>';
764
 
765
  return $str;
766
  }
767
 
 
 
 
 
 
 
 
 
 
 
 
768
  public static function migrate_form_settings_to_actions( $form_options, $form_id, &$imported = array(), $switch = false ) {
769
  // Get post type
770
  $post_type = FrmFormActionsController::$action_post_type;
385
  if ( ! isset( $form['options']['custom_style'] ) ) {
386
  return;
387
  }
388
+
389
  if ( is_numeric( $form['options']['custom_style'] ) ) {
390
  // Set to default
391
  $form['options']['custom_style'] = 1;
759
  return $str;
760
  }
761
 
762
+ self::remove_invalid_characters_from_xml( $str );
763
+
764
  // $str = ent2ncr(esc_html($str));
765
  $str = '<![CDATA[' . str_replace( ']]>', ']]]]><![CDATA[>', $str ) . ']]>';
766
 
767
  return $str;
768
  }
769
 
770
+ /**
771
+ * Remove <US> character (unit separator) from exported strings
772
+ *
773
+ * @since 2.0.22
774
+ * @param string $str
775
+ */
776
+ private static function remove_invalid_characters_from_xml( &$str ) {
777
+ // Remove <US> character
778
+ $str = str_replace( '\x1F', '', $str );
779
+ }
780
+
781
  public static function migrate_form_settings_to_actions( $form_options, $form_id, &$imported = array(), $switch = false ) {
782
  // Get post type
783
  $post_type = FrmFormActionsController::$action_post_type;
classes/models/FrmAddon.php CHANGED
@@ -157,6 +157,7 @@ class FrmAddon {
157
  }
158
 
159
  public static function activate() {
 
160
  check_ajax_referer( 'frm_ajax', 'nonce' );
161
 
162
  if ( ! isset( $_POST['license'] ) || empty( $_POST['license'] ) ) {
@@ -204,6 +205,7 @@ class FrmAddon {
204
  }
205
 
206
  public static function deactivate() {
 
207
  check_ajax_referer( 'frm_ajax', 'nonce' );
208
 
209
  $plugin_slug = sanitize_text_field( $_POST['plugin'] );
@@ -275,7 +277,7 @@ class FrmAddon {
275
  return $message;
276
  }
277
 
278
- public function manually_queue_update(){
279
  set_site_transient( 'update_plugins', null );
280
  }
281
  }
157
  }
158
 
159
  public static function activate() {
160
+ FrmAppHelper::permission_check('frm_change_settings');
161
  check_ajax_referer( 'frm_ajax', 'nonce' );
162
 
163
  if ( ! isset( $_POST['license'] ) || empty( $_POST['license'] ) ) {
205
  }
206
 
207
  public static function deactivate() {
208
+ FrmAppHelper::permission_check('frm_change_settings');
209
  check_ajax_referer( 'frm_ajax', 'nonce' );
210
 
211
  $plugin_slug = sanitize_text_field( $_POST['plugin'] );
277
  return $message;
278
  }
279
 
280
+ public function manually_queue_update() {
281
  set_site_transient( 'update_plugins', null );
282
  }
283
  }
classes/models/FrmEDD_SL_Plugin_Updater.php CHANGED
@@ -254,7 +254,7 @@ class FrmEDD_SL_Plugin_Updater {
254
  'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
255
  'slug' => $_REQUEST['slug'],
256
  'author' => $data['author'],
257
- 'url' => home_url()
258
  );
259
 
260
  $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
254
  'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
255
  'slug' => $_REQUEST['slug'],
256
  'author' => $data['author'],
257
+ 'url' => home_url(),
258
  );
259
 
260
  $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
classes/models/FrmEntryFormat.php CHANGED
@@ -79,11 +79,6 @@ class FrmEntryFormat {
79
  return;
80
  }
81
 
82
- //Remove signature from default-message shortcode
83
- if ( $f->type == 'signature' ) {
84
- return;
85
- }
86
-
87
  if ( $atts['entry'] && ! isset( $atts['entry']->metas[ $f->id ] ) ) {
88
  // In case include_blank is set
89
  $atts['entry']->metas[ $f->id ] = '';
@@ -118,8 +113,13 @@ class FrmEntryFormat {
118
  $val = implode( ', ', $val );
119
  }
120
 
 
 
121
  if ( $atts['format'] != 'text' ) {
122
  $values[ $f->field_key ] = $val;
 
 
 
123
  } else {
124
  $values[ $f->id ] = array( 'label' => $f->name, 'val' => $val );
125
  }
@@ -145,6 +145,22 @@ class FrmEntryFormat {
145
  }
146
  }
147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  public static function fill_entry_user_info( $atts, array &$values ) {
149
  if ( ! $atts['user_info'] || empty( $atts['entry'] ) ) {
150
  return;
79
  return;
80
  }
81
 
 
 
 
 
 
82
  if ( $atts['entry'] && ! isset( $atts['entry']->metas[ $f->id ] ) ) {
83
  // In case include_blank is set
84
  $atts['entry']->metas[ $f->id ] = '';
113
  $val = implode( ', ', $val );
114
  }
115
 
116
+ self::maybe_strip_html( $atts['plain_text'], $val );
117
+
118
  if ( $atts['format'] != 'text' ) {
119
  $values[ $f->field_key ] = $val;
120
+ if ( isset( $prev_val ) && $prev_val != $val && $f->type != 'textarea' ) {
121
+ $values[ $f->field_key .'-value' ] = $prev_val;
122
+ }
123
  } else {
124
  $values[ $f->id ] = array( 'label' => $f->name, 'val' => $val );
125
  }
145
  }
146
  }
147
 
148
+ /**
149
+ * Strip HTML if from email value if plain text is selected
150
+ *
151
+ * @since 2.0.21
152
+ * @param boolean $plain_text
153
+ * @param mixed $val
154
+ */
155
+ private static function maybe_strip_html( $plain_text, &$val ) {
156
+ if ( $plain_text && ! is_array( $val ) ) {
157
+ if ( strpos( $val, '<img' ) !== false ) {
158
+ $val = str_replace( array( '<img', 'src=', '/>', '"' ), '', $val );
159
+ }
160
+ $val = strip_tags( $val );
161
+ }
162
+ }
163
+
164
  public static function fill_entry_user_info( $atts, array &$values ) {
165
  if ( ! $atts['user_info'] || empty( $atts['entry'] ) ) {
166
  return;
classes/models/FrmField.php CHANGED
@@ -697,7 +697,7 @@ class FrmField {
697
  }
698
 
699
  public static function get_option_in_object( $field, $option ) {
700
- return $field->field_options[ $option ];
701
  }
702
 
703
  /**
697
  }
698
 
699
  public static function get_option_in_object( $field, $option ) {
700
+ return isset( $field->field_options[ $option ] ) ? $field->field_options[ $option ] : '';
701
  }
702
 
703
  /**
classes/views/addons/list.php CHANGED
@@ -1,5 +1,5 @@
1
  <div class="wrap">
2
- <h2><?php _e( 'Formidable AddOns', 'formidable' ) ?></h2>
3
 
4
  <div id="the-list" class="frm-addons">
5
  <?php foreach ( $addons as $addon ) {
@@ -46,4 +46,4 @@
46
  </div>
47
  <?php } ?>
48
  </div>
49
- </div>
1
  <div class="wrap">
2
+ <h1><?php _e( 'Formidable AddOns', 'formidable' ) ?></h1>
3
 
4
  <div id="the-list" class="frm-addons">
5
  <?php foreach ( $addons as $addon ) {
46
  </div>
47
  <?php } ?>
48
  </div>
49
+ </div>
classes/views/addons/upgrade_to_pro.php CHANGED
@@ -1,5 +1,12 @@
1
- <div class="wrap">
2
- <h2><?php _e( 'Upgrade to Pro', 'formidable' ) ?></h2>
 
 
 
 
 
 
 
3
 
4
  <table class="wp-list-table widefat fixed striped frm_pricing">
5
  <thead>
@@ -62,7 +69,7 @@
62
  <table class="wp-list-table widefat fixed striped">
63
  <thead>
64
  <tr>
65
- <th></th>
66
  <th><h3>Lite</h3></th>
67
  <th><h3>Pro</h3></th>
68
  </tr>
1
+ <div class="wrap upgrade_to_pro">
2
+ <h1 class="frm_pro_heading">Save time and make life easier. Upgrade to Pro.</h1>
3
+ <img src="<?php echo esc_url( FrmAppHelper::plugin_url() ) ?>/images/logo.png" alt="Upgrade to Pro" />
4
+
5
+ <div class="clear"></div>
6
+
7
+ <p>Enhance your basic Formidable forms with a plethora of Pro field types and features. Create advanced forms and data-driven applications in no time at all.</p>
8
+ <p>Are you collecting data offline? Streamline your business by using your forms to get online. Whether you need surveys, polls, client contracts, mortgage calculators, or directories, we've got you covered. Save time by allowing clients to return and make changes to their own submissions, or let them contribute content to your site. Generate more leads by adding headings and page breaks, only showing the fields you need, and letting your clients repeat a section of fields as many times as they need.</p>
9
+ <p>Projects that once seemed impossible are within your reach with Pro. That project you’ve been dreaming of pursuing? Chances are <strong>Formidable Pro can handle it</strong>.</p>
10
 
11
  <table class="wp-list-table widefat fixed striped frm_pricing">
12
  <thead>
69
  <table class="wp-list-table widefat fixed striped">
70
  <thead>
71
  <tr>
72
+ <th style="width:60%"></th>
73
  <th><h3>Lite</h3></th>
74
  <th><h3>Pro</h3></th>
75
  </tr>
classes/views/frm-entries/list.php CHANGED
@@ -1,8 +1,8 @@
1
  <div id="form_entries_page" class="wrap">
2
  <div class="frmicon icon32"><br/></div>
3
- <h2><?php _e( 'Entries', 'formidable' ); ?>
4
  <?php do_action('frm_entry_inside_h2', $form); ?>
5
- </h2>
6
 
7
  <?php require(FrmAppHelper::plugin_path() .'/classes/views/shared/errors.php'); ?>
8
 
1
  <div id="form_entries_page" class="wrap">
2
  <div class="frmicon icon32"><br/></div>
3
+ <h1><?php _e( 'Entries', 'formidable' ); ?>
4
  <?php do_action('frm_entry_inside_h2', $form); ?>
5
+ </h1>
6
 
7
  <?php require(FrmAppHelper::plugin_path() .'/classes/views/shared/errors.php'); ?>
8
 
classes/views/frm-settings/form.php CHANGED
@@ -1,6 +1,6 @@
1
  <div id="form_global_settings" class="wrap">
2
  <div class="frmicon icon32"><br/></div>
3
- <h2><?php _e( 'Global Settings', 'formidable' ); ?></h2>
4
 
5
  <?php require(FrmAppHelper::plugin_path() .'/classes/views/shared/errors.php'); ?>
6
 
1
  <div id="form_global_settings" class="wrap">
2
  <div class="frmicon icon32"><br/></div>
3
+ <h1><?php _e( 'Global Settings', 'formidable' ); ?></h1>
4
 
5
  <?php require(FrmAppHelper::plugin_path() .'/classes/views/shared/errors.php'); ?>
6
 
classes/views/styles/_form-description.php CHANGED
@@ -14,4 +14,4 @@
14
  <div class="field-group clearfix frm-half">
15
  <label><?php _e( 'Margin Bottom', 'formidable' ) ?></label>
16
  <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_margin_bottom') ) ?>" id="frm_form_desc_margin_bottom" value="<?php echo esc_attr( $style->post_content['form_desc_margin_bottom'] ) ?>" size="4" />
17
- </div>
14
  <div class="field-group clearfix frm-half">
15
  <label><?php _e( 'Margin Bottom', 'formidable' ) ?></label>
16
  <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('form_desc_margin_bottom') ) ?>" id="frm_form_desc_margin_bottom" value="<?php echo esc_attr( $style->post_content['form_desc_margin_bottom'] ) ?>" size="4" />
17
+ </div>
classes/views/styles/_form-title.php CHANGED
@@ -14,4 +14,4 @@
14
  <div class="field-group clearfix frm-half">
15
  <label><?php _e( 'Margin Bottom', 'formidable' ) ?></label>
16
  <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_margin_bottom') ) ?>" id="frm_title_margin_bottom" value="<?php echo esc_attr( $style->post_content['title_margin_bottom'] ) ?>" size="4" />
17
- </div>
14
  <div class="field-group clearfix frm-half">
15
  <label><?php _e( 'Margin Bottom', 'formidable' ) ?></label>
16
  <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_margin_bottom') ) ?>" id="frm_title_margin_bottom" value="<?php echo esc_attr( $style->post_content['title_margin_bottom'] ) ?>" size="4" />
17
+ </div>
classes/views/styles/show.php CHANGED
@@ -11,7 +11,7 @@
11
  <input type="hidden" name="frm_action" value="save" />
12
  <textarea name="<?php echo esc_attr( $frm_style->get_field_name('custom_css') ) ?>" class="frm_hidden"><?php echo FrmAppHelper::esc_textarea( $style->post_content['custom_css'] ) ?></textarea>
13
  <?php wp_nonce_field( 'frm_style_nonce', 'frm_style' ); ?>
14
-
15
  <div id="nav-menus-frame">
16
  <div id="menu-settings-column" class="metabox-holder">
17
  <div class="clear"></div>
11
  <input type="hidden" name="frm_action" value="save" />
12
  <textarea name="<?php echo esc_attr( $frm_style->get_field_name('custom_css') ) ?>" class="frm_hidden"><?php echo FrmAppHelper::esc_textarea( $style->post_content['custom_css'] ) ?></textarea>
13
  <?php wp_nonce_field( 'frm_style_nonce', 'frm_style' ); ?>
14
+ <?php FrmTipsHelper::pro_tip( 'get_styling_tip', 'p' ); ?>
15
  <div id="nav-menus-frame">
16
  <div id="menu-settings-column" class="metabox-holder">
17
  <div class="clear"></div>
classes/views/xml/import_form.php CHANGED
@@ -1,6 +1,6 @@
1
  <div class="wrap">
2
  <div class="frmicon icon32"><br/></div>
3
- <h2><?php _e( 'Import/Export', 'formidable' ); ?></h2>
4
 
5
  <?php include(FrmAppHelper::plugin_path() .'/classes/views/shared/errors.php'); ?>
6
  <div id="poststuff" class="metabox-holder">
1
  <div class="wrap">
2
  <div class="frmicon icon32"><br/></div>
3
+ <h1><?php _e( 'Import/Export', 'formidable' ); ?></h1>
4
 
5
  <?php include(FrmAppHelper::plugin_path() .'/classes/views/shared/errors.php'); ?>
6
  <div id="poststuff" class="metabox-holder">
css/frm_admin.css CHANGED
@@ -280,6 +280,49 @@ form label.frm_primary_label input{font-size:12px;}
280
  margin-top:10px;
281
  }
282
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  .widefat.frm_pricing thead th,
284
  .widefat.frm_pricing td{
285
  text-align:center;
@@ -320,9 +363,27 @@ form label.frm_primary_label input{font-size:12px;}
320
  color:#666;
321
  }
322
 
 
323
  .frm_pro_tip span,
324
  .frm_pro_tip .frm_check1_icon{
325
- color:#0073aa;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
326
  }
327
 
328
  .nav-tab-wrapper .frm_pro_tip{
@@ -334,7 +395,7 @@ form label.frm_primary_label input{font-size:12px;}
334
  }
335
 
336
  .frm_pro_tip:hover span{
337
- color:#00a0d2;
338
  }
339
 
340
  /*Switch form dropdown*/
280
  margin-top:10px;
281
  }
282
 
283
+ .update-nag.frm-update-to-pro{
284
+ display:block;
285
+ text-align:center;
286
+ border:1px solid #EE4210;
287
+ border-radius:4px;
288
+ background:#EF7E59;
289
+ color:#fff;
290
+ font-size:19px;
291
+ line-height:2.1em;
292
+ margin-top:30px;
293
+ }
294
+
295
+ .update-nag.frm-update-to-pro span{
296
+ font-weight:100;
297
+ }
298
+
299
+ .update-nag.frm-update-to-pro a{
300
+ color:#fff;
301
+ font-size:18px;
302
+ height:auto;
303
+ margin:0 15px;
304
+ background-color:#d55a1e;
305
+ box-shadow: 0 1px 0 #BB3E01;
306
+ border-color:transparent;
307
+ padding:7px 15px;
308
+ }
309
+
310
+ .update-nag.frm-update-to-pro a:hover{
311
+ background-color:#d55a1e;
312
+ color:#fff;
313
+ border:1px solid #BB3E01;
314
+ }
315
+
316
+ .frm_pro_heading{
317
+ position:absolute;
318
+ left:285px;
319
+ line-height: 2.3em !important;
320
+ }
321
+
322
+ .upgrade_to_pro .frm_check_icon{
323
+ color:#468847;
324
+ }
325
+
326
  .widefat.frm_pricing thead th,
327
  .widefat.frm_pricing td{
328
  text-align:center;
363
  color:#666;
364
  }
365
 
366
+ .frm_pro_tip a,
367
  .frm_pro_tip span,
368
  .frm_pro_tip .frm_check1_icon{
369
+ color:#EF7E59;
370
+ }
371
+
372
+ .frm_pro_tip .frm_check1_icon{
373
+ vertical-align: middle;
374
+ }
375
+
376
+ .frm_pro_tip{
377
+ border:1px solid #EF7E59;
378
+ display:block;
379
+ padding:2px 5px 0;
380
+ background:#FBF0EC;
381
+ border-radius:4px;
382
+ text-align:center;
383
+ }
384
+
385
+ .frm_field_list .frm_pro_tip{
386
+ margin-top:-14px;
387
  }
388
 
389
  .nav-tab-wrapper .frm_pro_tip{
395
  }
396
 
397
  .frm_pro_tip:hover span{
398
+ color:#F0430E;
399
  }
400
 
401
  /*Switch form dropdown*/
formidable.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
- Version: 2.0.21
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
2
  /*
3
  Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
+ Version: 2.0.22
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
images/logo.png ADDED
Binary file
js/formidable.js CHANGED
@@ -412,7 +412,7 @@ function frmFrontFormJS(){
412
 
413
  } else {
414
  // If text field on the current page
415
- fieldValue = jQuery('input[name="'+ f.inputName +'"]').val();
416
  }
417
 
418
  if ( typeof fieldValue === 'undefined' ) {
412
 
413
  } else {
414
  // If text field on the current page
415
+ fieldValue = jQuery('input[name="'+ f.inputName +'"], textarea[name="'+ f.inputName +'"]').val();
416
  }
417
 
418
  if ( typeof fieldValue === 'undefined' ) {
js/formidable.min.js CHANGED
@@ -8,30 +8,30 @@ typeof e.attr("id")&&(B=e.attr("id"),d=!0));e={};k=0;for(g=f.length;k<g;k++)if(l
8
  q=void 0,r=0;r<n.DynamicInfoIndices.length;r++)q=n.DynamicInfoIndices[r],t=p[n.hideContainerID][q].f.FieldName,S(p[n.hideContainerID][q],t,m)}else T(m,n)}d&&(B="")}}}function u(a,b,c,d){b.inputName="item_meta["+b.FieldName+"]";b.hiddenName="item_meta["+b.HideField+"]";b.containerID="frm_field_"+b.FieldName+"_container";b.hideContainerID="frm_field_"+b.HideField+"_container";b.Value=b.Value.trim();if(""!==B)d=B,K(b.FieldName)&&(b.inputName=L(b.FieldName,d),b.containerID=U(b.FieldName,d)),b.hideContainerID=
9
  U(b.HideField,d),d=w(b),z(b),G(a,b,d),H(a,b,c);else{if("undefined"===typeof d||null===d)if(d=jQuery('input[name^="'+b.inputName+'"], textarea[name^="'+b.inputName+'"], select[name^="'+b.inputName+'"]'),1>d.length){d=document.getElementsByClassName("frm_field_"+b.FieldName+"_container");for(var f=0;f<d.length;f++){b.inputName=L(b.FieldName,d[f].id);b.containerID=d[f].id;b.hideContainerID=d[f].id.replace(b.FieldName,b.HideField);var e=w(b);z(b);G(a,b,e);H(a,b,c)}return}d=w(b);if(K(b.HideField))for(f=
10
  document.getElementsByClassName("frm_field_"+b.HideField+"_container"),e=0;e<f.length;e++)b.hideContainerID=f[e].id,z(b),G(a,b,d),H(a,b,c);else z(b),G(a,b,d),H(a,b,c)}}function w(a){var b="";if("checkbox"===a.Type||"data-checkbox"===a.Type)return a=ka(a.containerID,a.inputName),b=a.length?a:"";b=jQuery('input[name="'+a.inputName+'"][type="hidden"]').val();"undefined"===typeof b&&(b="radio"==a.Type||"data-radio"===a.Type?jQuery('input[name="'+a.inputName+'"]:checked').val():"select"===a.Type||"data-select"===
11
- a.Type?jQuery('select[name^="'+a.inputName+'"]').val():jQuery('input[name="'+a.inputName+'"]').val());"undefined"===typeof b&&(b="");"string"===typeof b&&(b=b.trim());return b}function z(a){"undefined"===typeof p[a.hideContainerID]&&(p[a.hideContainerID]=[])}function G(a,b,c){p[b.hideContainerID][a]=null===c||""===c||1>c.length?!1:{funcName:"getDataOpts",f:b,sel:c};if("checkbox"===b.Type||"data-checkbox"===b.Type&&"undefined"===typeof b.LinkedField){var d=p[b.hideContainerID][a]=!1;if(""!==c){"!="===
12
- b.Condition&&(p[b.hideContainerID][a]=!0);for(var f=0;f<c.length;f++)d=C(b.Condition,b.Value,c[f]),"!="===b.Condition?!0===p[b.hideContainerID][a]&&!1===d&&(p[b.hideContainerID][a]=!1):!1===p[b.hideContainerID][a]&&d&&(p[b.hideContainerID][a]=!0)}else d=C(b.Condition,b.Value,""),!1===p[b.hideContainerID][a]&&d&&(p[b.hideContainerID][a]=!0)}else if("undefined"!==typeof b.LinkedField&&0===b.Type.indexOf("data-")){if("undefined"===typeof b.DataType||"data"===b.DataType)""===c?V(b,"hide"):"data-radio"===
13
- b.Type?p[b.hideContainerID][a]="undefined"===typeof b.DataType?C(b.Condition,b.Value,c):{funcName:"getData",f:b,sel:c}:(!(d="data-checkbox"===b.Type)&&(d="data-select"===b.Type)&&(d=jQuery.isArray(c)&&(1<c.length||""!==c[0])),d?(V(b,"show"),p[b.hideContainerID][a]=!0,W(b,c,0)):"data-select"===b.Type&&(p[b.hideContainerID][a]={funcName:"getData",f:b,sel:c}))}else"undefined"===typeof b.Value&&0===b.Type.indexOf("data")?(b.Value=""===c?"1":c,p[b.hideContainerID][a]=C(b.Condition,b.Value,c),b.Value=void 0):
14
- p[b.hideContainerID][a]=C(b.Condition,b.Value,c)}function H(a,b,c){if("all"===b.MatchType||!1===p[b.hideContainerID][a])b.hideContainerID in D||(D[b.hideContainerID]={show:b.Show,match:b.MatchType,FieldName:b.FieldName,HideField:b.HideField,hideContainerID:b.hideContainerID,FormId:b.FormId,DynamicInfoIndices:[]}),b=b.hideContainerID,c=!1,!1!==p[b][a]&&!0!==p[b][a]&&(c=a),!1!==c&&D[b].DynamicInfoIndices.push(c);else{var d=jQuery(document.getElementById(b.hideContainerID));"show"===b.Show?!0!==p[b.hideContainerID][a]?
15
- S(p[b.hideContainerID][a],b.FieldName,c):R(d,b):T(d,b)}}function T(a,b){if(a.length){a.hide();var c=X(a);c.length&&Y(c)}else c=Z(b.HideField,b.hideContainerID),c=jQuery('input[name^="'+c+'"]'),Y(c);aa(b.hideContainerID,b.FormId)}function Y(a){a.prop("checked",!1).prop("selectedIndex",0);a.not(":checkbox, :radio, select").val("");var b=!1;a.each(function(){"SELECT"==this.tagName&&null!==document.getElementById(this.id+"_chosen")&&jQuery(this).trigger("chosen:updated");(!1===b||0>["checkbox","radio"].indexOf(this.type))&&
16
- E(jQuery(this));b=!0})}function aa(a,b){var c=M(b);-1<c.indexOf(a)||(c.push(a),F["form_"+b]=c,c=JSON.stringify(c),document.getElementById("frm_hide_fields_"+b).value=c)}function M(a){var b=[];"undefined"!==typeof F["form_"+a]?b=F["form_"+a]:(b=(b=document.getElementById("frm_hide_fields_"+a).value)?JSON.parse(b):[],F["form_"+a]=b);return b}function V(a,b){if(-1===M(a.FormId).indexOf(a.hideContainerID)){var c=jQuery(document.getElementById(a.hideContainerID));"hide"===b&&(c.hide(),aa(a.hideContainerID,
17
- a.FormId));c.find(".frm_opt_container").empty()}}function R(a,b){var c=!1;if(a.hasClass("frm_section_heading")||a.hasClass("frm_embed_form_container"))c=!0;var c={inSection:c,formId:b.FormId},d=b.hideContainerID,f=b.FormId,e=M(f),d=e.indexOf(d);-1<d&&(e.splice(d,1),F["form_"+f]=e,e=JSON.stringify(e),document.getElementById("frm_hide_fields_"+f).value=e);a.length?(f=X(a),ba(f,c),a.show()):(f=Z(b.HideField,b.hideContainerID),f=jQuery('input[name^="'+f+'"]'),ba(f,c))}function ba(a,b){if(a.length){b.valSet=
18
- !1;b.isHidden=!1;for(var c=0;c<a.length;c++){var d=a,f=c,e=b,k=!1;if(0===f||d[f-1].name!=d[f].name){var g;if(g=e.inSection)a:{var h=d[f];g=e;var l=!1;if("undefined"!==typeof h.name){l=void 0;h=h.name.replace(/\]/g,"").split("[");if(4>h.length){if(3==h.length&&"form"==h[2]){g=!0;break a}l="frm_field_"+h[1]+"_container"}else{if(0==h[3]){g=!0;break a}l="frm_field_"+h[3]+"-"+h[1]+"-"+h[2]+"_container"}var h=l,l=!1,n=void 0;"undefined"!==typeof g.hiddenFields?n=g.hiddenFields:(n=document.getElementById("frm_hide_fields_"+
19
- g.formId).value,g.hiddenFields=n);n&&(n=JSON.parse(n),-1<n.indexOf(h)&&(l=!0))}else l=!0;g=l}if(g)e.isHidden=!0,e.valSet=!1;else{e.isHidden=!1;g=e;f=d[f];d=!1;if("checkbox"==f.type||"radio"==f.type)for(f=document.getElementsByName(f.name),h=f.length,l=0;l<h;l++){if(f[l].checked){d=!0;break}}else f.value&&(d=!0);g.valSet=d}}if(e.valSet||e.isHidden)k=!0;if(!0!==k){e=jQuery(a[c]);if(d=e.length)for(k=0;k<d;k++)if(f=jQuery(e[k]),g=f.data("frmval"),"undefined"!==typeof g)if(!f.is(":checkbox, :radio"))f.val(g),
20
- E(f);else if(f.val()==g||jQuery.isArray(g)&&-1!==jQuery.inArray(f.val(),g))f.prop("checked",!0),E(f);e=a[c];if(k="undefined"!==typeof __FRMCALC){k=e.type;d=!1;if("text"==k||"hidden"==k||"number"==k)d=!0;k=d}if(k){k=__FRMCALC;d=e.name;f=e.id.replace("field_","");if(N(d))for(d=f.split("-"),f="",g=0;g<d.length-1;g++)f=""===f?d[g]:f+"-"+d[g];d=f;f=null;N(e.name)&&(f="hidden"!=e.type?jQuery(e).closest(".frm_form_field"):jQuery(e));e=f;void 0!==k.calc[d]&&ca(k,d,[],e)}}}}}function E(a,b){"undefined"===
21
- typeof b&&(b="dependent");1<a.length&&(a=a.eq(0));a.trigger({type:"change",selfTriggered:!0,frmTriggered:b})}function C(a,b,c){"undefined"===typeof c&&(c="");jQuery.isArray(c)&&-1<jQuery.inArray(b,c)&&(c=b);-1!==String(b).search(/^\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*$/)&&(b=parseFloat(b),c=parseFloat(c));return"-1"!=String(b).indexOf("&quot;")&&C(a,b.replace("&quot;",'"'),c)?!0:{"==":function(a,b){return a==b},"!=":function(a,b){return a!=b},"<":function(a,b){return a>b},">":function(a,b){return a<
22
- b},LIKE:function(a,b){if(!b)return!1;b=da(b);a=ea(a);return-1!=b.indexOf(a)},"not LIKE":function(a,b){if(!b)return!0;b=da(b);a=ea(a);return-1==b.indexOf(a)}}[a](b,c)}function da(a){"string"===typeof a?a=a.toLowerCase():"number"===typeof a&&(a=a.toString());return a}function ea(a){"string"===typeof a&&(a=a.toLowerCase());return a}function S(a,b,c){"getDataOpts"==a.funcName?la(a.f,a.sel,b,c):"getData"==a.funcName&&W(a.f,a.sel,0)}function W(a,b,c){var d=document.getElementById(a.hideContainerID),f=jQuery(d).find(".frm_opt_container");
23
- if(0===f.length)return!0;c||f.html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_get_data",entry_id:b,field_id:a.LinkedField,current_field:a.HideField,hide_id:a.hideContainerID,nonce:frm_js.nonce},success:function(a){c?f.append(a):f.html(a);var b=f.children("input"),g=b.val();d.style.display=""===a&&!c||""===g?"none":"";E(b);return!0}})}function la(a,b,c,d){if(!("stop"==d&&-1<jQuery.inArray(a.HideField,O)&&a.parentField&&"hidden"==
24
- a.parentField.attr("type"))){var f=jQuery("#"+a.hideContainerID).find('select[name^="item_meta"], textarea[name^="item_meta"], input[name^="item_meta"]'),e=ma(f),k=f.data("frmval");if("select"!=a.DataType||"stop"!=d&&!jQuery("#"+a.hideContainerID+" .frm-loading-img").length||!(-1<jQuery.inArray(a.HideField,O))){O.push(a.HideField);var g=document.getElementById(a.hideContainerID);if(null!==g){var h=jQuery(g).find(".frm_opt_container");if(0===h.length&&f.length)return r(a.HideField,"stop",f),!1;if(""!==
25
- a.Value&&!C(a.Condition,a.Value,b))return g.style.display="none",h.html(""),r(a.HideField,"stop",f),!1;h.html('<span class="frm-loading-img" style="visibility:visible;display:inline;"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_data_options",trigger_field_id:c,entry_id:b,linked_field_id:a.LinkedField,field_id:a.HideField,default_value:k,container_id:a.hideContainerID,prev_val:e,nonce:frm_js.nonce},success:function(b){h.html(b);var c=h.find("select, input, textarea");
26
- ""===b||1==c.length&&"hidden"==c.attr("type")?g.style.display="none":"all"!=a.MatchType&&(g.style.display="");c.hasClass("frm_chzn")&&jQuery().chosen&&jQuery(".frm_chzn").chosen({allow_single_deselect:!0});E(c)}})}}}}function ma(a){var b=[],c="";a.each(function(){c=this.value;"radio"===this.type||"checkbox"===this.type?!0===this.checked&&b.push(c):""!==c&&b.push(c)});0===b.length&&(b="");return b}function J(a,b){if("undefined"!==typeof __FRMCALC){var c=__FRMCALC,d=c.fields[a];if("undefined"!==typeof d)for(var d=
27
- d.total,f=[],e=0,k=d.length;e<k;e++){var g;var h=c.calc[d[e]],l=b.attr("name");g=h.field_id;var n=h.form_id;if(h=document.getElementById("frm_hide_fields_"+n).value){var h=JSON.parse(h),m=g;N(l)&&(l=l.replace("item_meta","").replace(/\[/g,"").split("]"),m=g+"-"+l[0]+"-"+l[1]);-1<h.indexOf("frm_field_"+m+"_container")?g=!0:(l=void 0,g=(l=n=(n=document.getElementById("frm_helpers_"+n).value)?JSON.parse(n):[])&&null!==l[g]&&-1<h.indexOf("frm_field_"+l[g]+"_container")?!0:!1)}else g=!1;g||ca(c,d[e],f,
28
- b)}}}function N(a){var b=!1;4<=a.split("[").length&&(b=!0);return b}function ca(a,b,c,d){var f=a.calc[b],e=f.calc,k=jQuery(document.getElementById("field_"+b)),g={triggerField:d,inSection:!1,thisFieldCall:'input[id^="field_'+b+'-"]'};1>k.length&&"undefined"!==typeof d&&(g.inSection=!0,g.thisFieldId=na(a.fieldsWithCalc,b),k=fa(g));e=oa(f,e,a,c,g);a=f.calc_dec;e.indexOf(").toFixed(")&&(c=e.split(").toFixed("),ga(c[1])&&(a=c[1],e=e.replace(").toFixed("+a,"")));e=parseFloat(eval(e));"undefined"===typeof e&&
29
- (e=0);ga(a)&&(e=e.toFixed(a));k.val()!=e&&(k.val(e),E(k,b))}function oa(a,b,c,d,f){for(var e=0,k=a.fields.length;e<k;e++){var g={triggerField:f.triggerField,thisFieldId:a.fields[e],inSection:f.inSection,valKey:f.inSection+""+a.fields[e],thisField:c.fields[a.fields[e]],thisFieldCall:"input"+c.fieldKeys[a.fields[e]]},h=c;"checkbox"==g.thisField.type||"select"==g.thisField.type?g.thisFieldCall=g.thisFieldCall+":checked,select"+h.fieldKeys[g.thisFieldId]+" option:selected,"+g.thisFieldCall+"[type=hidden]":
30
- "radio"==g.thisField.type||"scale"==g.thisField.type?g.thisFieldCall=g.thisFieldCall+":checked,"+g.thisFieldCall+"[type=hidden]":"textarea"==g.thisField.type&&(g.thisFieldCall=g.thisFieldCall+",textarea"+h.fieldKeys[g.thisFieldId]);d=pa(g,c,d);if("undefined"===typeof d[g.valKey]||isNaN(d[g.valKey]))d[g.valKey]=0;h="["+g.thisFieldId+"]";h=h.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");b=b.replace(new RegExp(h,"g"),d[g.valKey])}return b}function pa(a,b,c){if("undefined"!==typeof c[a.valKey]&&0!==c[a.valKey])return c;
31
- c[a.valKey]=0;var d;if(!1===a.inSection)d=jQuery(a.thisFieldCall);else if(d=fa(a),null===d||"undefined"===typeof d)d=jQuery(a.thisFieldCall);if(null===d||"undefined"===typeof d||1>d.length)return c;d.each(function(){var d,e=a.thisField;d=!1;if("hidden"==this.type)""!==P(this)&&(d=!0);else if("select"==e.type){var k=this.className;k&&-1<k.indexOf("frm_other_trigger")&&(d=!0)}else("checkbox"==e.type||"radio"==e.type)&&-1<this.id.indexOf("-other_")&&0>this.id.indexOf("-otext")&&(d=!0);d?(d=0,"select"==
32
- e.type?"hidden"==this.type?(e=!1,2<this.name.split("[").length&&(e=!0),e||(d=P(this))):d=jQuery(this).closest(".frm_other_container").find(".frm_other_input").val():"checkbox"!=e.type&&"radio"!=e.type||"hidden"==this.type||(d=P(this)),e=d):e="checkbox"!==this.type&&"radio"!==this.type||!this.checked?jQuery(this).val():this.value;"undefined"===typeof e&&(e="");d=e;if("date"==a.thisField.type){e=b.date;k=0;if(d)if("undefined"===typeof jQuery.datepicker){k="-";-1<e.indexOf("/")&&(k="/");e=e.split(k);
33
- d=d.split(k);var g,h;g=k=h="";for(var l=0;l<e.length;l++)if("y"==e[l])g=((new Date).getFullYear()+15).toString().substr(2,2),g=d[l]>g?"19"+d[l]:"20"+d[l];else if("yy"==e[l])g=d[l];else if("m"==e[l]||"mm"==e[l])k=d[l],2>k.length&&(k="0"+k);else if("d"==e[l]||"dd"==e[l])h=d[l],2>h.length&&(h="0"+h);k=Date.parse(g+"-"+k+"-"+h)}else k=jQuery.datepicker.parseDate(e,d);e=k;null!==e&&(c[a.valKey]=Math.ceil(e/864E5))}else{e=d;""!==e&&0!==e&&(e=e.trim(),e=parseFloat(e.replace(/,/g,"").match(/-?[\d\.]+$/)));
34
- if("undefined"===typeof e||isNaN(e)||""===e)e=0;c[a.valKey]+=e}});return c}function fa(a){if("undefined"===typeof a.triggerField)return null;var b=a.triggerField.closest(".frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid");return b.length?(a=a.thisFieldCall.replace("[id=","[id^="),b.find(a)):null}function P(a){var b="";a=document.getElementById(a.id+"-otext");null!==a&&""!==a.value&&(b=a.value);return b}function qa(a,b){jQuery(a).find('input[type="submit"], input[type="button"]').attr("disabled",
35
  "disabled");jQuery(a).find(".frm_ajax_loading").addClass("frm_loading_now");"undefined"==typeof b&&jQuery(a).find('input[name="frm_action"]').val();jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:jQuery(a).serialize()+"&action=frm_entries_"+b+"&nonce="+frm_js.nonce,success:function(b){b=b.replace(/^\s+|\s+$/g,"");0===b.indexOf("{")&&(b=jQuery.parseJSON(b));if(""===b||!b||"0"===b||"object"!=typeof b&&0===b.indexOf("<!DOCTYPE")){var d=document.getElementById("frm_loading");null!==d&&(b=jQuery(a).find("input[type=file]").val(),
36
  "undefined"!=typeof b&&""!==b&&setTimeout(function(){jQuery(d).fadeIn("slow")},2E3));b=jQuery(a).find(".g-recaptcha");b.length&&(1>jQuery(a).find(".frm_next_page").length||1>jQuery(a).find(".frm_next_page").val())&&b.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">');a.submit()}else if("object"!=typeof b){jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");var f=jQuery(a).find('input[name="form_id"]').val();jQuery(a).closest("#frm_form_"+
37
  f+"_container").replaceWith(b);frmFrontForm.scrollMsg(f);if("function"==typeof frmThemeOverride_frmAfterSubmit){var f=jQuery('input[name="frm_page_order_'+f+'"]').val(),e=jQuery(b).find('input[name="form_id"]').val();frmThemeOverride_frmAfterSubmit(e,f,b,a)}b=jQuery(a).find('input[name="id"]');b.length&&jQuery(document.getElementById("frm_edit_"+b.val())).find("a").addClass("frm_ajax_edited").click()}else{jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");
@@ -53,12 +53,12 @@ a.html(e)}});return!1}function Da(){var a=jQuery(this),b=a.data("entryid"),c=a.d
53
  a.replaceWith('<span class="frm-loading-img" id="frm_delete_'+c+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:c,nonce:frm_js.nonce},success:function(a){"success"==a.replace(/^\s+|\s+$/g,"")?(jQuery(document.getElementById(d+c)).fadeOut("slow"),jQuery(document.getElementById("frm_delete_"+c)).fadeOut("slow")):jQuery(document.getElementById("frm_delete_"+c)).replaceWith(a)}})}return!1}function ya(a){a.fadeOut("slow",function(){a.remove()})}function Fa(){var a=
54
  jQuery(this).data("frmconfirm");return confirm(a)}function Ga(){var a=jQuery(this).data("frmtoggle");jQuery(a).is(":visible")?jQuery(a).slideUp("fast"):jQuery(a).slideDown("fast");return!1}function na(a,b){for(var c in a)if(a.hasOwnProperty(c)&&a[c]===b)return c;return null}function ga(a){return!jQuery.isArray(a)&&0<=a-parseFloat(a)+1}function X(a){return a.find('select[name^="item_meta"], textarea[name^="item_meta"], input[name^="item_meta"]')}function Z(a,b){var c="item_meta["+a+"]";K(a)&&(c=L(a,
55
  b));return c}function L(a,b){var c="";-1<b.indexOf("frm_section")?(c=b.replace("frm_section_","").split("-"),c="item_meta["+c[0]+"]["+c[1]+"]["+a+"]"):(c=b.replace("frm_field_","").replace("_container","").split("-"),c="item_meta["+c[1]+"]["+c[2]+"]["+a+"]");return c}function U(a,b){var c=b.replace("frm_section_","").split("-");return"frm_field_"+a+"-"+c[0]+"-"+c[1]+"_container"}function K(a){var b=document.getElementById("frm_field_"+a+"_container");return"undefined"!==typeof b&&null!==b?!1:1>jQuery('input[name^="item_meta['+
56
- a+']"],select[name^="item_meta['+a+']"], textarea[name^="item_meta['+a+']"]').length?!0:!1}function Ha(){Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c=this.length>>>0,d=Number(b)||0,d=0>d?Math.ceil(d):Math.floor(d);for(0>d&&(d+=c);d<c;d++)if(d in this&&this[d]===a)return d;return-1})}function Ia(){"function"!==typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")})}function Ja(){Array.prototype.filter||(Array.prototype.filter=
57
- function(a,b){if(void 0===this||null===this)throw new TypeError;var c=Object(this),d=c.length>>>0;if("function"!==typeof a)throw new TypeError;for(var f=[],e=0;e<d;e++)if(e in c){var k=c[e];a.call(b,k,e,c)&&f.push(k)}return f})}function Ka(){Object.keys||(Object.keys=function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b})}function ka(a,b){var c=[];if("undefined"==typeof document.querySelector)jQuery("#"+a+' input[type=checkbox]:checked, input[type=hidden][name^="'+b+'"]').each(function(){c.push(this.value)});
58
  else for(var d=document.querySelectorAll("#"+a+' input[type=checkbox], input[type=hidden][name^="'+b+'"]'),f=0;f<d.length;f++)("checkbox"==d[f].type&&d[f].checked||"hidden"==d[f].type)&&c.push(d[f].value);return c}var p=[],D={},F=[],O=[],B="",I=!1,Q="",A=[];return{init:function(){jQuery(document).on("click",".frm_trigger",q);var a=jQuery(".frm_blank_field");a.length&&a.closest(".frm_toggle_container").prev(".frm_trigger").click();jQuery.isFunction(jQuery.fn.placeholder)?jQuery(".frm-show-form input, .frm-show-form textarea").placeholder():
59
  jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){""===jQuery(this).val()&&jQuery(this).blur()});jQuery(document).on("focus",".frm_toggle_default",ra);jQuery(document).on("blur",".frm_toggle_default",sa);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(ta);jQuery(document).on("change",".frm_multiple_file",wa);jQuery(document).on("click",".frm_clear_file_link",za);jQuery(document).on("click",".frm_remove_link",xa);
60
  jQuery(document).on("focusin","input[data-frmmask]",function(){jQuery(this).mask(jQuery(this).data("frmmask").toString())});jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',x);jQuery(document).on("click",'.frm-show-form input[type="submit"], .frm-show-form input[name="frm_prev_page"], .frm-show-form .frm_save_draft',m);jQuery(document).on("change",'.frm_other_container input[type="checkbox"], .frm_other_container input[type="radio"], .frm_other_container select',
61
- v);jQuery(document).on("change","input[type=file].frm_transparent",t);jQuery(document).on("click",".frm_remove_form_row",Aa);jQuery(document).on("click",".frm_add_form_row",Ba);jQuery(document).on("click","a[data-frmconfirm]",Fa);jQuery("a[data-frmtoggle]").click(Ga);jQuery(".frm_edit_link_container").on("click","a.frm_inplace_edit",Ca);jQuery(".frm_edit_link_container").on("click","a.frm_cancel_edit",Da);jQuery(".frm_ajax_delete").click(Ea);jQuery(".frm_month_heading, .frm_year_heading").click(function(){var a=
62
  jQuery(this).children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s");a.hasClass("ui-icon-triangle-1-e")?(a.addClass("ui-icon-triangle-1-s").removeClass("ui-icon-triangle-1-e"),jQuery(this).next(".frm_toggle_container").fadeIn("slow")):(a.addClass("ui-icon-triangle-1-e").removeClass("ui-icon-triangle-1-s"),jQuery(this).next(".frm_toggle_container").hide())});Ha();Ia();Ja();Ka()},submitForm:function(a){a.preventDefault();a=frmFrontForm.validateFormSubmit(this);0===Object.keys(a).length&&frmFrontForm.checkFormErrors(this,
63
  Q)},validateFormSubmit:function(a){jQuery(this).find(".wp-editor-wrap").length&&"undefined"!=typeof tinyMCE&&tinyMCE.triggerSave();Q=jQuery(a).find('input[name="frm_action"]').val();A=[];frmFrontForm.getAjaxFormErrors(a);Object.keys(A).length&&frmFrontForm.addAjaxFormErrors(a);return A},getAjaxFormErrors:function(a){A=[];if("function"==typeof frmThemeOverride_jsErrors&&(a=frmThemeOverride_jsErrors(Q,a),Object.keys(a).length))for(var b in a)A[b]=a[b];return A},addAjaxFormErrors:function(a){jQuery(".form-field").removeClass("frm_blank_field");
64
  jQuery(".form-field .frm_error").replaceWith("");for(var b in A){var c=jQuery(a).find(jQuery("#frm_field_"+b+"_container"));ha(c,b,A)}},checkFormErrors:function(a,b){qa(a,b)},scrollToID:function(a){a=jQuery(document.getElementById(a).offset());window.scrollTo(a.left,a.top)},scrollMsg:function(a,b,c){var d="";if(d="undefined"==typeof b?jQuery(document.getElementById("frm_form_"+a+"_container")).offset().top:jQuery(b).find("#frm_field_"+a+"_container").offset().top){d-=frm_js.offset;a=jQuery("html").css("margin-top");
8
  q=void 0,r=0;r<n.DynamicInfoIndices.length;r++)q=n.DynamicInfoIndices[r],t=p[n.hideContainerID][q].f.FieldName,S(p[n.hideContainerID][q],t,m)}else T(m,n)}d&&(B="")}}}function u(a,b,c,d){b.inputName="item_meta["+b.FieldName+"]";b.hiddenName="item_meta["+b.HideField+"]";b.containerID="frm_field_"+b.FieldName+"_container";b.hideContainerID="frm_field_"+b.HideField+"_container";b.Value=b.Value.trim();if(""!==B)d=B,K(b.FieldName)&&(b.inputName=L(b.FieldName,d),b.containerID=U(b.FieldName,d)),b.hideContainerID=
9
  U(b.HideField,d),d=w(b),z(b),G(a,b,d),H(a,b,c);else{if("undefined"===typeof d||null===d)if(d=jQuery('input[name^="'+b.inputName+'"], textarea[name^="'+b.inputName+'"], select[name^="'+b.inputName+'"]'),1>d.length){d=document.getElementsByClassName("frm_field_"+b.FieldName+"_container");for(var f=0;f<d.length;f++){b.inputName=L(b.FieldName,d[f].id);b.containerID=d[f].id;b.hideContainerID=d[f].id.replace(b.FieldName,b.HideField);var e=w(b);z(b);G(a,b,e);H(a,b,c)}return}d=w(b);if(K(b.HideField))for(f=
10
  document.getElementsByClassName("frm_field_"+b.HideField+"_container"),e=0;e<f.length;e++)b.hideContainerID=f[e].id,z(b),G(a,b,d),H(a,b,c);else z(b),G(a,b,d),H(a,b,c)}}function w(a){var b="";if("checkbox"===a.Type||"data-checkbox"===a.Type)return a=ka(a.containerID,a.inputName),b=a.length?a:"";b=jQuery('input[name="'+a.inputName+'"][type="hidden"]').val();"undefined"===typeof b&&(b="radio"==a.Type||"data-radio"===a.Type?jQuery('input[name="'+a.inputName+'"]:checked').val():"select"===a.Type||"data-select"===
11
+ a.Type?jQuery('select[name^="'+a.inputName+'"]').val():jQuery('input[name="'+a.inputName+'"], textarea[name="'+a.inputName+'"]').val());"undefined"===typeof b&&(b="");"string"===typeof b&&(b=b.trim());return b}function z(a){"undefined"===typeof p[a.hideContainerID]&&(p[a.hideContainerID]=[])}function G(a,b,c){p[b.hideContainerID][a]=null===c||""===c||1>c.length?!1:{funcName:"getDataOpts",f:b,sel:c};if("checkbox"===b.Type||"data-checkbox"===b.Type&&"undefined"===typeof b.LinkedField){var d=p[b.hideContainerID][a]=
12
+ !1;if(""!==c){"!="===b.Condition&&(p[b.hideContainerID][a]=!0);for(var f=0;f<c.length;f++)d=C(b.Condition,b.Value,c[f]),"!="===b.Condition?!0===p[b.hideContainerID][a]&&!1===d&&(p[b.hideContainerID][a]=!1):!1===p[b.hideContainerID][a]&&d&&(p[b.hideContainerID][a]=!0)}else d=C(b.Condition,b.Value,""),!1===p[b.hideContainerID][a]&&d&&(p[b.hideContainerID][a]=!0)}else if("undefined"!==typeof b.LinkedField&&0===b.Type.indexOf("data-")){if("undefined"===typeof b.DataType||"data"===b.DataType)""===c?V(b,
13
+ "hide"):"data-radio"===b.Type?p[b.hideContainerID][a]="undefined"===typeof b.DataType?C(b.Condition,b.Value,c):{funcName:"getData",f:b,sel:c}:(!(d="data-checkbox"===b.Type)&&(d="data-select"===b.Type)&&(d=jQuery.isArray(c)&&(1<c.length||""!==c[0])),d?(V(b,"show"),p[b.hideContainerID][a]=!0,W(b,c,0)):"data-select"===b.Type&&(p[b.hideContainerID][a]={funcName:"getData",f:b,sel:c}))}else"undefined"===typeof b.Value&&0===b.Type.indexOf("data")?(b.Value=""===c?"1":c,p[b.hideContainerID][a]=C(b.Condition,
14
+ b.Value,c),b.Value=void 0):p[b.hideContainerID][a]=C(b.Condition,b.Value,c)}function H(a,b,c){if("all"===b.MatchType||!1===p[b.hideContainerID][a])b.hideContainerID in D||(D[b.hideContainerID]={show:b.Show,match:b.MatchType,FieldName:b.FieldName,HideField:b.HideField,hideContainerID:b.hideContainerID,FormId:b.FormId,DynamicInfoIndices:[]}),b=b.hideContainerID,c=!1,!1!==p[b][a]&&!0!==p[b][a]&&(c=a),!1!==c&&D[b].DynamicInfoIndices.push(c);else{var d=jQuery(document.getElementById(b.hideContainerID));
15
+ "show"===b.Show?!0!==p[b.hideContainerID][a]?S(p[b.hideContainerID][a],b.FieldName,c):R(d,b):T(d,b)}}function T(a,b){if(a.length){a.hide();var c=X(a);c.length&&Y(c)}else c=Z(b.HideField,b.hideContainerID),c=jQuery('input[name^="'+c+'"]'),Y(c);aa(b.hideContainerID,b.FormId)}function Y(a){a.prop("checked",!1).prop("selectedIndex",0);a.not(":checkbox, :radio, select").val("");var b=!1;a.each(function(){"SELECT"==this.tagName&&null!==document.getElementById(this.id+"_chosen")&&jQuery(this).trigger("chosen:updated");
16
+ (!1===b||0>["checkbox","radio"].indexOf(this.type))&&E(jQuery(this));b=!0})}function aa(a,b){var c=M(b);-1<c.indexOf(a)||(c.push(a),F["form_"+b]=c,c=JSON.stringify(c),document.getElementById("frm_hide_fields_"+b).value=c)}function M(a){var b=[];"undefined"!==typeof F["form_"+a]?b=F["form_"+a]:(b=(b=document.getElementById("frm_hide_fields_"+a).value)?JSON.parse(b):[],F["form_"+a]=b);return b}function V(a,b){if(-1===M(a.FormId).indexOf(a.hideContainerID)){var c=jQuery(document.getElementById(a.hideContainerID));
17
+ "hide"===b&&(c.hide(),aa(a.hideContainerID,a.FormId));c.find(".frm_opt_container").empty()}}function R(a,b){var c=!1;if(a.hasClass("frm_section_heading")||a.hasClass("frm_embed_form_container"))c=!0;var c={inSection:c,formId:b.FormId},d=b.hideContainerID,f=b.FormId,e=M(f),d=e.indexOf(d);-1<d&&(e.splice(d,1),F["form_"+f]=e,e=JSON.stringify(e),document.getElementById("frm_hide_fields_"+f).value=e);a.length?(f=X(a),ba(f,c),a.show()):(f=Z(b.HideField,b.hideContainerID),f=jQuery('input[name^="'+f+'"]'),
18
+ ba(f,c))}function ba(a,b){if(a.length){b.valSet=!1;b.isHidden=!1;for(var c=0;c<a.length;c++){var d=a,f=c,e=b,k=!1;if(0===f||d[f-1].name!=d[f].name){var g;if(g=e.inSection)a:{var h=d[f];g=e;var l=!1;if("undefined"!==typeof h.name){l=void 0;h=h.name.replace(/\]/g,"").split("[");if(4>h.length){if(3==h.length&&"form"==h[2]){g=!0;break a}l="frm_field_"+h[1]+"_container"}else{if(0==h[3]){g=!0;break a}l="frm_field_"+h[3]+"-"+h[1]+"-"+h[2]+"_container"}var h=l,l=!1,n=void 0;"undefined"!==typeof g.hiddenFields?
19
+ n=g.hiddenFields:(n=document.getElementById("frm_hide_fields_"+g.formId).value,g.hiddenFields=n);n&&(n=JSON.parse(n),-1<n.indexOf(h)&&(l=!0))}else l=!0;g=l}if(g)e.isHidden=!0,e.valSet=!1;else{e.isHidden=!1;g=e;f=d[f];d=!1;if("checkbox"==f.type||"radio"==f.type)for(f=document.getElementsByName(f.name),h=f.length,l=0;l<h;l++){if(f[l].checked){d=!0;break}}else f.value&&(d=!0);g.valSet=d}}if(e.valSet||e.isHidden)k=!0;if(!0!==k){e=jQuery(a[c]);if(d=e.length)for(k=0;k<d;k++)if(f=jQuery(e[k]),g=f.data("frmval"),
20
+ "undefined"!==typeof g)if(!f.is(":checkbox, :radio"))f.val(g),E(f);else if(f.val()==g||jQuery.isArray(g)&&-1!==jQuery.inArray(f.val(),g))f.prop("checked",!0),E(f);e=a[c];if(k="undefined"!==typeof __FRMCALC){k=e.type;d=!1;if("text"==k||"hidden"==k||"number"==k)d=!0;k=d}if(k){k=__FRMCALC;d=e.name;f=e.id.replace("field_","");if(N(d))for(d=f.split("-"),f="",g=0;g<d.length-1;g++)f=""===f?d[g]:f+"-"+d[g];d=f;f=null;N(e.name)&&(f="hidden"!=e.type?jQuery(e).closest(".frm_form_field"):jQuery(e));e=f;void 0!==
21
+ k.calc[d]&&ca(k,d,[],e)}}}}}function E(a,b){"undefined"===typeof b&&(b="dependent");1<a.length&&(a=a.eq(0));a.trigger({type:"change",selfTriggered:!0,frmTriggered:b})}function C(a,b,c){"undefined"===typeof c&&(c="");jQuery.isArray(c)&&-1<jQuery.inArray(b,c)&&(c=b);-1!==String(b).search(/^\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*$/)&&(b=parseFloat(b),c=parseFloat(c));return"-1"!=String(b).indexOf("&quot;")&&C(a,b.replace("&quot;",'"'),c)?!0:{"==":function(a,b){return a==b},"!=":function(a,b){return a!=
22
+ b},"<":function(a,b){return a>b},">":function(a,b){return a<b},LIKE:function(a,b){if(!b)return!1;b=da(b);a=ea(a);return-1!=b.indexOf(a)},"not LIKE":function(a,b){if(!b)return!0;b=da(b);a=ea(a);return-1==b.indexOf(a)}}[a](b,c)}function da(a){"string"===typeof a?a=a.toLowerCase():"number"===typeof a&&(a=a.toString());return a}function ea(a){"string"===typeof a&&(a=a.toLowerCase());return a}function S(a,b,c){"getDataOpts"==a.funcName?la(a.f,a.sel,b,c):"getData"==a.funcName&&W(a.f,a.sel,0)}function W(a,
23
+ b,c){var d=document.getElementById(a.hideContainerID),f=jQuery(d).find(".frm_opt_container");if(0===f.length)return!0;c||f.html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_get_data",entry_id:b,field_id:a.LinkedField,current_field:a.HideField,hide_id:a.hideContainerID,nonce:frm_js.nonce},success:function(a){c?f.append(a):f.html(a);var b=f.children("input"),g=b.val();d.style.display=""===a&&!c||""===g?"none":"";E(b);return!0}})}
24
+ function la(a,b,c,d){if(!("stop"==d&&-1<jQuery.inArray(a.HideField,O)&&a.parentField&&"hidden"==a.parentField.attr("type"))){var f=jQuery("#"+a.hideContainerID).find('select[name^="item_meta"], textarea[name^="item_meta"], input[name^="item_meta"]'),e=ma(f),k=f.data("frmval");if("select"!=a.DataType||"stop"!=d&&!jQuery("#"+a.hideContainerID+" .frm-loading-img").length||!(-1<jQuery.inArray(a.HideField,O))){O.push(a.HideField);var g=document.getElementById(a.hideContainerID);if(null!==g){var h=jQuery(g).find(".frm_opt_container");
25
+ if(0===h.length&&f.length)return r(a.HideField,"stop",f),!1;if(""!==a.Value&&!C(a.Condition,a.Value,b))return g.style.display="none",h.html(""),r(a.HideField,"stop",f),!1;h.html('<span class="frm-loading-img" style="visibility:visible;display:inline;"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_fields_ajax_data_options",trigger_field_id:c,entry_id:b,linked_field_id:a.LinkedField,field_id:a.HideField,default_value:k,container_id:a.hideContainerID,prev_val:e,nonce:frm_js.nonce},
26
+ success:function(b){h.html(b);var c=h.find("select, input, textarea");""===b||1==c.length&&"hidden"==c.attr("type")?g.style.display="none":"all"!=a.MatchType&&(g.style.display="");c.hasClass("frm_chzn")&&jQuery().chosen&&jQuery(".frm_chzn").chosen({allow_single_deselect:!0});E(c)}})}}}}function ma(a){var b=[],c="";a.each(function(){c=this.value;"radio"===this.type||"checkbox"===this.type?!0===this.checked&&b.push(c):""!==c&&b.push(c)});0===b.length&&(b="");return b}function J(a,b){if("undefined"!==
27
+ typeof __FRMCALC){var c=__FRMCALC,d=c.fields[a];if("undefined"!==typeof d)for(var d=d.total,f=[],e=0,k=d.length;e<k;e++){var g;var h=c.calc[d[e]],l=b.attr("name");g=h.field_id;var n=h.form_id;if(h=document.getElementById("frm_hide_fields_"+n).value){var h=JSON.parse(h),m=g;N(l)&&(l=l.replace("item_meta","").replace(/\[/g,"").split("]"),m=g+"-"+l[0]+"-"+l[1]);-1<h.indexOf("frm_field_"+m+"_container")?g=!0:(l=void 0,g=(l=n=(n=document.getElementById("frm_helpers_"+n).value)?JSON.parse(n):[])&&null!==
28
+ l[g]&&-1<h.indexOf("frm_field_"+l[g]+"_container")?!0:!1)}else g=!1;g||ca(c,d[e],f,b)}}}function N(a){var b=!1;4<=a.split("[").length&&(b=!0);return b}function ca(a,b,c,d){var f=a.calc[b],e=f.calc,k=jQuery(document.getElementById("field_"+b)),g={triggerField:d,inSection:!1,thisFieldCall:'input[id^="field_'+b+'-"]'};1>k.length&&"undefined"!==typeof d&&(g.inSection=!0,g.thisFieldId=na(a.fieldsWithCalc,b),k=fa(g));e=oa(f,e,a,c,g);a=f.calc_dec;e.indexOf(").toFixed(")&&(c=e.split(").toFixed("),ga(c[1])&&
29
+ (a=c[1],e=e.replace(").toFixed("+a,"")));e=parseFloat(eval(e));"undefined"===typeof e&&(e=0);ga(a)&&(e=e.toFixed(a));k.val()!=e&&(k.val(e),E(k,b))}function oa(a,b,c,d,f){for(var e=0,k=a.fields.length;e<k;e++){var g={triggerField:f.triggerField,thisFieldId:a.fields[e],inSection:f.inSection,valKey:f.inSection+""+a.fields[e],thisField:c.fields[a.fields[e]],thisFieldCall:"input"+c.fieldKeys[a.fields[e]]},h=c;"checkbox"==g.thisField.type||"select"==g.thisField.type?g.thisFieldCall=g.thisFieldCall+":checked,select"+
30
+ h.fieldKeys[g.thisFieldId]+" option:selected,"+g.thisFieldCall+"[type=hidden]":"radio"==g.thisField.type||"scale"==g.thisField.type?g.thisFieldCall=g.thisFieldCall+":checked,"+g.thisFieldCall+"[type=hidden]":"textarea"==g.thisField.type&&(g.thisFieldCall=g.thisFieldCall+",textarea"+h.fieldKeys[g.thisFieldId]);d=pa(g,c,d);if("undefined"===typeof d[g.valKey]||isNaN(d[g.valKey]))d[g.valKey]=0;h="["+g.thisFieldId+"]";h=h.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1");b=b.replace(new RegExp(h,"g"),d[g.valKey])}return b}
31
+ function pa(a,b,c){if("undefined"!==typeof c[a.valKey]&&0!==c[a.valKey])return c;c[a.valKey]=0;var d;if(!1===a.inSection)d=jQuery(a.thisFieldCall);else if(d=fa(a),null===d||"undefined"===typeof d)d=jQuery(a.thisFieldCall);if(null===d||"undefined"===typeof d||1>d.length)return c;d.each(function(){var d,e=a.thisField;d=!1;if("hidden"==this.type)""!==P(this)&&(d=!0);else if("select"==e.type){var k=this.className;k&&-1<k.indexOf("frm_other_trigger")&&(d=!0)}else("checkbox"==e.type||"radio"==e.type)&&
32
+ -1<this.id.indexOf("-other_")&&0>this.id.indexOf("-otext")&&(d=!0);d?(d=0,"select"==e.type?"hidden"==this.type?(e=!1,2<this.name.split("[").length&&(e=!0),e||(d=P(this))):d=jQuery(this).closest(".frm_other_container").find(".frm_other_input").val():"checkbox"!=e.type&&"radio"!=e.type||"hidden"==this.type||(d=P(this)),e=d):e="checkbox"!==this.type&&"radio"!==this.type||!this.checked?jQuery(this).val():this.value;"undefined"===typeof e&&(e="");d=e;if("date"==a.thisField.type){e=b.date;k=0;if(d)if("undefined"===
33
+ typeof jQuery.datepicker){k="-";-1<e.indexOf("/")&&(k="/");e=e.split(k);d=d.split(k);var g,h;g=k=h="";for(var l=0;l<e.length;l++)if("y"==e[l])g=((new Date).getFullYear()+15).toString().substr(2,2),g=d[l]>g?"19"+d[l]:"20"+d[l];else if("yy"==e[l])g=d[l];else if("m"==e[l]||"mm"==e[l])k=d[l],2>k.length&&(k="0"+k);else if("d"==e[l]||"dd"==e[l])h=d[l],2>h.length&&(h="0"+h);k=Date.parse(g+"-"+k+"-"+h)}else k=jQuery.datepicker.parseDate(e,d);e=k;null!==e&&(c[a.valKey]=Math.ceil(e/864E5))}else{e=d;""!==e&&
34
+ 0!==e&&(e=e.trim(),e=parseFloat(e.replace(/,/g,"").match(/-?[\d\.]+$/)));if("undefined"===typeof e||isNaN(e)||""===e)e=0;c[a.valKey]+=e}});return c}function fa(a){if("undefined"===typeof a.triggerField)return null;var b=a.triggerField.closest(".frm_repeat_sec, .frm_repeat_inline, .frm_repeat_grid");return b.length?(a=a.thisFieldCall.replace("[id=","[id^="),b.find(a)):null}function P(a){var b="";a=document.getElementById(a.id+"-otext");null!==a&&""!==a.value&&(b=a.value);return b}function qa(a,b){jQuery(a).find('input[type="submit"], input[type="button"]').attr("disabled",
35
  "disabled");jQuery(a).find(".frm_ajax_loading").addClass("frm_loading_now");"undefined"==typeof b&&jQuery(a).find('input[name="frm_action"]').val();jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:jQuery(a).serialize()+"&action=frm_entries_"+b+"&nonce="+frm_js.nonce,success:function(b){b=b.replace(/^\s+|\s+$/g,"");0===b.indexOf("{")&&(b=jQuery.parseJSON(b));if(""===b||!b||"0"===b||"object"!=typeof b&&0===b.indexOf("<!DOCTYPE")){var d=document.getElementById("frm_loading");null!==d&&(b=jQuery(a).find("input[type=file]").val(),
36
  "undefined"!=typeof b&&""!==b&&setTimeout(function(){jQuery(d).fadeIn("slow")},2E3));b=jQuery(a).find(".g-recaptcha");b.length&&(1>jQuery(a).find(".frm_next_page").length||1>jQuery(a).find(".frm_next_page").val())&&b.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">');a.submit()}else if("object"!=typeof b){jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");var f=jQuery(a).find('input[name="form_id"]').val();jQuery(a).closest("#frm_form_"+
37
  f+"_container").replaceWith(b);frmFrontForm.scrollMsg(f);if("function"==typeof frmThemeOverride_frmAfterSubmit){var f=jQuery('input[name="frm_page_order_'+f+'"]').val(),e=jQuery(b).find('input[name="form_id"]').val();frmThemeOverride_frmAfterSubmit(e,f,b,a)}b=jQuery(a).find('input[name="id"]');b.length&&jQuery(document.getElementById("frm_edit_"+b.val())).find("a").addClass("frm_ajax_edited").click()}else{jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");jQuery(a).find(".frm_ajax_loading").removeClass("frm_loading_now");
53
  a.replaceWith('<span class="frm-loading-img" id="frm_delete_'+c+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:c,nonce:frm_js.nonce},success:function(a){"success"==a.replace(/^\s+|\s+$/g,"")?(jQuery(document.getElementById(d+c)).fadeOut("slow"),jQuery(document.getElementById("frm_delete_"+c)).fadeOut("slow")):jQuery(document.getElementById("frm_delete_"+c)).replaceWith(a)}})}return!1}function ya(a){a.fadeOut("slow",function(){a.remove()})}function Fa(){var a=
54
  jQuery(this).data("frmconfirm");return confirm(a)}function Ga(){var a=jQuery(this).data("frmtoggle");jQuery(a).is(":visible")?jQuery(a).slideUp("fast"):jQuery(a).slideDown("fast");return!1}function na(a,b){for(var c in a)if(a.hasOwnProperty(c)&&a[c]===b)return c;return null}function ga(a){return!jQuery.isArray(a)&&0<=a-parseFloat(a)+1}function X(a){return a.find('select[name^="item_meta"], textarea[name^="item_meta"], input[name^="item_meta"]')}function Z(a,b){var c="item_meta["+a+"]";K(a)&&(c=L(a,
55
  b));return c}function L(a,b){var c="";-1<b.indexOf("frm_section")?(c=b.replace("frm_section_","").split("-"),c="item_meta["+c[0]+"]["+c[1]+"]["+a+"]"):(c=b.replace("frm_field_","").replace("_container","").split("-"),c="item_meta["+c[1]+"]["+c[2]+"]["+a+"]");return c}function U(a,b){var c=b.replace("frm_section_","").split("-");return"frm_field_"+a+"-"+c[0]+"-"+c[1]+"_container"}function K(a){var b=document.getElementById("frm_field_"+a+"_container");return"undefined"!==typeof b&&null!==b?!1:1>jQuery('input[name^="item_meta['+
56
+ a+']"],select[name^="item_meta['+a+']"], textarea[name^="item_meta['+a+']"]').length?!0:!1}function Ha(){Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c=this.length>>>0,d=+b||0,d=0>d?Math.ceil(d):Math.floor(d);for(0>d&&(d+=c);d<c;d++)if(d in this&&this[d]===a)return d;return-1})}function Ia(){"function"!==typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")})}function Ja(){Array.prototype.filter||(Array.prototype.filter=function(a,
57
+ b){if(void 0===this||null===this)throw new TypeError;var c=Object(this),d=c.length>>>0;if("function"!==typeof a)throw new TypeError;for(var f=[],e=0;e<d;e++)if(e in c){var k=c[e];a.call(b,k,e,c)&&f.push(k)}return f})}function Ka(){Object.keys||(Object.keys=function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c);return b})}function ka(a,b){var c=[];if("undefined"==typeof document.querySelector)jQuery("#"+a+' input[type=checkbox]:checked, input[type=hidden][name^="'+b+'"]').each(function(){c.push(this.value)});
58
  else for(var d=document.querySelectorAll("#"+a+' input[type=checkbox], input[type=hidden][name^="'+b+'"]'),f=0;f<d.length;f++)("checkbox"==d[f].type&&d[f].checked||"hidden"==d[f].type)&&c.push(d[f].value);return c}var p=[],D={},F=[],O=[],B="",I=!1,Q="",A=[];return{init:function(){jQuery(document).on("click",".frm_trigger",q);var a=jQuery(".frm_blank_field");a.length&&a.closest(".frm_toggle_container").prev(".frm_trigger").click();jQuery.isFunction(jQuery.fn.placeholder)?jQuery(".frm-show-form input, .frm-show-form textarea").placeholder():
59
  jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){""===jQuery(this).val()&&jQuery(this).blur()});jQuery(document).on("focus",".frm_toggle_default",ra);jQuery(document).on("blur",".frm_toggle_default",sa);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(ta);jQuery(document).on("change",".frm_multiple_file",wa);jQuery(document).on("click",".frm_clear_file_link",za);jQuery(document).on("click",".frm_remove_link",xa);
60
  jQuery(document).on("focusin","input[data-frmmask]",function(){jQuery(this).mask(jQuery(this).data("frmmask").toString())});jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',x);jQuery(document).on("click",'.frm-show-form input[type="submit"], .frm-show-form input[name="frm_prev_page"], .frm-show-form .frm_save_draft',m);jQuery(document).on("change",'.frm_other_container input[type="checkbox"], .frm_other_container input[type="radio"], .frm_other_container select',
61
+ v);jQuery(document).on("change","input[type=file].frm_transparent",t);jQuery(document).on("click",".frm_remove_form_row",Aa);jQuery(document).on("click",".frm_add_form_row",Ba);jQuery(document).on("click","a[data-frmconfirm]",Fa);jQuery("a[data-frmtoggle]").click(Ga);jQuery(".frm_edit_link_container").on("click","a.frm_inplace_edit",Ca);jQuery(".frm_edit_link_container").on("click","a.frm_cancel_edit",Da);jQuery(document).on("click",".frm_ajax_delete",Ea);jQuery(".frm_month_heading, .frm_year_heading").click(function(){var a=
62
  jQuery(this).children(".ui-icon-triangle-1-e, .ui-icon-triangle-1-s");a.hasClass("ui-icon-triangle-1-e")?(a.addClass("ui-icon-triangle-1-s").removeClass("ui-icon-triangle-1-e"),jQuery(this).next(".frm_toggle_container").fadeIn("slow")):(a.addClass("ui-icon-triangle-1-e").removeClass("ui-icon-triangle-1-s"),jQuery(this).next(".frm_toggle_container").hide())});Ha();Ia();Ja();Ka()},submitForm:function(a){a.preventDefault();a=frmFrontForm.validateFormSubmit(this);0===Object.keys(a).length&&frmFrontForm.checkFormErrors(this,
63
  Q)},validateFormSubmit:function(a){jQuery(this).find(".wp-editor-wrap").length&&"undefined"!=typeof tinyMCE&&tinyMCE.triggerSave();Q=jQuery(a).find('input[name="frm_action"]').val();A=[];frmFrontForm.getAjaxFormErrors(a);Object.keys(A).length&&frmFrontForm.addAjaxFormErrors(a);return A},getAjaxFormErrors:function(a){A=[];if("function"==typeof frmThemeOverride_jsErrors&&(a=frmThemeOverride_jsErrors(Q,a),Object.keys(a).length))for(var b in a)A[b]=a[b];return A},addAjaxFormErrors:function(a){jQuery(".form-field").removeClass("frm_blank_field");
64
  jQuery(".form-field .frm_error").replaceWith("");for(var b in A){var c=jQuery(a).find(jQuery("#frm_field_"+b+"_container"));ha(c,b,A)}},checkFormErrors:function(a,b){qa(a,b)},scrollToID:function(a){a=jQuery(document.getElementById(a).offset());window.scrollTo(a.left,a.top)},scrollMsg:function(a,b,c){var d="";if(d="undefined"==typeof b?jQuery(document.getElementById("frm_form_"+a+"_container")).offset().top:jQuery(b).find("#frm_field_"+a+"_container").offset().top){d-=frm_js.offset;a=jQuery("html").css("margin-top");
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://formidablepro.com/donate
4
  Tags: contact form, contact, custom form, database, email, feedback, form, forms, poll, Post, captcha, spam, survey, template, widget, multisite, form builder, form creator, form manager
5
  Requires at least: 3.7
6
  Tested up to: 4.4
7
- Stable tag: 2.0.21
8
 
9
  Beautiful forms in 60 seconds. The WordPress form builder that enables you to create forms with a simple drag-and-drop interface and in-place editing.
10
 
@@ -89,6 +89,25 @@ A. Try clearing your browser cache. As plugin modifications are made, frequent j
89
  [See more FAQs](http://formidablepro.com/formidable-faqs/ "Formidable Form FAQs")
90
 
91
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  = 2.0.21 =
93
  * Add a timestamp to the css file instead of plugin version number to improve issues with styling caching
94
  * Add pro tips & upgrade calls
4
  Tags: contact form, contact, custom form, database, email, feedback, form, forms, poll, Post, captcha, spam, survey, template, widget, multisite, form builder, form creator, form manager
5
  Requires at least: 3.7
6
  Tested up to: 4.4
7
+ Stable tag: 2.0.22
8
 
9
  Beautiful forms in 60 seconds. The WordPress form builder that enables you to create forms with a simple drag-and-drop interface and in-place editing.
10
 
89
  [See more FAQs](http://formidablepro.com/formidable-faqs/ "Formidable Form FAQs")
90
 
91
  == Changelog ==
92
+ = 2.0.22 =
93
+ * Add an upgrade banner when affiliate links are active
94
+ * Add permission checks in addition to nonce for several actions for extra security
95
+ * Don't allow javascript to be saved in field choices
96
+ * Include the admin_url params inside the function to resolve a conflict with WPML
97
+ * Prevent XML breaking with US character
98
+ * Fix rand() error with float some users are seeing with PHP7
99
+ * **Pro Features:** *
100
+ * Add the option to automatically delete files when a file is replaced, and and entry is deleted
101
+ * Allow a prefix and/or suffix along with the [auto_id] shortcode
102
+ * Add is_draft shortcode for views. This allows [is_draft], [if is_draft equals="1"]-draft-[/if is_draft], and [if is_draft equals="0"]-complete-[/if is_draft]
103
+ * Add frm_no_entries_message filter to adjust the output when there are no entries found
104
+ * Add frm_search_for_dynamic_text hook for searching numeric values in Dynamic fields
105
+ * Add the saved value into the array and json response. The entries fetched using FrmEntriesController::show_entry_shortcode were only returning the displayed value. This adds the saved value to the array as well. This covers user id, dynamic fields, radio, dropdown, and checkbox fields anytime the saved and displayed values are different.
106
+ * Add filter on add/remove fields to allow translations
107
+ * Default new number fields to use "any" step
108
+ * Fix conditional logic dependent on a paragraph field
109
+ * Fix date fields inside form loaded with in-place-edit
110
+
111
  = 2.0.21 =
112
  * Add a timestamp to the css file instead of plugin version number to improve issues with styling caching
113
  * Add pro tips & upgrade calls