Formidable Forms – Form Builder for WordPress - Version 4.05

Version Description

  • Updates to the default form styling.
  • New: Added an inbox as a centralized place for notices and communication.
  • New: Added frm_color_block and frm_total_big classes for more beautiful forms.
  • Help prevent common email issues by showing a warning in the email settings when the from and to email addresses are the same.
  • Fix: Forms edited after export and reimported were losing the required indicator in some cases.
Download this release

Release Info

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

Code changes from version 4.04.05 to 4.05

classes/controllers/FrmAppController.php CHANGED
@@ -8,7 +8,9 @@ class FrmAppController {
8
  return;
9
  }
10
 
11
- $menu_name = FrmAppHelper::get_menu_name();
 
 
12
  add_menu_page( 'Formidable', $menu_name, 'frm_view_forms', 'formidable', 'FrmFormsController::route', self::menu_icon(), self::get_menu_position() );
13
  }
14
 
@@ -16,6 +18,14 @@ class FrmAppController {
16
  return apply_filters( 'frm_menu_position', '29.3' );
17
  }
18
 
 
 
 
 
 
 
 
 
19
  /**
20
  * @since 3.05
21
  */
@@ -88,6 +98,8 @@ class FrmAppController {
88
  'formidable-import',
89
  'formidable-settings',
90
  'formidable-styles',
 
 
91
  );
92
 
93
  $get_page = FrmAppHelper::simple_get( 'page', 'sanitize_title' );
@@ -277,6 +289,7 @@ class FrmAppController {
277
  public static function remove_upsells() {
278
  remove_action( 'frm_before_settings', 'FrmSettingsController::license_box' );
279
  remove_action( 'frm_after_settings', 'FrmSettingsController::settings_cta' );
 
280
  }
281
 
282
  /**
@@ -364,7 +377,7 @@ class FrmAppController {
364
  'bootstrap-multiselect',
365
  );
366
 
367
- if ( FrmAppHelper::is_admin_page( 'formidable-styles' ) ) {
368
  $dependecies[] = 'wp-color-picker';
369
  }
370
 
@@ -389,7 +402,7 @@ class FrmAppController {
389
  FrmAppHelper::localize_script( 'admin' );
390
 
391
  wp_enqueue_style( 'formidable-admin' );
392
- if ( 'formidable-styles' !== $page ) {
393
  wp_enqueue_style( 'formidable-grids' );
394
  wp_enqueue_style( 'formidable-dropzone' );
395
  } else {
8
  return;
9
  }
10
 
11
+ $unread = self::get_notice_count();
12
+
13
+ $menu_name = FrmAppHelper::get_menu_name() . $unread;
14
  add_menu_page( 'Formidable', $menu_name, 'frm_view_forms', 'formidable', 'FrmFormsController::route', self::menu_icon(), self::get_menu_position() );
15
  }
16
 
18
  return apply_filters( 'frm_menu_position', '29.3' );
19
  }
20
 
21
+ /**
22
+ * @since 4.05
23
+ */
24
+ private static function get_notice_count() {
25
+ $inbox = new FrmInbox();
26
+ return $inbox->unread_html();
27
+ }
28
+
29
  /**
30
  * @since 3.05
31
  */
98
  'formidable-import',
99
  'formidable-settings',
100
  'formidable-styles',
101
+ 'formidable-styles2',
102
+ 'formidable-inbox',
103
  );
104
 
105
  $get_page = FrmAppHelper::simple_get( 'page', 'sanitize_title' );
289
  public static function remove_upsells() {
290
  remove_action( 'frm_before_settings', 'FrmSettingsController::license_box' );
291
  remove_action( 'frm_after_settings', 'FrmSettingsController::settings_cta' );
292
+ remove_action( 'frm_add_form_style_tab_options', 'FrmFormsController::add_form_style_tab_options' );
293
  }
294
 
295
  /**
377
  'bootstrap-multiselect',
378
  );
379
 
380
+ if ( FrmAppHelper::is_admin_page( 'formidable-styles' ) || FrmAppHelper::is_admin_page( 'formidable-styles2' ) ) {
381
  $dependecies[] = 'wp-color-picker';
382
  }
383
 
402
  FrmAppHelper::localize_script( 'admin' );
403
 
404
  wp_enqueue_style( 'formidable-admin' );
405
+ if ( 'formidable-styles' !== $page && 'formidable-styles2' !== $page ) {
406
  wp_enqueue_style( 'formidable-grids' );
407
  wp_enqueue_style( 'formidable-dropzone' );
408
  } else {
classes/controllers/FrmFormsController.php CHANGED
@@ -1401,6 +1401,15 @@ class FrmFormsController {
1401
  return $errors;
1402
  }
1403
 
 
 
 
 
 
 
 
 
 
1404
  /* FRONT-END FORMS */
1405
  public static function admin_bar_css() {
1406
  if ( is_admin() || ! current_user_can( 'frm_edit_forms' ) ) {
1401
  return $errors;
1402
  }
1403
 
1404
+ /**
1405
+ * Education for premium features.
1406
+ *
1407
+ * @since 4.05
1408
+ */
1409
+ public static function add_form_style_tab_options() {
1410
+ include( FrmAppHelper::plugin_path() . '/classes/views/frm-forms/add_form_style_options.php' );
1411
+ }
1412
+
1413
  /* FRONT-END FORMS */
1414
  public static function admin_bar_css() {
1415
  if ( is_admin() || ! current_user_can( 'frm_edit_forms' ) ) {
classes/controllers/FrmHooksController.php CHANGED
@@ -106,6 +106,7 @@ class FrmHooksController {
106
  // Form Actions Controller.
107
  if ( FrmAppHelper::is_admin_page( 'formidable' ) ) {
108
  add_action( 'frm_before_update_form_settings', 'FrmFormActionsController::update_settings' );
 
109
  }
110
  add_action( 'frm_after_duplicate_form', 'FrmFormActionsController::duplicate_form_actions', 20, 3 );
111
 
@@ -121,6 +122,9 @@ class FrmHooksController {
121
  // Forms Model.
122
  add_action( 'frm_after_duplicate_form', 'FrmForm::after_duplicate', 10, 2 );
123
 
 
 
 
124
  // Settings Controller.
125
  add_action( 'admin_menu', 'FrmSettingsController::menu', 45 );
126
  add_action( 'frm_before_settings', 'FrmSettingsController::license_box' );
@@ -140,8 +144,6 @@ class FrmHooksController {
140
 
141
  add_action( 'admin_init', 'FrmUsageController::schedule_send' );
142
 
143
- add_action( 'wp_ajax_frm_dismiss_migrator', 'FrmFormMigratorsHelper::dismiss_migrator' );
144
-
145
  FrmSMTPController::load_hooks();
146
  }
147
 
@@ -178,6 +180,11 @@ class FrmHooksController {
178
  add_action( 'wp_ajax_frm_install_form', 'FrmFormsController::build_new_form' );
179
  add_action( 'wp_ajax_frm_build_template', 'FrmFormsController::build_template' );
180
 
 
 
 
 
 
181
  // Settings.
182
  add_action( 'wp_ajax_frm_lite_settings_upgrade', 'FrmSettingsController::settings_cta_dismiss' );
183
 
106
  // Form Actions Controller.
107
  if ( FrmAppHelper::is_admin_page( 'formidable' ) ) {
108
  add_action( 'frm_before_update_form_settings', 'FrmFormActionsController::update_settings' );
109
+ add_action( 'frm_add_form_style_tab_options', 'FrmFormsController::add_form_style_tab_options' );
110
  }
111
  add_action( 'frm_after_duplicate_form', 'FrmFormActionsController::duplicate_form_actions', 20, 3 );
112
 
122
  // Forms Model.
123
  add_action( 'frm_after_duplicate_form', 'FrmForm::after_duplicate', 10, 2 );
124
 
125
+ // Inbox Controller.
126
+ add_action( 'admin_menu', 'FrmInboxController::menu', 50 );
127
+
128
  // Settings Controller.
129
  add_action( 'admin_menu', 'FrmSettingsController::menu', 45 );
130
  add_action( 'frm_before_settings', 'FrmSettingsController::license_box' );
144
 
145
  add_action( 'admin_init', 'FrmUsageController::schedule_send' );
146
 
 
 
147
  FrmSMTPController::load_hooks();
148
  }
149
 
180
  add_action( 'wp_ajax_frm_install_form', 'FrmFormsController::build_new_form' );
181
  add_action( 'wp_ajax_frm_build_template', 'FrmFormsController::build_template' );
182
 
183
+ add_action( 'wp_ajax_frm_dismiss_migrator', 'FrmFormMigratorsHelper::dismiss_migrator' );
184
+
185
+ // Inbox.
186
+ add_action( 'wp_ajax_frm_inbox_dismiss', 'FrmInboxController::dismiss_message' );
187
+
188
  // Settings.
189
  add_action( 'wp_ajax_frm_lite_settings_upgrade', 'FrmSettingsController::settings_cta_dismiss' );
190
 
classes/controllers/FrmInboxController.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @since 4.05
4
+ */
5
+ class FrmInboxController {
6
+
7
+ /**
8
+ * @since 4.05
9
+ */
10
+ public static function menu() {
11
+ $unread = self::get_notice_count();
12
+
13
+ add_submenu_page( 'formidable', 'Formidable | ' . __( 'Inbox', 'formidable' ), __( 'Inbox', 'formidable' ) . $unread, 'frm_change_settings', 'formidable-inbox', 'FrmInboxController::inbox' );
14
+ }
15
+
16
+ /**
17
+ * @since 4.05
18
+ */
19
+ private static function get_notice_count() {
20
+ FrmFormMigratorsHelper::maybe_add_to_inbox();
21
+
22
+ $inbox = new FrmInbox();
23
+ return $inbox->unread_html();
24
+ }
25
+
26
+ /**
27
+ * @since 4.05
28
+ */
29
+ public static function inbox() {
30
+ FrmAppHelper::include_svg();
31
+ self::add_tracking_request();
32
+
33
+ $inbox = new FrmInbox();
34
+ $messages = $inbox->get_messages();
35
+ $messages = array_reverse( $messages );
36
+ $user = wp_get_current_user();
37
+
38
+ include( FrmAppHelper::plugin_path() . '/classes/views/inbox/list.php' );
39
+ }
40
+
41
+ /**
42
+ * @since 4.05
43
+ */
44
+ public static function dismiss_message() {
45
+ check_ajax_referer( 'frm_ajax', 'nonce' );
46
+ FrmAppHelper::permission_check( 'frm_change_settings' );
47
+
48
+ $key = FrmAppHelper::get_param( 'key', '', 'post', 'sanitize_text_field' );
49
+ if ( ! empty( $key ) ) {
50
+ $message = new FrmInbox();
51
+ $message->dismiss( $key );
52
+ }
53
+
54
+ wp_die();
55
+ }
56
+
57
+ /**
58
+ * @since 4.05
59
+ */
60
+ private static function add_tracking_request() {
61
+ $settings = FrmAppHelper::get_settings();
62
+ if ( $settings->tracking ) {
63
+ return;
64
+ }
65
+
66
+ $link = admin_url( 'admin.php?page=formidable-settings&t=misc_settings' );
67
+
68
+ $message = new FrmInbox();
69
+ $message->add_message(
70
+ array(
71
+ 'key' => 'usage',
72
+ 'message' => 'Gathering usage data allows us to improve Formidable. Your forms will be considered as we evaluate new features, judge the quality of an update, or determine if an improvement makes sense. You can always visit the <a href="' . esc_url( $link ) . '">Global Settings</a> and choose to stop sharing data. <a href="https://formidableforms.com/knowledgebase/global-settings-overview/#kb-usage-tracking" target="_blank" rel="noopener noreferrer">Read more about what data we collect</a>.',
73
+ 'subject' => __( 'Help Formidable improve with usage tracking', 'formidable' ),
74
+ 'cta' => '<a href="#" class="button-secondary frm-button-secondary frm_inbox_dismiss">Dismiss</a> <a href="' . esc_url( $link ) . '" class="button-primary frm-button-primary frm_inbox_dismiss">Activate usage tracking</a>',
75
+ )
76
+ );
77
+ }
78
+ }
classes/controllers/FrmSimpleBlocksController.php CHANGED
@@ -26,6 +26,7 @@ class FrmSimpleBlocksController {
26
  'forms' => self::get_forms_options(),
27
  'icon' => $icon,
28
  'name' => $block_name,
 
29
  );
30
 
31
  wp_localize_script( 'formidable-form-selector', 'formidable_form_selector', $script_vars );
26
  'forms' => self::get_forms_options(),
27
  'icon' => $icon,
28
  'name' => $block_name,
29
+ 'link' => FrmAppHelper::admin_upgrade_link( 'block' ),
30
  );
31
 
32
  wp_localize_script( 'formidable-form-selector', 'formidable_form_selector', $script_vars );
classes/controllers/FrmStylesController.php CHANGED
@@ -45,10 +45,11 @@ class FrmStylesController {
45
 
46
  public static function menu() {
47
  add_submenu_page( 'formidable', 'Formidable | ' . __( 'Styles', 'formidable' ), __( 'Styles', 'formidable' ), 'frm_change_settings', 'formidable-styles', 'FrmStylesController::route' );
 
48
  }
49
 
50
  public static function admin_init() {
51
- if ( ! FrmAppHelper::is_admin_page( 'formidable-styles' ) ) {
52
  return;
53
  }
54
 
45
 
46
  public static function menu() {
47
  add_submenu_page( 'formidable', 'Formidable | ' . __( 'Styles', 'formidable' ), __( 'Styles', 'formidable' ), 'frm_change_settings', 'formidable-styles', 'FrmStylesController::route' );
48
+ add_submenu_page( 'themes.php', 'Formidable | ' . __( 'Styles', 'formidable' ), __( 'Forms', 'formidable' ), 'frm_change_settings', 'formidable-styles2', 'FrmStylesController::route' );
49
  }
50
 
51
  public static function admin_init() {
52
+ if ( ! FrmAppHelper::is_admin_page( 'formidable-styles' ) && ! FrmAppHelper::is_admin_page( 'formidable-styles2' ) ) {
53
  return;
54
  }
55
 
classes/controllers/FrmXMLController.php CHANGED
@@ -3,8 +3,7 @@
3
  class FrmXMLController {
4
 
5
  public static function menu() {
6
- $notification_count = FrmFormMigratorsHelper::notification_count();
7
- add_submenu_page( 'formidable', 'Formidable | ' . __( 'Import/Export', 'formidable' ), __( 'Import/Export', 'formidable' ) . $notification_count, 'frm_edit_forms', 'formidable-import', 'FrmXMLController::route' );
8
  }
9
 
10
  public static function add_default_templates() {
3
  class FrmXMLController {
4
 
5
  public static function menu() {
6
+ add_submenu_page( 'formidable', 'Formidable | ' . __( 'Import/Export', 'formidable' ), __( 'Import/Export', 'formidable' ), 'frm_edit_forms', 'formidable-import', 'FrmXMLController::route' );
 
7
  }
8
 
9
  public static function add_default_templates() {
classes/helpers/FrmAppHelper.php CHANGED
@@ -11,7 +11,7 @@ class FrmAppHelper {
11
  /**
12
  * @since 2.0
13
  */
14
- public static $plug_version = '4.04.05';
15
 
16
  /**
17
  * @since 1.07.02
@@ -231,7 +231,10 @@ class FrmAppHelper {
231
  $get_page = self::simple_get( 'page', 'sanitize_title' );
232
  if ( $pagenow ) {
233
  // allow this to be true during ajax load i.e. ajax form builder loading
234
- return ( $pagenow == 'admin.php' || $pagenow == 'admin-ajax.php' ) && $get_page == $page;
 
 
 
235
  }
236
 
237
  return is_admin() && $get_page == $page;
@@ -1109,7 +1112,7 @@ class FrmAppHelper {
1109
  public static function is_full_screen() {
1110
  $action = self::simple_get( 'frm_action', 'sanitize_title' );
1111
  $full_builder = self::is_admin_page( 'formidable' ) && ( $action === 'edit' || $action === 'settings' || $action === 'duplicate' );
1112
- $styler = self::is_admin_page( 'formidable-styles' );
1113
  $full_entries = self::simple_get( 'frm-full', 'absint' );
1114
 
1115
  return $full_builder || $full_entries || $styler || self::is_view_builder_page();
@@ -1605,7 +1608,7 @@ class FrmAppHelper {
1605
  $field_array['unique_msg'] = '';
1606
  }
1607
 
1608
- $field_array = array_merge( $field->field_options, $field_array );
1609
 
1610
  $values['fields'][ $field->id ] = $field_array;
1611
  }
11
  /**
12
  * @since 2.0
13
  */
14
+ public static $plug_version = '4.05';
15
 
16
  /**
17
  * @since 1.07.02
231
  $get_page = self::simple_get( 'page', 'sanitize_title' );
232
  if ( $pagenow ) {
233
  // allow this to be true during ajax load i.e. ajax form builder loading
234
+ $is_page = ( $pagenow == 'admin.php' || $pagenow == 'admin-ajax.php' ) && $get_page == $page;
235
+ if ( $is_page ) {
236
+ return true;
237
+ }
238
  }
239
 
240
  return is_admin() && $get_page == $page;
1112
  public static function is_full_screen() {
1113
  $action = self::simple_get( 'frm_action', 'sanitize_title' );
1114
  $full_builder = self::is_admin_page( 'formidable' ) && ( $action === 'edit' || $action === 'settings' || $action === 'duplicate' );
1115
+ $styler = self::is_admin_page( 'formidable-styles' ) || self::is_admin_page( 'formidable-styles2' );
1116
  $full_entries = self::simple_get( 'frm-full', 'absint' );
1117
 
1118
  return $full_builder || $full_entries || $styler || self::is_view_builder_page();
1608
  $field_array['unique_msg'] = '';
1609
  }
1610
 
1611
+ $field_array = array_merge( (array) $field->field_options, $field_array );
1612
 
1613
  $values['fields'][ $field->id ] = $field_array;
1614
  }
classes/helpers/FrmFormMigratorsHelper.php CHANGED
@@ -5,29 +5,6 @@ if ( ! defined( 'ABSPATH' ) ) {
5
 
6
  class FrmFormMigratorsHelper {
7
 
8
- public static function notification_count() {
9
- $forms = self::import_links();
10
- if ( empty( $forms ) ) {
11
- return '';
12
- }
13
-
14
- $count = count( $forms );
15
- $dismissed = get_option( 'frm_dismissed' );
16
- if ( ! empty( $dismissed ) ) {
17
- foreach ( $forms as $form ) {
18
- if ( self::is_dismissed( $form, $dismissed ) ) {
19
- $count --;
20
- }
21
- }
22
- }
23
-
24
- if ( $count < 1 ) {
25
- return '';
26
- }
27
-
28
- return ' <span class="update-plugins"><span class="plugin-count">' . absint( $count ) . '</span></span>';
29
- }
30
-
31
  private static function is_dismissed( $form, $dismissed = null ) {
32
  if ( $dismissed === null ) {
33
  $dismissed = get_option( 'frm_dismissed' );
@@ -53,6 +30,26 @@ class FrmFormMigratorsHelper {
53
  }
54
  }
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  private static function import_links() {
57
  if ( ! current_user_can( 'activate_plugins' ) ) {
58
  return array();
@@ -153,4 +150,11 @@ class FrmFormMigratorsHelper {
153
  update_option( 'frm_dismissed', array_filter( $dismissed ), 'no' );
154
  wp_die();
155
  }
 
 
 
 
 
 
 
156
  }
5
 
6
  class FrmFormMigratorsHelper {
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  private static function is_dismissed( $form, $dismissed = null ) {
9
  if ( $dismissed === null ) {
10
  $dismissed = get_option( 'frm_dismissed' );
30
  }
31
  }
32
 
33
+ /**
34
+ * @since 4.05
35
+ */
36
+ public static function maybe_add_to_inbox() {
37
+ $inbox = new FrmInbox();
38
+ $forms = self::import_links();
39
+
40
+ foreach ( $forms as $form ) {
41
+ $inbox->add_message(
42
+ array(
43
+ 'key' => $form['class'],
44
+ 'subject' => 'You have new importable forms',
45
+ 'message' => 'Did you know you can import your forms created in ' . esc_html( $form['name'] ) . '?',
46
+ 'cta' => '<a href="' . esc_url( admin_url( 'admin.php?page=formidable-import' ) ) . '" class="button-primary frm-button-primary">' . esc_html__( 'Learn More', 'formidable' ) . '</a>',
47
+ 'icon' => 'frm_cloud_upload_solid_icon',
48
+ )
49
+ );
50
+ }
51
+ }
52
+
53
  private static function import_links() {
54
  if ( ! current_user_can( 'activate_plugins' ) ) {
55
  return array();
150
  update_option( 'frm_dismissed', array_filter( $dismissed ), 'no' );
151
  wp_die();
152
  }
153
+
154
+ /**
155
+ * @deprecated 4.05
156
+ */
157
+ public static function notification_count() {
158
+ _deprecated_function( __METHOD__, '4.05' );
159
+ }
160
  }
classes/helpers/FrmFormsHelper.php CHANGED
@@ -1118,6 +1118,10 @@ BEFORE_HTML;
1118
  'label' => __( 'Total', 'formidable' ),
1119
  'title' => __( 'Add this to a read-only field to display the text in bold without a border or background.', 'formidable' ),
1120
  ),
 
 
 
 
1121
  'frm_scroll_box' => array(
1122
  'label' => __( 'Scroll Box', 'formidable' ),
1123
  'title' => __( 'If you have many checkbox or radio button options, you may add this class to allow your user to easily scroll through the options. Or add a scrolling area around content in an HTML field.', 'formidable' ),
@@ -1130,6 +1134,10 @@ BEFORE_HTML;
1130
  'frm_grid_first' => __( 'First Grid Row', 'formidable' ),
1131
  'frm_grid' => __( 'Even Grid Row', 'formidable' ),
1132
  'frm_grid_odd' => __( 'Odd Grid Row', 'formidable' ),
 
 
 
 
1133
  'frm_capitalize' => array(
1134
  'label' => __( 'Capitalize', 'formidable' ),
1135
  'title' => __( 'Automatically capitalize the first letter in each word.', 'formidable' ),
1118
  'label' => __( 'Total', 'formidable' ),
1119
  'title' => __( 'Add this to a read-only field to display the text in bold without a border or background.', 'formidable' ),
1120
  ),
1121
+ 'frm_total_big' => array(
1122
+ 'label' => __( 'Big Total', 'formidable' ),
1123
+ 'title' => __( 'Add this to a read-only field to display the text in large, bold text without a border or background.', 'formidable' ),
1124
+ ),
1125
  'frm_scroll_box' => array(
1126
  'label' => __( 'Scroll Box', 'formidable' ),
1127
  'title' => __( 'If you have many checkbox or radio button options, you may add this class to allow your user to easily scroll through the options. Or add a scrolling area around content in an HTML field.', 'formidable' ),
1134
  'frm_grid_first' => __( 'First Grid Row', 'formidable' ),
1135
  'frm_grid' => __( 'Even Grid Row', 'formidable' ),
1136
  'frm_grid_odd' => __( 'Odd Grid Row', 'formidable' ),
1137
+ 'frm_color_block' => array(
1138
+ 'label' => __( 'Color Block', 'formidable' ),
1139
+ 'title' => __( 'Add a background color to the field or section.', 'formidable' ),
1140
+ ),
1141
  'frm_capitalize' => array(
1142
  'label' => __( 'Capitalize', 'formidable' ),
1143
  'title' => __( 'Automatically capitalize the first letter in each word.', 'formidable' ),
classes/helpers/FrmXMLHelper.php CHANGED
@@ -370,6 +370,7 @@ class FrmXMLHelper {
370
  }
371
  }
372
 
 
373
  self::maybe_update_in_section_variable( $in_section, $f );
374
  self::maybe_update_form_select( $f, $imported );
375
  self::maybe_update_get_values_form_setting( $imported, $f );
@@ -423,6 +424,17 @@ class FrmXMLHelper {
423
  );
424
  }
425
 
 
 
 
 
 
 
 
 
 
 
 
426
  /**
427
  * Update the current in_section value
428
  *
370
  }
371
  }
372
 
373
+ self::maybe_add_required( $f );
374
  self::maybe_update_in_section_variable( $in_section, $f );
375
  self::maybe_update_form_select( $f, $imported );
376
  self::maybe_update_get_values_form_setting( $imported, $f );
424
  );
425
  }
426
 
427
+ /**
428
+ * Make sure the required indicator is set.
429
+ *
430
+ * @since 4.05
431
+ */
432
+ private static function maybe_add_required( &$f ) {
433
+ if ( $f['required'] && ! isset( $f['field_options']['required_indicator'] ) ) {
434
+ $f['field_options']['required_indicator'] = '*';
435
+ }
436
+ }
437
+
438
  /**
439
  * Update the current in_section value
440
  *
classes/models/FrmInbox.php ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @since 4.05
4
+ */
5
+ class FrmInbox extends FrmFormApi {
6
+
7
+ protected $cache_key;
8
+
9
+ private $option = 'frm_inbox';
10
+
11
+ private $messages = false;
12
+
13
+ public function __construct( $for_parent = null ) {
14
+ $this->set_cache_key();
15
+ $this->set_messages();
16
+ }
17
+
18
+ /**
19
+ * @since 4.05
20
+ */
21
+ protected function set_cache_key() {
22
+ $this->cache_key = 'frm_inbox_cache';
23
+ }
24
+
25
+ /**
26
+ * @since 4.05
27
+ */
28
+ protected function api_url() {
29
+ return 'https://formidableforms.com/wp-json/inbox/v1/message/';
30
+ }
31
+
32
+ /**
33
+ * @since 4.05
34
+ */
35
+ public function get_messages() {
36
+ return $this->messages;
37
+ }
38
+
39
+ /**
40
+ * @since 4.05
41
+ */
42
+ public function set_messages() {
43
+ $this->messages = get_option( $this->option );
44
+ if ( empty( $this->messages ) ) {
45
+ $this->messages = array();
46
+ }
47
+
48
+ $this->add_api_messages();
49
+
50
+ /**
51
+ * Messages are in an array.
52
+ */
53
+ $this->messages = apply_filters( 'frm_inbox', $this->messages );
54
+ }
55
+
56
+ /**
57
+ * @since 4.05
58
+ */
59
+ private function add_api_messages() {
60
+ $api = $this->get_api_info();
61
+ if ( empty( $api ) ) {
62
+ return;
63
+ }
64
+
65
+ foreach ( $api as $message ) {
66
+ $this->add_message( $message );
67
+ }
68
+ }
69
+
70
+ /**
71
+ * @param array $message
72
+ */
73
+ public function add_message( $message ) {
74
+ if ( isset( $this->messages[ $message['key'] ] ) && ! isset( $message['force'] ) ) {
75
+ // Don't replace messages unless required.
76
+ return;
77
+ }
78
+
79
+ if ( isset( $this->messages[ $message['key'] ] ) ) {
80
+ // Move up and mark as new.
81
+ unset( $this->messages[ $message['key'] ] );
82
+ }
83
+
84
+ $message = $this->fill_message( $message );
85
+ $this->messages[ $message['key'] ] = array(
86
+ 'created' => $message['time'],
87
+ 'message' => $message['message'],
88
+ 'subject' => $message['subject'],
89
+ 'icon' => $message['icon'],
90
+ 'cta' => $message['cta'],
91
+ 'expires' => $message['expires'],
92
+ );
93
+
94
+ $this->update_list();
95
+
96
+ $this->clean_messages();
97
+ }
98
+
99
+ private function fill_message( $message ) {
100
+ $defaults = array(
101
+ 'time' => time(),
102
+ 'message' => '',
103
+ 'subject' => '',
104
+ 'icon' => 'frm_tooltip_icon',
105
+ 'cta' => '',
106
+ 'expires' => false,
107
+ );
108
+
109
+ return array_merge( $defaults, $message );
110
+ }
111
+
112
+ private function clean_messages() {
113
+ $removed = false;
114
+ foreach ( $this->messages as $t => $message ) {
115
+ $read = isset( $message['read'] ) && ! empty( $message['read'] ) && isset( $message['read'][ get_current_user_id() ] ) && $message['read'][ get_current_user_id() ] < strtotime( '-1 month' );
116
+ $dismissed = isset( $message['dismissed'] ) && ! empty( $message['dismissed'] ) && isset( $message['dismissed'][ get_current_user_id() ] ) && $message['dismissed'][ get_current_user_id() ] < strtotime( '-1 week' );
117
+ $expired = isset( $message['expires'] ) && ! empty( $message['expires'] ) && $message['expires'] < time();
118
+ if ( $read || $expired || $dismissed ) {
119
+ unset( $this->messages[ $t ] );
120
+ $removed = true;
121
+ }
122
+ }
123
+
124
+ if ( $removed ) {
125
+ $this->update_list();
126
+ }
127
+ }
128
+
129
+ /**
130
+ * @param string $key
131
+ */
132
+ public function mark_read( $key ) {
133
+ if ( ! isset( $this->messages[ $key ] ) ) {
134
+ return;
135
+ }
136
+
137
+ if ( ! isset( $this->messages[ $key ]['read'] ) ) {
138
+ $this->messages[ $key ]['read'] = array();
139
+ }
140
+ $this->messages[ $key ]['read'][ get_current_user_id() ] = time();
141
+
142
+ $this->update_list();
143
+ }
144
+
145
+ /**
146
+ * @param string $key
147
+ */
148
+ public function dismiss( $key ) {
149
+ if ( ! isset( $this->messages[ $key ] ) ) {
150
+ return;
151
+ }
152
+
153
+ if ( ! isset( $this->messages[ $key ]['dismissed'] ) ) {
154
+ $this->messages[ $key ]['dismissed'] = array();
155
+ }
156
+ $this->messages[ $key ]['dismissed'][ get_current_user_id() ] = time();
157
+
158
+ $this->update_list();
159
+ }
160
+
161
+ private function update_list() {
162
+ update_option( $this->option, $this->messages, 'no' );
163
+ }
164
+
165
+ public function unread() {
166
+ $messages = $this->get_messages();
167
+ $user_id = get_current_user_id();
168
+ foreach ( $messages as $t => $message ) {
169
+ if ( isset( $message['read'] ) && isset( $message['read'][ $user_id ] ) ) {
170
+ unset( $messages[ $t ] );
171
+ }
172
+ }
173
+ return $messages;
174
+ }
175
+
176
+ public function unread_html() {
177
+ $html = '';
178
+ $count = count( $this->unread() );
179
+ if ( $count ) {
180
+ $html = ' <span class="update-plugins frm_inbox_count"><span class="plugin-count">' . absint( $count ) . '</span></span>';
181
+ }
182
+ return $html;
183
+ }
184
+ }
classes/models/FrmNotification.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
 
3
- // TODO: change class name to FrmEmailController by 08/2017 or later
4
  class FrmNotification {
5
  public function __construct() {
6
  if ( ! defined( 'ABSPATH' ) ) {
1
  <?php
2
 
 
3
  class FrmNotification {
4
  public function __construct() {
5
  if ( ! defined( 'ABSPATH' ) ) {
classes/models/FrmReviews.php CHANGED
@@ -98,10 +98,35 @@ class FrmReviews {
98
  $name = ' ' . $name;
99
  }
100
 
 
 
 
 
 
 
 
 
 
101
  // We have a candidate! Output a review message.
102
  include( FrmAppHelper::plugin_path() . '/classes/views/shared/review.php' );
103
  }
104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  /**
106
  * Save the request to hide the review
107
  *
98
  $name = ' ' . $name;
99
  }
100
 
101
+ $title = sprintf(
102
+ /* translators: %s: User name, %2$d: number of entries */
103
+ esc_html__( 'Congratulations%1$s! You have collected %2$d form submissions.', 'formidable' ),
104
+ esc_html( $name ),
105
+ absint( $entries )
106
+ );
107
+
108
+ $this->add_to_inbox( $title );
109
+
110
  // We have a candidate! Output a review message.
111
  include( FrmAppHelper::plugin_path() . '/classes/views/shared/review.php' );
112
  }
113
 
114
+ private function add_to_inbox( $title ) {
115
+ $message = new FrmInbox();
116
+ $message->add_message(
117
+ array(
118
+ 'key' => 'review',
119
+ 'force' => true,
120
+ 'message' => __( 'If you are enjoying Formidable, could you do me a BIG favor and give us a review to help me grow my little business and boost our motivation?', 'formidable' ) . '<br/>' .
121
+ '- Steph Wells<br/>' .
122
+ '<span>' . esc_html__( 'Founder and Lead Developer of Formidable Forms', 'formidable' ) . '<span>',
123
+ 'subject' => $title,
124
+ 'cta' => '<a href="https://wordpress.org/support/plugin/formidable/reviews/?filter=5#new-post" class="frm-dismiss-review-notice frm-review-out button-secondary frm-button-secondary" data-link="yes" target="_blank" rel="noopener noreferrer">' .
125
+ esc_html__( 'Ok, you deserve it', 'formidable' ) . '</a>',
126
+ )
127
+ );
128
+ }
129
+
130
  /**
131
  * Save the request to hide the review
132
  *
classes/models/FrmStyle.php CHANGED
@@ -337,19 +337,19 @@ class FrmStyle {
337
  'fieldset_padding' => '0 0 15px 0',
338
  'fieldset_bg_color' => '',
339
 
340
- 'title_size' => '20px',
341
  'title_color' => '444444',
342
  'title_margin_top' => '10px',
343
- 'title_margin_bottom' => '10px',
344
  'form_desc_size' => '14px',
345
  'form_desc_color' => '666666',
346
  'form_desc_margin_top' => '10px',
347
  'form_desc_margin_bottom' => '25px',
348
 
349
  'font' => '"Lucida Grande","Lucida Sans Unicode",Tahoma,sans-serif',
350
- 'font_size' => '14px',
351
- 'label_color' => '444444',
352
- 'weight' => 'bold',
353
  'position' => 'none',
354
  'align' => 'left',
355
  'width' => '150px',
@@ -374,7 +374,7 @@ class FrmStyle {
374
  'field_weight' => 'normal',
375
  'text_color' => '555555',
376
  //'border_color_hv' => 'cccccc',
377
- 'border_color' => 'cccccc',
378
  'field_border_width' => '1px',
379
  'field_border_style' => 'solid',
380
 
@@ -404,7 +404,7 @@ class FrmStyle {
404
  'section_weight' => 'bold',
405
  'section_pad' => '15px 0 3px 0',
406
  'section_mar_top' => '15px',
407
- 'section_mar_bottom' => '12px',
408
  'section_bg_color' => '',
409
  'section_border_color' => 'e8e8e8',
410
  'section_border_width' => '2px',
@@ -415,18 +415,18 @@ class FrmStyle {
415
  'repeat_icon' => '1',
416
 
417
  'submit_style' => false,
418
- 'submit_font_size' => '14px',
419
  'submit_width' => 'auto',
420
  'submit_height' => 'auto',
421
- 'submit_bg_color' => 'ffffff',
422
- 'submit_border_color' => 'cccccc',
423
  'submit_border_width' => '1px',
424
- 'submit_text_color' => '444444',
425
  'submit_weight' => 'normal',
426
  'submit_border_radius' => '4px',
427
  'submit_bg_img' => '',
428
  'submit_margin' => '10px',
429
- 'submit_padding' => '6px 11px',
430
  'submit_shadow_color' => 'eeeeee',
431
  'submit_hover_bg_color' => 'efefef',
432
  'submit_hover_color' => '444444',
@@ -448,11 +448,11 @@ class FrmStyle {
448
 
449
  'important_style' => false,
450
 
451
- 'progress_bg_color' => 'dddddd',
452
  'progress_active_color' => 'ffffff',
453
- 'progress_active_bg_color' => '4199FD',
454
- 'progress_color' => 'ffffff',
455
- 'progress_border_color' => 'dfdfdf',
456
  'progress_border_size' => '2px',
457
  'progress_size' => '30px',
458
 
337
  'fieldset_padding' => '0 0 15px 0',
338
  'fieldset_bg_color' => '',
339
 
340
+ 'title_size' => '40px',
341
  'title_color' => '444444',
342
  'title_margin_top' => '10px',
343
+ 'title_margin_bottom' => '60px',
344
  'form_desc_size' => '14px',
345
  'form_desc_color' => '666666',
346
  'form_desc_margin_top' => '10px',
347
  'form_desc_margin_bottom' => '25px',
348
 
349
  'font' => '"Lucida Grande","Lucida Sans Unicode",Tahoma,sans-serif',
350
+ 'font_size' => '15px',
351
+ 'label_color' => '3f4b5b',
352
+ 'weight' => 'normal',
353
  'position' => 'none',
354
  'align' => 'left',
355
  'width' => '150px',
374
  'field_weight' => 'normal',
375
  'text_color' => '555555',
376
  //'border_color_hv' => 'cccccc',
377
+ 'border_color' => 'BFC3C8',
378
  'field_border_width' => '1px',
379
  'field_border_style' => 'solid',
380
 
404
  'section_weight' => 'bold',
405
  'section_pad' => '15px 0 3px 0',
406
  'section_mar_top' => '15px',
407
+ 'section_mar_bottom' => '30px',
408
  'section_bg_color' => '',
409
  'section_border_color' => 'e8e8e8',
410
  'section_border_width' => '2px',
415
  'repeat_icon' => '1',
416
 
417
  'submit_style' => false,
418
+ 'submit_font_size' => '15px',
419
  'submit_width' => 'auto',
420
  'submit_height' => 'auto',
421
+ 'submit_bg_color' => '579AF6',
422
+ 'submit_border_color' => '579AF6',
423
  'submit_border_width' => '1px',
424
+ 'submit_text_color' => 'ffffff',
425
  'submit_weight' => 'normal',
426
  'submit_border_radius' => '4px',
427
  'submit_bg_img' => '',
428
  'submit_margin' => '10px',
429
+ 'submit_padding' => '10px 20px',
430
  'submit_shadow_color' => 'eeeeee',
431
  'submit_hover_bg_color' => 'efefef',
432
  'submit_hover_color' => '444444',
448
 
449
  'important_style' => false,
450
 
451
+ 'progress_bg_color' => 'eaeaea',
452
  'progress_active_color' => 'ffffff',
453
+ 'progress_active_bg_color' => '579AF6',
454
+ 'progress_color' => '3f4b5b',
455
+ 'progress_border_color' => 'E5E5E5',
456
  'progress_border_size' => '2px',
457
  'progress_size' => '30px',
458
 
classes/views/frm-form-actions/_email_settings.php CHANGED
@@ -40,6 +40,10 @@
40
  <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'from' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['from'] ); ?>" class="frm_not_email_to frm_email_blur large-text <?php FrmAppHelper::maybe_add_tooltip( 'from', 'open' ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'from' ) ); ?>" />
41
  </p>
42
 
 
 
 
 
43
  <p class="frm_reply_to_container">
44
  <a href="javascript:void(0)" class="button frm_email_buttons frm_reply_to_button <?php echo ( ! empty( $form_action->post_content['reply_to'] ) ? 'frm_hidden' : '' ); ?>" data-emailrow="reply_to">
45
  <?php esc_html_e( 'Reply To', 'formidable' ); ?>
40
  <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'from' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['from'] ); ?>" class="frm_not_email_to frm_email_blur large-text <?php FrmAppHelper::maybe_add_tooltip( 'from', 'open' ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'from' ) ); ?>" />
41
  </p>
42
 
43
+ <p class="frm_error_style frm_from_to_match_row <?php echo ( ( $form_action->post_content['from'] !== $form_action->post_content['email_to'] ) ? 'frm_hidden' : '' ); ?>" data-emailrow="from_to_warning">
44
+ <?php esc_html_e( 'Warning: If you are sending an email to the user, the To and From fields should not match.', 'formidable' ); ?>
45
+ </p>
46
+
47
  <p class="frm_reply_to_container">
48
  <a href="javascript:void(0)" class="button frm_email_buttons frm_reply_to_button <?php echo ( ! empty( $form_action->post_content['reply_to'] ) ? 'frm_hidden' : '' ); ?>" data-emailrow="reply_to">
49
  <?php esc_html_e( 'Reply To', 'formidable' ); ?>
classes/views/frm-forms/add_form_style_options.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <tr>
2
+ <td>
3
+ <label for="frm_option_transition" class="frm_show_upgrade frm_noallow" data-medium="transitions" data-upgrade="Form transitions">
4
+ <?php esc_html_e( 'Page Turn Transitions', 'formidable' ); ?>
5
+ </label>
6
+ </td>
7
+ <td>
8
+ <select id="frm_option_transition" >
9
+ <option disabled>
10
+ <?php esc_html_e( 'Slide horizonally', 'formidable' ); ?>
11
+ </option>
12
+ <option disabled>
13
+ <?php esc_html_e( 'Slide vertically', 'formidable' ); ?>
14
+ </option>
15
+ </select>
16
+ </td>
17
+ </tr>
classes/views/frm-forms/settings-buttons.php CHANGED
@@ -35,6 +35,12 @@
35
  <?php } ?>
36
  </td>
37
  </tr>
 
 
 
 
 
 
38
  <tr>
39
  <td><label><?php esc_html_e( 'Submit Button Text', 'formidable' ); ?></label></td>
40
  <td>
35
  <?php } ?>
36
  </td>
37
  </tr>
38
+ <?php do_action( 'frm_add_form_style_tab_options', $values ); ?>
39
+ <tr>
40
+ <td colspan="2">
41
+ <h3><?php esc_html_e( 'Buttons', 'formidable' ); ?></h3>
42
+ </td>
43
+ </tr>
44
  <tr>
45
  <td><label><?php esc_html_e( 'Submit Button Text', 'formidable' ); ?></label></td>
46
  <td>
classes/views/frm-settings/form.php CHANGED
@@ -34,14 +34,14 @@
34
  <?php } ?>
35
  <div id="<?php echo esc_attr( $section['anchor'] ); ?>"
36
  class="<?php echo esc_attr( $section['anchor'] ); ?> tabs-panel <?php echo esc_attr( $current === $section['anchor'] ? 'frm_block' : 'frm_hidden' ); ?>">
 
 
 
37
  <?php if ( isset( $section['ajax'] ) ) { ?>
38
  <div class="frm_ajax_settings_tab frm_<?php echo esc_attr( $section['anchor'] ); ?>_ajax">
39
  <span class="frm-wait"></span>
40
  </div>
41
  <?php } else { ?>
42
- <h2 class="frm-h2">
43
- <?php echo esc_html( $section['name'] ); ?>
44
- </h2>
45
  <?php
46
  if ( isset( $section['class'] ) ) {
47
  call_user_func( array( $section['class'], $section['function'] ) );
34
  <?php } ?>
35
  <div id="<?php echo esc_attr( $section['anchor'] ); ?>"
36
  class="<?php echo esc_attr( $section['anchor'] ); ?> tabs-panel <?php echo esc_attr( $current === $section['anchor'] ? 'frm_block' : 'frm_hidden' ); ?>">
37
+ <h2 class="frm-h2">
38
+ <?php echo FrmAppHelper::kses( $section['name'], array( 'span' ) ); // WPCS: XSS ok. ?>
39
+ </h2>
40
  <?php if ( isset( $section['ajax'] ) ) { ?>
41
  <div class="frm_ajax_settings_tab frm_<?php echo esc_attr( $section['anchor'] ); ?>_ajax">
42
  <span class="frm-wait"></span>
43
  </div>
44
  <?php } else { ?>
 
 
 
45
  <?php
46
  if ( isset( $section['class'] ) ) {
47
  call_user_func( array( $section['class'], $section['function'] ) );
classes/views/frm-settings/tabs.php CHANGED
@@ -13,7 +13,7 @@
13
  ?>
14
  >
15
  <?php FrmAppHelper::icon_by_class( $section['icon'], array( 'aria-hidden' => 'true' ) ); ?>
16
- <?php echo esc_html( $section['name'] ); ?>
17
  </a>
18
  </li>
19
  <?php } ?>
13
  ?>
14
  >
15
  <?php FrmAppHelper::icon_by_class( $section['icon'], array( 'aria-hidden' => 'true' ) ); ?>
16
+ <?php echo FrmAppHelper::kses( $section['name'], array( 'span' ) ); // WPCS: XSS ok. ?>
17
  </a>
18
  </li>
19
  <?php } ?>
classes/views/inbox/list.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="frm_wrap" id="frm_inbox_page">
2
+ <div class="frm_page_container">
3
+ <?php
4
+ FrmAppHelper::get_admin_header(
5
+ array(
6
+ 'label' => __( 'Inbox', 'formidable' ),
7
+ )
8
+ );
9
+ ?>
10
+ <div id="post-body-content">
11
+
12
+ <?php if ( empty( $messages ) ) { ?>
13
+ <div class="frm_no_items">
14
+ <h2><?php esc_html_e( 'You don\'t have any messages', 'formidable' ); ?></h2>
15
+ <p>
16
+ <?php esc_html_e( 'Get the details about new updates, tips, sales, and more. We\'ll keep you in the loop.', 'formidable' ); ?>
17
+ <?php esc_html_e( 'Want more news and email updates?', 'formidable' ); ?>
18
+ </p>
19
+ <form target="_blank" action="//formidablepro.us1.list-manage.com/subscribe/post?u=a4a913790ffb892daacc6f271&id=7e7df15967" method="post" selector="newsletter-form" accept-charset="<?php echo esc_attr( get_bloginfo( 'charset' ) ); ?>" class="frm-fields frm-subscribe">
20
+ <p>
21
+ <input type="text" name="EMAIL" value="<?php echo esc_attr( $user->user_email ); ?>" selector="newsletter-email" placeholder="<?php esc_attr_e( 'Email', 'formidable' ); ?>"/>
22
+ </p>
23
+ <input type="hidden" name="group[4505]" value="4" />
24
+ <p>
25
+ <button type="submit" class="button-primary frm-button-primary">
26
+ <?php esc_html_e( 'Subscribe', 'formidable' ); ?>
27
+ </button>
28
+ </p>
29
+ </form>
30
+ </div>
31
+ <?php } ?>
32
+
33
+ <?php
34
+
35
+ foreach ( $messages as $key => $message ) {
36
+ if ( ! isset( $message['icon'] ) ) {
37
+ $message['icon'] = 'frm_tooltip_icon';
38
+ }
39
+
40
+ if ( isset( $message['dismissed'] ) && isset( $message['dismissed'][ $user->ID ] ) ) {
41
+ continue;
42
+ }
43
+ ?>
44
+ <section class="frm_inbox_card" data-message="<?php echo esc_attr( $key ); ?>">
45
+ <span class="frm_inbox_card_icon" aria-hidden="true">
46
+ <?php FrmAppHelper::icon_by_class( 'frmfont ' . esc_attr( $message['icon'] ) ); ?>
47
+ </span>
48
+ <header>
49
+ <h3>
50
+ <?php echo esc_html( $message['subject'] ); ?>
51
+ </h3>
52
+ <span class="frm_inbox_date">
53
+ <?php
54
+ if ( ! isset( $message['read'] ) || ! isset( $message['read'][ $user->ID ] ) ) {
55
+ $inbox->mark_read( $key );
56
+ ?>
57
+ <span class="frm_inbox_unread"></span>
58
+ <?php
59
+ }
60
+
61
+ printf(
62
+ /* translators: %s: Time stamp */
63
+ esc_html__( '%s ago', 'formidable' ),
64
+ esc_html( FrmAppHelper::human_time_diff( $message['created'] ) )
65
+ );
66
+ ?>
67
+ </span>
68
+ </header>
69
+ <div class="frm_inbox_body">
70
+ <p><?php echo FrmAppHelper::kses( $message['message'], array( 'a', 'p', 'div', 'span', 'br' ) ); // WPCS: XSS ok. ?></p>
71
+ </div>
72
+ <footer>
73
+ <?php echo FrmAppHelper::kses( $message['cta'], array( 'a' ) ); // WPCS: XSS ok. ?>
74
+ </footer>
75
+ </section>
76
+ <?php
77
+ }
78
+ ?>
79
+ </div>
80
+ </div>
81
+ </div>
classes/views/shared/errors.php CHANGED
@@ -9,6 +9,24 @@ if ( isset( $message ) && '' !== $message ) {
9
  }
10
  }
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  if ( isset( $warnings ) && is_array( $warnings ) && count( $warnings ) > 0 ) {
13
  ?>
14
  <div class="frm_warning_style inline" role="alert">
9
  }
10
  }
11
 
12
+ if ( ! isset( $show_messages ) ) {
13
+ $show_messages = array();
14
+ }
15
+ $show_messages = apply_filters( 'frm_message_list', $show_messages );
16
+ if ( is_array( $show_messages ) && count( $show_messages ) > 0 ) {
17
+ ?>
18
+ <div class="frm_warning_style" role="alert">
19
+ <ul id="frm_messages">
20
+ <?php
21
+ foreach ( $show_messages as $m ) {
22
+ echo '<li>' . FrmAppHelper::kses( $m, array( 'a', 'br' ) ) . '</li>'; // WPCS: XSS ok.
23
+ }
24
+ ?>
25
+ </ul>
26
+ </div>
27
+ <?php
28
+ }
29
+
30
  if ( isset( $warnings ) && is_array( $warnings ) && count( $warnings ) > 0 ) {
31
  ?>
32
  <div class="frm_warning_style inline" role="alert">
classes/views/shared/review.php CHANGED
@@ -1,14 +1,7 @@
1
  <div class="notice notice-info is-dismissible frm-review-notice">
2
  <div class="frm-satisfied">
3
  <p>
4
- <?php
5
- printf(
6
- /* translators: %s: User name, %2$d: number of entries */
7
- esc_html__( 'Congratulations%1$s! You have collected %2$d form submissions.', 'formidable' ),
8
- esc_html( $name ),
9
- absint( $entries )
10
- );
11
- ?>
12
  <br/>
13
  <?php esc_html_e( 'Are you enjoying Formidable Forms?', 'formidable' ); ?>
14
  </p>
1
  <div class="notice notice-info is-dismissible frm-review-notice">
2
  <div class="frm-satisfied">
3
  <p>
4
+ <?php echo esc_html( $title ); ?>
 
 
 
 
 
 
 
5
  <br/>
6
  <?php esc_html_e( 'Are you enjoying Formidable Forms?', 'formidable' ); ?>
7
  </p>
css/_single_theme.css.php CHANGED
@@ -9,7 +9,19 @@ $label_margin = (int) $width + 10;
9
  $minus_icons = FrmStylesHelper::minus_icons();
10
  $arrow_icons = FrmStylesHelper::arrow_icons();
11
 
 
12
  ?>
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  .frm_forms.<?php echo esc_html( $style_class ); ?>{
15
  max-width:<?php echo esc_html( $form_width . $important ); ?>;
@@ -424,17 +436,6 @@ if ( ! empty( $important ) ) {
424
  width:auto<?php echo esc_html( $important ); ?>;
425
  }
426
 
427
- .<?php echo esc_html( $style_class ); ?> input[disabled],
428
- .<?php echo esc_html( $style_class ); ?> select[disabled],
429
- .<?php echo esc_html( $style_class ); ?> textarea[disabled],
430
- .<?php echo esc_html( $style_class ); ?> input[readonly],
431
- .<?php echo esc_html( $style_class ); ?> select[readonly],
432
- .<?php echo esc_html( $style_class ); ?> textarea[readonly]{
433
- background-color:<?php echo esc_html( $bg_color_disabled . $important ); ?>;
434
- color:<?php echo esc_html( $text_color_disabled . $important ); ?>;
435
- border-color:<?php echo esc_html( $border_color_disabled . $important ); ?>;
436
- }
437
-
438
  /* These do not work if they are combined */
439
  .<?php echo esc_html( $style_class ); ?> input::placeholder,
440
  .<?php echo esc_html( $style_class ); ?> textarea::placeholder{
@@ -801,6 +802,8 @@ if ( ! empty( $important ) ) {
801
  outline:none<?php echo esc_html( $important ); ?>;
802
  }
803
 
 
 
804
  .<?php echo esc_html( $style_class ); ?> .frm_form_field.frm_total input,
805
  .<?php echo esc_html( $style_class ); ?> .frm_form_field.frm_total textarea{
806
  color: <?php echo esc_html( $text_color . $important ); ?>;
9
  $minus_icons = FrmStylesHelper::minus_icons();
10
  $arrow_icons = FrmStylesHelper::arrow_icons();
11
 
12
+ $vars = array( 'bg_color_disabled', 'text_color_disabled', 'border_color_disabled' );
13
  ?>
14
+ .<?php echo esc_html( $style_class ); ?> {
15
+ <?php
16
+ foreach ( $vars as $var ) {
17
+ if ( isset( $settings[ $var ] ) && $settings[ $var ] !== '' && $settings[ $var ] !== $defaults[ $var ] ) {
18
+ ?>
19
+ --<?php echo esc_html( str_replace( '_', '-', $var ) ); ?>:<?php echo esc_html( $settings[ $var ] ); ?>;
20
+ <?php
21
+ }
22
+ }
23
+ ?>
24
+ }
25
 
26
  .frm_forms.<?php echo esc_html( $style_class ); ?>{
27
  max-width:<?php echo esc_html( $form_width . $important ); ?>;
436
  width:auto<?php echo esc_html( $important ); ?>;
437
  }
438
 
 
 
 
 
 
 
 
 
 
 
 
439
  /* These do not work if they are combined */
440
  .<?php echo esc_html( $style_class ); ?> input::placeholder,
441
  .<?php echo esc_html( $style_class ); ?> textarea::placeholder{
802
  outline:none<?php echo esc_html( $important ); ?>;
803
  }
804
 
805
+ .<?php echo esc_html( $style_class ); ?> .frm_form_field.frm_total_big input,
806
+ .<?php echo esc_html( $style_class ); ?> .frm_form_field.frm_total_big textarea,
807
  .<?php echo esc_html( $style_class ); ?> .frm_form_field.frm_total input,
808
  .<?php echo esc_html( $style_class ); ?> .frm_form_field.frm_total textarea{
809
  color: <?php echo esc_html( $text_color . $important ); ?>;
css/custom_theme.css.php CHANGED
@@ -15,8 +15,19 @@ if ( ! isset( $frm_style ) ) {
15
  $styles = $frm_style->get_all();
16
  $default_style = $frm_style->get_default_style( $styles );
17
  $defaults = FrmStylesHelper::get_settings_for_output( $default_style );
 
18
 
 
19
  ?>
 
 
 
 
 
 
 
 
 
20
 
21
  .frm_hidden,
22
  .frm_add_form_row.frm_hidden,
@@ -67,6 +78,20 @@ legend.frm_hidden{
67
  display:initial;
68
  }
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  .frm_preview_page:before{
71
  content:normal !important;
72
  }
@@ -474,6 +499,18 @@ table.form_results.with_frm_style tr.frm_odd,
474
  <?php } ?>
475
  }
476
 
 
 
 
 
 
 
 
 
 
 
 
 
477
  .frm_collapse .ui-icon{
478
  display:inline-block;
479
  }
@@ -865,6 +902,8 @@ select.frm_loading_lookup{
865
  box-shadow:0 1px 1px rgba(0, 0, 0, 0.075) inset;
866
  }
867
 
 
 
868
  .frm_form_field.frm_total input,
869
  .frm_form_field.frm_total textarea{
870
  opacity:1;
@@ -874,17 +913,22 @@ select.frm_loading_lookup{
874
  -moz-box-shadow:none;
875
  -webkit-box-shadow:none;
876
  width:auto !important;
 
877
  box-shadow:none !important;
878
  display:inline;
879
  -moz-appearance:textfield;
880
  padding:0;
881
  }
882
 
 
 
883
  .frm_form_field.frm_total input::-webkit-outer-spin-button,
884
  .frm_form_field.frm_total input::-webkit-inner-spin-button {
885
  -webkit-appearance: none;
886
  }
887
 
 
 
888
  .frm_form_field.frm_total input:focus,
889
  .frm_form_field.frm_total textarea:focus{
890
  background-color:transparent;
15
  $styles = $frm_style->get_all();
16
  $default_style = $frm_style->get_default_style( $styles );
17
  $defaults = FrmStylesHelper::get_settings_for_output( $default_style );
18
+ $important = empty( $defaults['important_style'] ) ? '' : ' !important';
19
 
20
+ $vars = array( 'bg_color_disabled', 'text_color_disabled', 'border_color_disabled' );
21
  ?>
22
+ .with_frm_style {
23
+ <?php
24
+ foreach ( $vars as $var ) {
25
+ ?>
26
+ --<?php echo esc_html( str_replace( '_', '-', $var ) ); ?>:<?php echo esc_html( $defaults[ $var ] ); ?>;
27
+ <?php
28
+ }
29
+ ?>
30
+ }
31
 
32
  .frm_hidden,
33
  .frm_add_form_row.frm_hidden,
78
  display:initial;
79
  }
80
 
81
+ .with_frm_style input[disabled],
82
+ .with_frm_style select[disabled],
83
+ .with_frm_style textarea[disabled],
84
+ .with_frm_style input[readonly],
85
+ .with_frm_style select[readonly],
86
+ .with_frm_style textarea[readonly]{
87
+ background-color:<?php echo esc_html( $defaults['bg_color_disabled'] ); ?>;
88
+ background-color:var(--bg-color-disabled)<?php echo esc_html( $important ); ?>;
89
+ color:<?php echo esc_html( $defaults['text_color_disabled'] ); ?>;
90
+ color:var(--text-color-disabled)<?php echo esc_html( $important ); ?>;
91
+ border-color:<?php echo esc_html( $defaults['border_color_disabled'] ); ?>;
92
+ border-color:var(--border-color-disabled)<?php echo esc_html( $important ); ?>;
93
+ }
94
+
95
  .frm_preview_page:before{
96
  content:normal !important;
97
  }
499
  <?php } ?>
500
  }
501
 
502
+ <?php if ( ! empty( $defaults['border_color'] ) ) { ?>
503
+ .frm_color_block {
504
+ background-color:<?php echo esc_html( FrmStylesHelper::adjust_brightness( $defaults['border_color'], 45 ) ); ?>;
505
+ padding: 40px;
506
+ }
507
+
508
+ .with_frm_style .frm-show-form .frm_color_block.frm_section_heading h3,
509
+ .frm_color_block.frm_section_heading h3 {
510
+ border-width: 0 !important;
511
+ }
512
+ <?php } ?>
513
+
514
  .frm_collapse .ui-icon{
515
  display:inline-block;
516
  }
902
  box-shadow:0 1px 1px rgba(0, 0, 0, 0.075) inset;
903
  }
904
 
905
+ .frm_form_field.frm_total_big input,
906
+ .frm_form_field.frm_total_big textarea,
907
  .frm_form_field.frm_total input,
908
  .frm_form_field.frm_total textarea{
909
  opacity:1;
913
  -moz-box-shadow:none;
914
  -webkit-box-shadow:none;
915
  width:auto !important;
916
+ height:auto !important;
917
  box-shadow:none !important;
918
  display:inline;
919
  -moz-appearance:textfield;
920
  padding:0;
921
  }
922
 
923
+ .frm_form_field.frm_total_big input::-webkit-outer-spin-button,
924
+ .frm_form_field.frm_total_big input::-webkit-inner-spin-button,
925
  .frm_form_field.frm_total input::-webkit-outer-spin-button,
926
  .frm_form_field.frm_total input::-webkit-inner-spin-button {
927
  -webkit-appearance: none;
928
  }
929
 
930
+ .frm_form_field.frm_total_big input:focus,
931
+ .frm_form_field.frm_total_big textarea:focus,
932
  .frm_form_field.frm_total input:focus,
933
  .frm_form_field.frm_total textarea:focus{
934
  background-color:transparent;
css/frm_admin.css CHANGED
@@ -274,6 +274,10 @@ a .frmsvg,
274
  margin: 13px 0 0;
275
  }
276
 
 
 
 
 
277
  ul.frm_form_nav {
278
  margin: 0 auto;
279
  padding-top: 19px;
@@ -2912,6 +2916,7 @@ img.frm_help {
2912
  width: 20px;
2913
  height: 20px;
2914
  position: relative;
 
2915
  }
2916
 
2917
  #frm-show-fields .frm-wait:only-child {
@@ -3663,6 +3668,97 @@ label.frm-example-icon {
3663
  color: green;
3664
  }
3665
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3666
  /* Styles tabs */
3667
 
3668
  #frm_styling_form #frm_delete_style {
@@ -4511,7 +4607,7 @@ a.frm_action_icon:hover {
4511
  .frm-field-action-icons a {
4512
  margin-left: 15px;
4513
  float: right;
4514
- font-size: 17px;
4515
  width: 17px;
4516
  }
4517
 
@@ -6518,16 +6614,16 @@ iframe#dyncontent_ifr {
6518
  }
6519
 
6520
  #frm_styling_form .wp-color-result-text {
6521
- line-height: 28px !important;
6522
  font-size: 15px;
6523
  background: #fff !important;
6524
  }
6525
 
6526
  .wp-picker-open + .wp-picker-input-wrap {
6527
  position: absolute;
6528
- margin-left: -80px;
6529
- margin-top: 2px;
6530
- width: 79px;
6531
  }
6532
 
6533
  .frm6 .wp-picker-open + .wp-picker-input-wrap {
@@ -6541,6 +6637,8 @@ iframe#dyncontent_ifr {
6541
  color: var(--dark-grey);
6542
  font-size: 15px;
6543
  width: 100%;
 
 
6544
  }
6545
 
6546
  .wp-picker-input-wrap .wp-picker-clear {
274
  margin: 13px 0 0;
275
  }
276
 
277
+ .frm_page_container .frm-header-logo {
278
+ margin-bottom: 6px;
279
+ }
280
+
281
  ul.frm_form_nav {
282
  margin: 0 auto;
283
  padding-top: 19px;
2916
  width: 20px;
2917
  height: 20px;
2918
  position: relative;
2919
+ display: inline-block;
2920
  }
2921
 
2922
  #frm-show-fields .frm-wait:only-child {
3668
  color: green;
3669
  }
3670
 
3671
+ /* Empty List */
3672
+
3673
+ .frm_no_items {
3674
+ margin: 75px auto;
3675
+ text-align: center;
3676
+ color: var(--dark-grey);
3677
+ max-width: 500px;
3678
+ }
3679
+
3680
+ .frm_no_items h2 {
3681
+ font-size: 25px;
3682
+ margin-bottom: 30px !important;
3683
+ }
3684
+
3685
+ .frm_no_items p {
3686
+ font-size: 14px;
3687
+ }
3688
+
3689
+ .frm-subscribe {
3690
+ margin: 30px 0;
3691
+ }
3692
+
3693
+ /* Inbox */
3694
+
3695
+ #frm_inbox_page .frm_page_container {
3696
+ height: auto;
3697
+ }
3698
+
3699
+ .frm_inbox_card {
3700
+ display: grid;
3701
+ grid-template-columns: 72px 1fr;
3702
+ grid-gap: 15px;
3703
+ border-bottom: 1px solid var(--grey-border);
3704
+ padding: 25px;
3705
+ }
3706
+
3707
+ .frm_inbox_card_icon {
3708
+ grid-row: span 3 / span 3;
3709
+ padding-top: 20px;
3710
+ text-align: center
3711
+ }
3712
+
3713
+ .frm_inbox_card_icon svg {
3714
+ height: 48px;
3715
+ width: 48px;
3716
+ color: var(--blue-border);
3717
+ }
3718
+
3719
+ .frm_inbox_card header {
3720
+ display: grid;
3721
+ grid-template-columns: 1fr 150px;
3722
+ align-items: center;
3723
+ }
3724
+
3725
+ .frm_inbox_card h3 {
3726
+ border: none;
3727
+ text-transform: none;
3728
+ margin: 0;
3729
+ padding: 0;
3730
+ font-weight: 600;
3731
+ color: var(--medium-grey);
3732
+ font-size: 16px;
3733
+ }
3734
+
3735
+ .frm_inbox_date {
3736
+ text-align: right;
3737
+ }
3738
+
3739
+ .frm_inbox_count,
3740
+ .frm_inbox_unread {
3741
+ background: var(--orange);
3742
+ color: #fff;
3743
+ border-radius: 50%;
3744
+ display: inline-block;
3745
+ margin-right: 8px;
3746
+ font-size: 11px;
3747
+ text-align: center;
3748
+ }
3749
+
3750
+ .frm_inbox_unread {
3751
+ width: 8px;
3752
+ height: 8px;
3753
+ }
3754
+
3755
+ .frm_inbox_count {
3756
+ min-width: 18px;
3757
+ height: 18px;
3758
+ margin-left: 2px;
3759
+ vertical-align: text-bottom;
3760
+ }
3761
+
3762
  /* Styles tabs */
3763
 
3764
  #frm_styling_form #frm_delete_style {
4607
  .frm-field-action-icons a {
4608
  margin-left: 15px;
4609
  float: right;
4610
+ font-size: 16px;
4611
  width: 17px;
4612
  }
4613
 
6614
  }
6615
 
6616
  #frm_styling_form .wp-color-result-text {
6617
+ line-height: 30px !important;
6618
  font-size: 15px;
6619
  background: #fff !important;
6620
  }
6621
 
6622
  .wp-picker-open + .wp-picker-input-wrap {
6623
  position: absolute;
6624
+ margin-left: -87px;
6625
+ margin-top: 1px;
6626
+ width: 86px;
6627
  }
6628
 
6629
  .frm6 .wp-picker-open + .wp-picker-input-wrap {
6637
  color: var(--dark-grey);
6638
  font-size: 15px;
6639
  width: 100%;
6640
+ line-height: 1;
6641
+ text-align: center;
6642
  }
6643
 
6644
  .wp-picker-input-wrap .wp-picker-clear {
css/frm_blocks.css CHANGED
@@ -13,7 +13,6 @@
13
  -ms-flex-align: center;
14
  align-items: center;
15
  text-align: center;
16
- background-color: #f3f3f4;
17
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
18
  }
19
 
13
  -ms-flex-align: center;
14
  align-items: center;
15
  text-align: center;
 
16
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
17
  }
18
 
formidable.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Formidable Forms
4
  Description: Quickly and easily create drag-and-drop forms
5
- Version: 4.04.05
6
  Plugin URI: https://formidableforms.com/
7
  Author URI: https://formidableforms.com/
8
  Author: Strategy11
2
  /*
3
  Plugin Name: Formidable Forms
4
  Description: Quickly and easily create drag-and-drop forms
5
+ Version: 4.05
6
  Plugin URI: https://formidableforms.com/
7
  Author URI: https://formidableforms.com/
8
  Author: Strategy11
js/formidable.js CHANGED
@@ -453,7 +453,7 @@ function frmFrontFormJS() {
453
  type: 'POST', url: frm_js.ajax_url,
454
  data: jQuery( object ).serialize() + '&action=frm_entries_' + action + '&nonce=' + frm_js.nonce,
455
  success: function( response ) {
456
- var formID, replaceContent, pageOrder, formReturned, contSubmit,
457
  showCaptcha, $fieldCont, key, inCollapsedSection, frmTrigger,
458
  $recaptcha, recaptchaID,
459
  defaultResponse = { 'content': '', 'errors': {}, 'pass': false };
@@ -482,17 +482,24 @@ function frmFrontFormJS() {
482
  response.content = response.content.replace( / frm_pro_form /g, ' frm_pro_form frm_no_hide ' );
483
  replaceContent = jQuery( object ).closest( '.frm_forms' );
484
  removeAddedScripts( replaceContent, formID );
485
- replaceContent.replaceWith( response.content );
486
 
487
- addUrlParam( response );
 
 
488
 
489
- if ( typeof frmThemeOverride_frmAfterSubmit === 'function' ) { // eslint-disable-line camelcase
490
- pageOrder = jQuery( 'input[name="frm_page_order_' + formID + '"]' ).val();
491
- formReturned = jQuery( response.content ).find( 'input[name="form_id"]' ).val();
492
- frmThemeOverride_frmAfterSubmit( formReturned, pageOrder, response.content, object );
493
- }
 
 
494
 
495
- afterFormSubmitted( object, response );
 
 
 
496
 
497
  } else if ( Object.keys( response.errors ).length ) {
498
  // errors were returned
@@ -591,6 +598,21 @@ function frmFrontFormJS() {
591
  }
592
  }
593
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
594
  function addUrlParam( response ) {
595
  var url;
596
  if ( history.pushState && typeof response.page !== 'undefined' ) {
453
  type: 'POST', url: frm_js.ajax_url,
454
  data: jQuery( object ).serialize() + '&action=frm_entries_' + action + '&nonce=' + frm_js.nonce,
455
  success: function( response ) {
456
+ var formID, replaceContent, pageOrder, formReturned, contSubmit, delay,
457
  showCaptcha, $fieldCont, key, inCollapsedSection, frmTrigger,
458
  $recaptcha, recaptchaID,
459
  defaultResponse = { 'content': '', 'errors': {}, 'pass': false };
482
  response.content = response.content.replace( / frm_pro_form /g, ' frm_pro_form frm_no_hide ' );
483
  replaceContent = jQuery( object ).closest( '.frm_forms' );
484
  removeAddedScripts( replaceContent, formID );
485
+ delay = maybeSlideOut( replaceContent, response.content );
486
 
487
+ setTimeout(
488
+ function() {
489
+ replaceContent.replaceWith( response.content );
490
 
491
+ addUrlParam( response );
492
+
493
+ if ( typeof frmThemeOverride_frmAfterSubmit === 'function' ) { // eslint-disable-line camelcase
494
+ pageOrder = jQuery( 'input[name="frm_page_order_' + formID + '"]' ).val();
495
+ formReturned = jQuery( response.content ).find( 'input[name="form_id"]' ).val();
496
+ frmThemeOverride_frmAfterSubmit( formReturned, pageOrder, response.content, object );
497
+ }
498
 
499
+ afterFormSubmitted( object, response );
500
+ },
501
+ delay
502
+ );
503
 
504
  } else if ( Object.keys( response.errors ).length ) {
505
  // errors were returned
598
  }
599
  }
600
 
601
+ function maybeSlideOut( oldContent, newContent ) {
602
+ var c,
603
+ newClass = 'frm_slideout';
604
+ if ( newContent.indexOf( ' frm_slide' ) !== -1 ) {
605
+ c = oldContent.children();
606
+ if ( newContent.indexOf( ' frm_going_back' ) !== -1 ) {
607
+ newClass += ' frm_going_back';
608
+ }
609
+ c.removeClass( 'frm_going_back' );
610
+ c.addClass( newClass );
611
+ return 300;
612
+ }
613
+ return 0;
614
+ }
615
+
616
  function addUrlParam( response ) {
617
  var url;
618
  if ( history.pushState && typeof response.page !== 'undefined' ) {
js/formidable.min.js CHANGED
@@ -15,40 +15,40 @@ false){fieldID=getFieldId(field,true);if(!(fieldID in errors))errors[fieldID]=ge
15
  recaptchaID,alreadyChecked;if(isGoingToPrevPage(object))return false;recaptcha=jQuery(object).find('.frm-g-recaptcha[data-size="invisible"], .g-recaptcha[data-size="invisible"]');if(recaptcha.length){recaptchaID=recaptcha.data("rid");alreadyChecked=grecaptcha.getResponse(recaptchaID);if(alreadyChecked.length===0)return recaptcha;else return false}else return false}function executeInvisibleRecaptcha(invisibleRecaptcha){var recaptchaID=invisibleRecaptcha.data("rid");grecaptcha.reset(recaptchaID);grecaptcha.execute(recaptchaID)}
16
  function validateRecaptcha(form,errors){var recaptchaID,response,fieldContainer,fieldID,$recaptcha=jQuery(form).find(".frm-g-recaptcha");if($recaptcha.length){recaptchaID=$recaptcha.data("rid");response=grecaptcha.getResponse(recaptchaID);if(response.length===0){fieldContainer=$recaptcha.closest(".frm_form_field");fieldID=fieldContainer.attr("id").replace("frm_field_","").replace("_container","");errors[fieldID]=""}}return errors}function getFieldValidationMessage(field,messageType){var msg=field.getAttribute(messageType);
17
  if(msg===null)msg="";return msg}function shouldJSValidate(object){var validate=jQuery(object).hasClass("frm_js_validate");if(validate&&typeof frmProForm!=="undefined"&&(frmProForm.savingDraft(object)||frmProForm.goingToPreviousPage(object)))validate=false;return validate}function getFormErrors(object,action){var fieldset;if(typeof action==="undefined")jQuery(object).find('input[name="frm_action"]').val();fieldset=jQuery(object).find(".frm_form_field");fieldset.addClass("frm_doing_ajax");jQuery.ajax({type:"POST",
18
- url:frm_js.ajax_url,data:jQuery(object).serialize()+"&action=frm_entries_"+action+"&nonce="+frm_js.nonce,success:function(response){var formID,replaceContent,pageOrder,formReturned,contSubmit,showCaptcha,$fieldCont,key,inCollapsedSection,frmTrigger,$recaptcha,recaptchaID,defaultResponse={"content":"","errors":{},"pass":false};if(response===null)response=defaultResponse;response=response.replace(/^\s+|\s+$/g,"");if(response.indexOf("{")===0)response=jQuery.parseJSON(response);else response=defaultResponse;
19
  if(typeof response.redirect!=="undefined"){jQuery(document).trigger("frmBeforeFormRedirect",[object,response]);window.location=response.redirect}else if(response.content!==""){removeSubmitLoading(jQuery(object));if(frm_js.offset!=-1)frmFrontForm.scrollMsg(jQuery(object),false);formID=jQuery(object).find('input[name="form_id"]').val();response.content=response.content.replace(/ frm_pro_form /g," frm_pro_form frm_no_hide ");replaceContent=jQuery(object).closest(".frm_forms");removeAddedScripts(replaceContent,
20
- formID);replaceContent.replaceWith(response.content);addUrlParam(response);if(typeof frmThemeOverride_frmAfterSubmit==="function"){pageOrder=jQuery('input[name="frm_page_order_'+formID+'"]').val();formReturned=jQuery(response.content).find('input[name="form_id"]').val();frmThemeOverride_frmAfterSubmit(formReturned,pageOrder,response.content,object)}afterFormSubmitted(object,response)}else if(Object.keys(response.errors).length){removeSubmitLoading(jQuery(object),"enable");contSubmit=true;removeAllErrors();
21
- showCaptcha=false;$fieldCont=null;for(key in response.errors){$fieldCont=jQuery(object).find("#frm_field_"+key+"_container");if($fieldCont.length){if(!$fieldCont.is(":visible")){inCollapsedSection=$fieldCont.closest(".frm_toggle_container");if(inCollapsedSection.length){frmTrigger=inCollapsedSection.prev();if(!frmTrigger.hasClass("frm_trigger"))frmTrigger=frmTrigger.prev(".frm_trigger");frmTrigger.click()}}if($fieldCont.is(":visible")){addFieldError($fieldCont,key,response.errors);contSubmit=false;
22
- $recaptcha=jQuery(object).find("#frm_field_"+key+"_container .frm-g-recaptcha, #frm_field_"+key+"_container .g-recaptcha");if($recaptcha.length){showCaptcha=true;recaptchaID=$recaptcha.data("rid");if(jQuery().grecaptcha)if(recaptchaID)grecaptcha.reset(recaptchaID);else grecaptcha.reset()}}}}jQuery(document).trigger("frmFormErrors",[object,response]);fieldset.removeClass("frm_doing_ajax");scrollToFirstField(object);if(showCaptcha!==true)replaceCheckedRecaptcha(object,false);if(contSubmit)object.submit();
23
- else jQuery(object).prepend(response.error_message)}else{showFileLoading(object);replaceCheckedRecaptcha(object,true);object.submit()}},error:function(){jQuery(object).find('input[type="submit"], input[type="button"]').removeAttr("disabled");object.submit()}})}function afterFormSubmitted(object,response){var formCompleted=jQuery(response.content).find(".frm_message");if(formCompleted.length)jQuery(document).trigger("frmFormComplete",[object,response]);else jQuery(document).trigger("frmPageChanged",
24
- [object,response])}function removeAddedScripts(formContainer,formID){var endReplace=jQuery(".frm_end_ajax_"+formID);if(endReplace.length){formContainer.nextUntil(".frm_end_ajax_"+formID).remove();endReplace.remove()}}function addUrlParam(response){var url;if(history.pushState&&typeof response.page!=="undefined"){url=addQueryVar("frm_page",response.page);window.history.pushState({"html":response.html},"","?"+url)}}function addQueryVar(key,value){var kvp,i,x;key=encodeURI(key);value=encodeURI(value);
25
- kvp=document.location.search.substr(1).split("&");i=kvp.length;while(i--){x=kvp[i].split("=");if(x[0]==key){x[1]=value;kvp[i]=x.join("=");break}}if(i<0)kvp[kvp.length]=[key,value].join("=");return kvp.join("&")}function addFieldError($fieldCont,key,jsErrors){var input,id,describedBy;if($fieldCont.length&&$fieldCont.is(":visible")){$fieldCont.addClass("frm_blank_field");input=$fieldCont.find("input, select, textarea");id="frm_error_field_"+key;describedBy=input.attr("aria-describedby");if(typeof frmThemeOverride_frmPlaceError===
26
- "function")frmThemeOverride_frmPlaceError(key,jsErrors);else{$fieldCont.append('<div class="frm_error" id="'+id+'">'+jsErrors[key]+"</div>");if(typeof describedBy==="undefined")describedBy=id;else if(describedBy.indexOf(id)===-1)describedBy=describedBy+" "+id;input.attr("aria-describedby",describedBy)}input.attr("aria-invalid",true);jQuery(document).trigger("frmAddFieldError",[$fieldCont,key,jsErrors])}}function removeFieldError($fieldCont){var errorMessage=$fieldCont.find(".frm_error"),errorId=errorMessage.attr("id"),
27
- input=$fieldCont.find("input, select, textarea"),describedBy=input.attr("aria-describedby");$fieldCont.removeClass("frm_blank_field has-error");errorMessage.remove();input.attr("aria-invalid",false);if(typeof describedBy!=="undefined"){describedBy=describedBy.replace(errorId,"");input.attr("aria-describedby",describedBy)}}function removeAllErrors(){jQuery(".form-field").removeClass("frm_blank_field has-error");jQuery(".form-field .frm_error").replaceWith("");jQuery(".frm_error_style").remove()}function scrollToFirstField(object){var field=
28
- jQuery(object).find(".frm_blank_field:first");if(field.length)frmFrontForm.scrollMsg(field,object,true)}function showSubmitLoading($object){showLoadingIndicator($object);disableSubmitButton($object);disableSaveDraft($object)}function showLoadingIndicator($object){if(!$object.hasClass("frm_loading_form")&&!$object.hasClass("frm_loading_prev")){addLoadingClass($object);$object.trigger("frmStartFormLoading")}}function addLoadingClass($object){var loadingClass=isGoingToPrevPage($object)?"frm_loading_prev":
29
- "frm_loading_form";$object.addClass(loadingClass)}function isGoingToPrevPage($object){return typeof frmProForm!=="undefined"&&frmProForm.goingToPreviousPage($object)}function removeSubmitLoading($object,enable,processesRunning){var loadingForm;if(processesRunning>0)return;loadingForm=jQuery(".frm_loading_form");loadingForm.removeClass("frm_loading_form");loadingForm.removeClass("frm_loading_prev");loadingForm.trigger("frmEndFormLoading");if(enable==="enable"){enableSubmitButton(loadingForm);enableSaveDraft(loadingForm)}}
30
- function showFileLoading(object){var fileval,loading=document.getElementById("frm_loading");if(loading!==null){fileval=jQuery(object).find("input[type=file]").val();if(typeof fileval!=="undefined"&&fileval!=="")setTimeout(function(){jQuery(loading).fadeIn("slow")},2E3)}}function replaceCheckedRecaptcha(object,checkPage){var morePages,$recapField=jQuery(object).find(".frm-g-recaptcha, .g-recaptcha");if($recapField.length){if(checkPage){morePages=jQuery(object).find(".frm_next_page").length<1||jQuery(object).find(".frm_next_page").val()<
31
- 1;if(!morePages)return}$recapField.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">')}}function clearDefault(){toggleDefault(jQuery(this),"clear")}function replaceDefault(){toggleDefault(jQuery(this),"replace")}function toggleDefault($thisField,e){var thisVal,v=$thisField.data("frmval").replace(/(\n|\r\n)/g,"\r");if(v===""||typeof v==="undefined")return false;thisVal=$thisField.val().replace(/(\n|\r\n)/g,"\r");if("replace"===e){if(thisVal===
32
- "")$thisField.addClass("frm_default").val(v)}else if(thisVal==v)$thisField.removeClass("frm_default").val("")}function resendEmail(){var $link=jQuery(this),entryId=this.getAttribute("data-eid"),formId=this.getAttribute("data-fid"),label=$link.find(".frm_link_label");if(label.length<1)label=$link;label.append('<span class="frm-wait"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:entryId,form_id:formId,nonce:frm_js.nonce},success:function(msg){var admin=
33
- document.getElementById("wpbody");if(admin===null)label.html(msg);else{label.html("");$link.after(msg)}}});return false}function confirmClick(){var message=jQuery(this).data("frmconfirm");return confirm(message)}function toggleDiv(){var div=jQuery(this).data("frmtoggle");if(jQuery(div).is(":visible"))jQuery(div).slideUp("fast");else jQuery(div).slideDown("fast");return false}function addIndexOfFallbackForIE8(){var len,from;if(!Array.prototype.indexOf)Array.prototype.indexOf=function(elt){len=this.length>>>
34
- 0;from=Number(arguments[1])||0;from=from<0?Math.ceil(from):Math.floor(from);if(from<0)from+=len;for(;from<len;from++)if(from in this&&this[from]===elt)return from;return-1}}function addTrimFallbackForIE8(){if(typeof String.prototype.trim!=="function")String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}}function addFilterFallbackForIE8(){var t,len,res,thisp,i,val;if(!Array.prototype.filter)Array.prototype.filter=function(fun){if(this===void 0||this===null)throw new TypeError;t=Object(this);
35
- len=t.length>>>0;if(typeof fun!=="function")throw new TypeError;res=[];thisp=arguments[1];for(i=0;i<len;i++)if(i in t){val=t[i];if(fun.call(thisp,val,i,t))res.push(val)}return res}}function addKeysFallbackForIE8(){var keys,i;if(!Object.keys)Object.keys=function(obj){keys=[];for(i in obj)if(obj.hasOwnProperty(i))keys.push(i);return keys}}return{init:function(){jQuery(document).off("submit.formidable",".frm-show-form");jQuery(document).on("submit.formidable",".frm-show-form",frmFrontForm.submitForm);
36
- jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){if(jQuery(this).val()==="")jQuery(this).blur()});jQuery(document).on("focus",".frm_toggle_default",clearDefault);jQuery(document).on("blur",".frm_toggle_default",replaceDefault);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(resendEmail);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"]',
37
- frmFrontForm.fieldValueChanged);jQuery(document).on("change keyup",".frm-show-form .frm_inside_container input, .frm-show-form .frm_inside_container select, .frm-show-form .frm_inside_container textarea",maybeShowLabel);jQuery(document).on("click","a[data-frmconfirm]",confirmClick);jQuery("a[data-frmtoggle]").click(toggleDiv);addIndexOfFallbackForIE8();addTrimFallbackForIE8();addFilterFallbackForIE8();addKeysFallbackForIE8()},getFieldId:function(field,fullID){return getFieldId(field,fullID)},renderRecaptcha:function(captcha){var formID,
38
- recaptchaID,size=captcha.getAttribute("data-size"),rendered=captcha.getAttribute("data-rid")!==null,params={"sitekey":captcha.getAttribute("data-sitekey"),"size":size,"theme":captcha.getAttribute("data-theme")};if(rendered)return;if(size==="invisible"){formID=jQuery(captcha).closest("form").find('input[name="form_id"]').val();jQuery(captcha).closest(".frm_form_field .frm_primary_label").hide();params.callback=function(token){frmFrontForm.afterRecaptcha(token,formID)}}recaptchaID=grecaptcha.render(captcha.id,
39
- params);captcha.setAttribute("data-rid",recaptchaID)},afterSingleRecaptcha:function(){var object=jQuery(".frm-show-form .g-recaptcha").closest("form")[0];frmFrontForm.submitFormNow(object)},afterRecaptcha:function(token,formID){var object=jQuery("#frm_form_"+formID+"_container form")[0];frmFrontForm.submitFormNow(object)},submitForm:function(e){frmFrontForm.submitFormManual(e,this)},submitFormManual:function(e,object){var isPro,errors,invisibleRecaptcha=hasInvisibleRecaptcha(object),classList=object.className.trim().split(/\s+/gi);
40
- if(classList&&invisibleRecaptcha.length<1){isPro=classList.indexOf("frm_pro_form")>-1;if(!isPro)return}if(jQuery("body").hasClass("wp-admin")&&jQuery(object).closest(".frmapi-form").length<1)return;e.preventDefault();if(typeof frmProForm!=="undefined"&&typeof frmProForm.submitAllowed==="function")if(!frmProForm.submitAllowed(object))return;if(invisibleRecaptcha.length){showLoadingIndicator(jQuery(object));executeInvisibleRecaptcha(invisibleRecaptcha)}else{errors=frmFrontForm.validateFormSubmit(object);
41
- if(Object.keys(errors).length===0){showSubmitLoading(jQuery(object));frmFrontForm.submitFormNow(object,classList)}}},submitFormNow:function(object){var hasFileFields,classList=object.className.trim().split(/\s+/gi);if(classList.indexOf("frm_ajax_submit")>-1){hasFileFields=jQuery(object).find('input[type="file"]').filter(function(){return!!this.value}).length;if(hasFileFields<1){action=jQuery(object).find('input[name="frm_action"]').val();frmFrontForm.checkFormErrors(object,action)}else object.submit()}else object.submit()},
42
- validateFormSubmit:function(object){if(typeof tinyMCE!=="undefined"&&jQuery(object).find(".wp-editor-wrap").length)tinyMCE.triggerSave();jsErrors=[];if(shouldJSValidate(object)){frmFrontForm.getAjaxFormErrors(object);if(Object.keys(jsErrors).length)frmFrontForm.addAjaxFormErrors(object)}return jsErrors},getAjaxFormErrors:function(object){var customErrors,key;jsErrors=validateForm(object);if(typeof frmThemeOverride_jsErrors==="function"){action=jQuery(object).find('input[name="frm_action"]').val();
43
- customErrors=frmThemeOverride_jsErrors(action,object);if(Object.keys(customErrors).length)for(key in customErrors)jsErrors[key]=customErrors[key]}return jsErrors},addAjaxFormErrors:function(object){var key,$fieldCont;removeAllErrors();for(key in jsErrors){$fieldCont=jQuery(object).find("#frm_field_"+key+"_container");if($fieldCont.length)addFieldError($fieldCont,key,jsErrors);else delete jsErrors[key]}scrollToFirstField(object)},checkFormErrors:function(object,action){getFormErrors(object,action)},
44
- checkRequiredField:function(field,errors){return checkRequiredField(field,errors)},showSubmitLoading:function($object){showSubmitLoading($object)},removeSubmitLoading:function($object,enable,processesRunning){removeSubmitLoading($object,enable,processesRunning)},scrollToID:function(id){var object=jQuery(document.getElementById(id));frmFrontForm.scrollMsg(object,false)},scrollMsg:function(id,object,animate){var newPos,m,b,screenTop,screenBottom,scrollObj="";if(typeof object==="undefined"){scrollObj=
45
- jQuery(document.getElementById("frm_form_"+id+"_container"));if(scrollObj.length<1)return}else if(typeof id==="string")scrollObj=jQuery(object).find("#frm_field_"+id+"_container");else scrollObj=id;newPos=scrollObj.offset().top;if(!newPos||frm_js.offset==="-1")return;newPos=newPos-frm_js.offset;m=jQuery("html").css("margin-top");b=jQuery("body").css("margin-top");if(m||b)newPos=newPos-parseInt(m)-parseInt(b);if(newPos&&window.innerHeight){screenTop=document.documentElement.scrollTop||document.body.scrollTop;
46
- screenBottom=screenTop+window.innerHeight;if(newPos>screenBottom||newPos<screenTop){if(typeof animate==="undefined")jQuery(window).scrollTop(newPos);else jQuery("html,body").animate({scrollTop:newPos},500);return false}}},fieldValueChanged:function(e){var fieldId=frmFrontForm.getFieldId(this,false);if(!fieldId||typeof fieldId==="undefined")return;if(e.frmTriggered&&e.frmTriggered==fieldId)return;jQuery(document).trigger("frmFieldChanged",[this,fieldId,e]);if(e.selfTriggered!==true)maybeValidateChange(fieldId,
47
- this)},savingDraft:function(object){console.warn("DEPRECATED: function frmFrontForm.savingDraft in v3.0 use frmProForm.savingDraft");if(typeof frmProForm!=="undefined")return frmProForm.savingDraft(object)},goingToPreviousPage:function(object){console.warn("DEPRECATED: function frmFrontForm.goingToPreviousPage in v3.0 use frmProForm.goingToPreviousPage");if(typeof frmProForm!=="undefined")return frmProForm.goingToPreviousPage(object)},hideOrShowFields:function(){console.warn("DEPRECATED: function frmFrontForm.hideOrShowFields in v3.0 use frmProForm.hideOrShowFields");
48
- if(typeof frmProForm!=="undefined")frmProForm.hideOrShowFields()},hidePreviouslyHiddenFields:function(){console.warn("DEPRECATED: function frmFrontForm.hidePreviouslyHiddenFields in v3.0 use frmProForm.hidePreviouslyHiddenFields");if(typeof frmProForm!=="undefined")frmProForm.hidePreviouslyHiddenFields()},checkDependentDynamicFields:function(ids){console.warn("DEPRECATED: function frmFrontForm.checkDependentDynamicFields in v3.0 use frmProForm.checkDependentDynamicFields");if(typeof frmProForm!==
49
- "undefined")frmProForm.checkDependentDynamicFields(ids)},checkDependentLookupFields:function(ids){console.warn("DEPRECATED: function frmFrontForm.checkDependentLookupFields in v3.0 use frmProForm.checkDependentLookupFields");if(typeof frmProForm!=="undefined")frmProForm.checkDependentLookupFields(ids)},loadGoogle:function(){console.warn("DEPRECATED: function frmFrontForm.loadGoogle in v3.0 use frmProForm.loadGoogle");frmProForm.loadGoogle()},escapeHtml:function(text){return text.replace(/&/g,"&amp;").replace(/</g,
50
- "&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")},invisible:function(classes){jQuery(classes).css("visibility","hidden")},visible:function(classes){jQuery(classes).css("visibility","visible")}}}frmFrontForm=frmFrontFormJS();jQuery(document).ready(function(){frmFrontForm.init()});function frmRecaptcha(){var c,cl,captchas=jQuery(".frm-g-recaptcha");for(c=0,cl=captchas.length;c<cl;c++)frmFrontForm.renderRecaptcha(captchas[c])}
51
- function frmAfterRecaptcha(token){frmFrontForm.afterSingleRecaptcha(token)}
52
  function frmUpdateField(entryId,fieldId,value,message,num){jQuery(document.getElementById("frm_update_field_"+entryId+"_"+fieldId+"_"+num)).html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_update_field_ajax",entry_id:entryId,field_id:fieldId,value:value,nonce:frm_js.nonce},success:function(){if(message.replace(/^\s+|\s+$/g,"")==="")jQuery(document.getElementById("frm_update_field_"+entryId+"_"+fieldId+"_"+num)).fadeOut("slow");else jQuery(document.getElementById("frm_update_field_"+
53
  entryId+"_"+fieldId+"_"+num)).replaceWith(message)}})}
54
  function frmDeleteEntry(entryId,prefix){console.warn("DEPRECATED: function frmDeleteEntry in v2.0.13 use frmFrontForm.deleteEntry");jQuery(document.getElementById("frm_delete_"+entryId)).replaceWith('<span class="frm-loading-img" id="frm_delete_'+entryId+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:entryId,nonce:frm_js.nonce},success:function(html){if(html.replace(/^\s+|\s+$/g,"")==="success")jQuery(document.getElementById(prefix+entryId)).fadeOut("slow");
15
  recaptchaID,alreadyChecked;if(isGoingToPrevPage(object))return false;recaptcha=jQuery(object).find('.frm-g-recaptcha[data-size="invisible"], .g-recaptcha[data-size="invisible"]');if(recaptcha.length){recaptchaID=recaptcha.data("rid");alreadyChecked=grecaptcha.getResponse(recaptchaID);if(alreadyChecked.length===0)return recaptcha;else return false}else return false}function executeInvisibleRecaptcha(invisibleRecaptcha){var recaptchaID=invisibleRecaptcha.data("rid");grecaptcha.reset(recaptchaID);grecaptcha.execute(recaptchaID)}
16
  function validateRecaptcha(form,errors){var recaptchaID,response,fieldContainer,fieldID,$recaptcha=jQuery(form).find(".frm-g-recaptcha");if($recaptcha.length){recaptchaID=$recaptcha.data("rid");response=grecaptcha.getResponse(recaptchaID);if(response.length===0){fieldContainer=$recaptcha.closest(".frm_form_field");fieldID=fieldContainer.attr("id").replace("frm_field_","").replace("_container","");errors[fieldID]=""}}return errors}function getFieldValidationMessage(field,messageType){var msg=field.getAttribute(messageType);
17
  if(msg===null)msg="";return msg}function shouldJSValidate(object){var validate=jQuery(object).hasClass("frm_js_validate");if(validate&&typeof frmProForm!=="undefined"&&(frmProForm.savingDraft(object)||frmProForm.goingToPreviousPage(object)))validate=false;return validate}function getFormErrors(object,action){var fieldset;if(typeof action==="undefined")jQuery(object).find('input[name="frm_action"]').val();fieldset=jQuery(object).find(".frm_form_field");fieldset.addClass("frm_doing_ajax");jQuery.ajax({type:"POST",
18
+ url:frm_js.ajax_url,data:jQuery(object).serialize()+"&action=frm_entries_"+action+"&nonce="+frm_js.nonce,success:function(response){var formID,replaceContent,pageOrder,formReturned,contSubmit,delay,showCaptcha,$fieldCont,key,inCollapsedSection,frmTrigger,$recaptcha,recaptchaID,defaultResponse={"content":"","errors":{},"pass":false};if(response===null)response=defaultResponse;response=response.replace(/^\s+|\s+$/g,"");if(response.indexOf("{")===0)response=jQuery.parseJSON(response);else response=defaultResponse;
19
  if(typeof response.redirect!=="undefined"){jQuery(document).trigger("frmBeforeFormRedirect",[object,response]);window.location=response.redirect}else if(response.content!==""){removeSubmitLoading(jQuery(object));if(frm_js.offset!=-1)frmFrontForm.scrollMsg(jQuery(object),false);formID=jQuery(object).find('input[name="form_id"]').val();response.content=response.content.replace(/ frm_pro_form /g," frm_pro_form frm_no_hide ");replaceContent=jQuery(object).closest(".frm_forms");removeAddedScripts(replaceContent,
20
+ formID);delay=maybeSlideOut(replaceContent,response.content);setTimeout(function(){replaceContent.replaceWith(response.content);addUrlParam(response);if(typeof frmThemeOverride_frmAfterSubmit==="function"){pageOrder=jQuery('input[name="frm_page_order_'+formID+'"]').val();formReturned=jQuery(response.content).find('input[name="form_id"]').val();frmThemeOverride_frmAfterSubmit(formReturned,pageOrder,response.content,object)}afterFormSubmitted(object,response)},delay)}else if(Object.keys(response.errors).length){removeSubmitLoading(jQuery(object),
21
+ "enable");contSubmit=true;removeAllErrors();showCaptcha=false;$fieldCont=null;for(key in response.errors){$fieldCont=jQuery(object).find("#frm_field_"+key+"_container");if($fieldCont.length){if(!$fieldCont.is(":visible")){inCollapsedSection=$fieldCont.closest(".frm_toggle_container");if(inCollapsedSection.length){frmTrigger=inCollapsedSection.prev();if(!frmTrigger.hasClass("frm_trigger"))frmTrigger=frmTrigger.prev(".frm_trigger");frmTrigger.click()}}if($fieldCont.is(":visible")){addFieldError($fieldCont,
22
+ key,response.errors);contSubmit=false;$recaptcha=jQuery(object).find("#frm_field_"+key+"_container .frm-g-recaptcha, #frm_field_"+key+"_container .g-recaptcha");if($recaptcha.length){showCaptcha=true;recaptchaID=$recaptcha.data("rid");if(jQuery().grecaptcha)if(recaptchaID)grecaptcha.reset(recaptchaID);else grecaptcha.reset()}}}}jQuery(document).trigger("frmFormErrors",[object,response]);fieldset.removeClass("frm_doing_ajax");scrollToFirstField(object);if(showCaptcha!==true)replaceCheckedRecaptcha(object,
23
+ false);if(contSubmit)object.submit();else jQuery(object).prepend(response.error_message)}else{showFileLoading(object);replaceCheckedRecaptcha(object,true);object.submit()}},error:function(){jQuery(object).find('input[type="submit"], input[type="button"]').removeAttr("disabled");object.submit()}})}function afterFormSubmitted(object,response){var formCompleted=jQuery(response.content).find(".frm_message");if(formCompleted.length)jQuery(document).trigger("frmFormComplete",[object,response]);else jQuery(document).trigger("frmPageChanged",
24
+ [object,response])}function removeAddedScripts(formContainer,formID){var endReplace=jQuery(".frm_end_ajax_"+formID);if(endReplace.length){formContainer.nextUntil(".frm_end_ajax_"+formID).remove();endReplace.remove()}}function maybeSlideOut(oldContent,newContent){var c,newClass="frm_slideout";if(newContent.indexOf(" frm_slide")!==-1){c=oldContent.children();if(newContent.indexOf(" frm_going_back")!==-1)newClass+=" frm_going_back";c.removeClass("frm_going_back");c.addClass(newClass);return 300}return 0}
25
+ function addUrlParam(response){var url;if(history.pushState&&typeof response.page!=="undefined"){url=addQueryVar("frm_page",response.page);window.history.pushState({"html":response.html},"","?"+url)}}function addQueryVar(key,value){var kvp,i,x;key=encodeURI(key);value=encodeURI(value);kvp=document.location.search.substr(1).split("&");i=kvp.length;while(i--){x=kvp[i].split("=");if(x[0]==key){x[1]=value;kvp[i]=x.join("=");break}}if(i<0)kvp[kvp.length]=[key,value].join("=");return kvp.join("&")}function addFieldError($fieldCont,
26
+ key,jsErrors){var input,id,describedBy;if($fieldCont.length&&$fieldCont.is(":visible")){$fieldCont.addClass("frm_blank_field");input=$fieldCont.find("input, select, textarea");id="frm_error_field_"+key;describedBy=input.attr("aria-describedby");if(typeof frmThemeOverride_frmPlaceError==="function")frmThemeOverride_frmPlaceError(key,jsErrors);else{$fieldCont.append('<div class="frm_error" id="'+id+'">'+jsErrors[key]+"</div>");if(typeof describedBy==="undefined")describedBy=id;else if(describedBy.indexOf(id)===
27
+ -1)describedBy=describedBy+" "+id;input.attr("aria-describedby",describedBy)}input.attr("aria-invalid",true);jQuery(document).trigger("frmAddFieldError",[$fieldCont,key,jsErrors])}}function removeFieldError($fieldCont){var errorMessage=$fieldCont.find(".frm_error"),errorId=errorMessage.attr("id"),input=$fieldCont.find("input, select, textarea"),describedBy=input.attr("aria-describedby");$fieldCont.removeClass("frm_blank_field has-error");errorMessage.remove();input.attr("aria-invalid",false);if(typeof describedBy!==
28
+ "undefined"){describedBy=describedBy.replace(errorId,"");input.attr("aria-describedby",describedBy)}}function removeAllErrors(){jQuery(".form-field").removeClass("frm_blank_field has-error");jQuery(".form-field .frm_error").replaceWith("");jQuery(".frm_error_style").remove()}function scrollToFirstField(object){var field=jQuery(object).find(".frm_blank_field:first");if(field.length)frmFrontForm.scrollMsg(field,object,true)}function showSubmitLoading($object){showLoadingIndicator($object);disableSubmitButton($object);
29
+ disableSaveDraft($object)}function showLoadingIndicator($object){if(!$object.hasClass("frm_loading_form")&&!$object.hasClass("frm_loading_prev")){addLoadingClass($object);$object.trigger("frmStartFormLoading")}}function addLoadingClass($object){var loadingClass=isGoingToPrevPage($object)?"frm_loading_prev":"frm_loading_form";$object.addClass(loadingClass)}function isGoingToPrevPage($object){return typeof frmProForm!=="undefined"&&frmProForm.goingToPreviousPage($object)}function removeSubmitLoading($object,
30
+ enable,processesRunning){var loadingForm;if(processesRunning>0)return;loadingForm=jQuery(".frm_loading_form");loadingForm.removeClass("frm_loading_form");loadingForm.removeClass("frm_loading_prev");loadingForm.trigger("frmEndFormLoading");if(enable==="enable"){enableSubmitButton(loadingForm);enableSaveDraft(loadingForm)}}function showFileLoading(object){var fileval,loading=document.getElementById("frm_loading");if(loading!==null){fileval=jQuery(object).find("input[type=file]").val();if(typeof fileval!==
31
+ "undefined"&&fileval!=="")setTimeout(function(){jQuery(loading).fadeIn("slow")},2E3)}}function replaceCheckedRecaptcha(object,checkPage){var morePages,$recapField=jQuery(object).find(".frm-g-recaptcha, .g-recaptcha");if($recapField.length){if(checkPage){morePages=jQuery(object).find(".frm_next_page").length<1||jQuery(object).find(".frm_next_page").val()<1;if(!morePages)return}$recapField.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">')}}
32
+ function clearDefault(){toggleDefault(jQuery(this),"clear")}function replaceDefault(){toggleDefault(jQuery(this),"replace")}function toggleDefault($thisField,e){var thisVal,v=$thisField.data("frmval").replace(/(\n|\r\n)/g,"\r");if(v===""||typeof v==="undefined")return false;thisVal=$thisField.val().replace(/(\n|\r\n)/g,"\r");if("replace"===e){if(thisVal==="")$thisField.addClass("frm_default").val(v)}else if(thisVal==v)$thisField.removeClass("frm_default").val("")}function resendEmail(){var $link=
33
+ jQuery(this),entryId=this.getAttribute("data-eid"),formId=this.getAttribute("data-fid"),label=$link.find(".frm_link_label");if(label.length<1)label=$link;label.append('<span class="frm-wait"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:entryId,form_id:formId,nonce:frm_js.nonce},success:function(msg){var admin=document.getElementById("wpbody");if(admin===null)label.html(msg);else{label.html("");$link.after(msg)}}});return false}function confirmClick(){var message=
34
+ jQuery(this).data("frmconfirm");return confirm(message)}function toggleDiv(){var div=jQuery(this).data("frmtoggle");if(jQuery(div).is(":visible"))jQuery(div).slideUp("fast");else jQuery(div).slideDown("fast");return false}function addIndexOfFallbackForIE8(){var len,from;if(!Array.prototype.indexOf)Array.prototype.indexOf=function(elt){len=this.length>>>0;from=Number(arguments[1])||0;from=from<0?Math.ceil(from):Math.floor(from);if(from<0)from+=len;for(;from<len;from++)if(from in this&&this[from]===
35
+ elt)return from;return-1}}function addTrimFallbackForIE8(){if(typeof String.prototype.trim!=="function")String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}}function addFilterFallbackForIE8(){var t,len,res,thisp,i,val;if(!Array.prototype.filter)Array.prototype.filter=function(fun){if(this===void 0||this===null)throw new TypeError;t=Object(this);len=t.length>>>0;if(typeof fun!=="function")throw new TypeError;res=[];thisp=arguments[1];for(i=0;i<len;i++)if(i in t){val=t[i];if(fun.call(thisp,
36
+ val,i,t))res.push(val)}return res}}function addKeysFallbackForIE8(){var keys,i;if(!Object.keys)Object.keys=function(obj){keys=[];for(i in obj)if(obj.hasOwnProperty(i))keys.push(i);return keys}}return{init:function(){jQuery(document).off("submit.formidable",".frm-show-form");jQuery(document).on("submit.formidable",".frm-show-form",frmFrontForm.submitForm);jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){if(jQuery(this).val()==="")jQuery(this).blur()});jQuery(document).on("focus",
37
+ ".frm_toggle_default",clearDefault);jQuery(document).on("blur",".frm_toggle_default",replaceDefault);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(resendEmail);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"]',frmFrontForm.fieldValueChanged);jQuery(document).on("change keyup",".frm-show-form .frm_inside_container input, .frm-show-form .frm_inside_container select, .frm-show-form .frm_inside_container textarea",
38
+ maybeShowLabel);jQuery(document).on("click","a[data-frmconfirm]",confirmClick);jQuery("a[data-frmtoggle]").click(toggleDiv);addIndexOfFallbackForIE8();addTrimFallbackForIE8();addFilterFallbackForIE8();addKeysFallbackForIE8()},getFieldId:function(field,fullID){return getFieldId(field,fullID)},renderRecaptcha:function(captcha){var formID,recaptchaID,size=captcha.getAttribute("data-size"),rendered=captcha.getAttribute("data-rid")!==null,params={"sitekey":captcha.getAttribute("data-sitekey"),"size":size,
39
+ "theme":captcha.getAttribute("data-theme")};if(rendered)return;if(size==="invisible"){formID=jQuery(captcha).closest("form").find('input[name="form_id"]').val();jQuery(captcha).closest(".frm_form_field .frm_primary_label").hide();params.callback=function(token){frmFrontForm.afterRecaptcha(token,formID)}}recaptchaID=grecaptcha.render(captcha.id,params);captcha.setAttribute("data-rid",recaptchaID)},afterSingleRecaptcha:function(){var object=jQuery(".frm-show-form .g-recaptcha").closest("form")[0];frmFrontForm.submitFormNow(object)},
40
+ afterRecaptcha:function(token,formID){var object=jQuery("#frm_form_"+formID+"_container form")[0];frmFrontForm.submitFormNow(object)},submitForm:function(e){frmFrontForm.submitFormManual(e,this)},submitFormManual:function(e,object){var isPro,errors,invisibleRecaptcha=hasInvisibleRecaptcha(object),classList=object.className.trim().split(/\s+/gi);if(classList&&invisibleRecaptcha.length<1){isPro=classList.indexOf("frm_pro_form")>-1;if(!isPro)return}if(jQuery("body").hasClass("wp-admin")&&jQuery(object).closest(".frmapi-form").length<
41
+ 1)return;e.preventDefault();if(typeof frmProForm!=="undefined"&&typeof frmProForm.submitAllowed==="function")if(!frmProForm.submitAllowed(object))return;if(invisibleRecaptcha.length){showLoadingIndicator(jQuery(object));executeInvisibleRecaptcha(invisibleRecaptcha)}else{errors=frmFrontForm.validateFormSubmit(object);if(Object.keys(errors).length===0){showSubmitLoading(jQuery(object));frmFrontForm.submitFormNow(object,classList)}}},submitFormNow:function(object){var hasFileFields,classList=object.className.trim().split(/\s+/gi);
42
+ if(classList.indexOf("frm_ajax_submit")>-1){hasFileFields=jQuery(object).find('input[type="file"]').filter(function(){return!!this.value}).length;if(hasFileFields<1){action=jQuery(object).find('input[name="frm_action"]').val();frmFrontForm.checkFormErrors(object,action)}else object.submit()}else object.submit()},validateFormSubmit:function(object){if(typeof tinyMCE!=="undefined"&&jQuery(object).find(".wp-editor-wrap").length)tinyMCE.triggerSave();jsErrors=[];if(shouldJSValidate(object)){frmFrontForm.getAjaxFormErrors(object);
43
+ if(Object.keys(jsErrors).length)frmFrontForm.addAjaxFormErrors(object)}return jsErrors},getAjaxFormErrors:function(object){var customErrors,key;jsErrors=validateForm(object);if(typeof frmThemeOverride_jsErrors==="function"){action=jQuery(object).find('input[name="frm_action"]').val();customErrors=frmThemeOverride_jsErrors(action,object);if(Object.keys(customErrors).length)for(key in customErrors)jsErrors[key]=customErrors[key]}return jsErrors},addAjaxFormErrors:function(object){var key,$fieldCont;
44
+ removeAllErrors();for(key in jsErrors){$fieldCont=jQuery(object).find("#frm_field_"+key+"_container");if($fieldCont.length)addFieldError($fieldCont,key,jsErrors);else delete jsErrors[key]}scrollToFirstField(object)},checkFormErrors:function(object,action){getFormErrors(object,action)},checkRequiredField:function(field,errors){return checkRequiredField(field,errors)},showSubmitLoading:function($object){showSubmitLoading($object)},removeSubmitLoading:function($object,enable,processesRunning){removeSubmitLoading($object,
45
+ enable,processesRunning)},scrollToID:function(id){var object=jQuery(document.getElementById(id));frmFrontForm.scrollMsg(object,false)},scrollMsg:function(id,object,animate){var newPos,m,b,screenTop,screenBottom,scrollObj="";if(typeof object==="undefined"){scrollObj=jQuery(document.getElementById("frm_form_"+id+"_container"));if(scrollObj.length<1)return}else if(typeof id==="string")scrollObj=jQuery(object).find("#frm_field_"+id+"_container");else scrollObj=id;newPos=scrollObj.offset().top;if(!newPos||
46
+ frm_js.offset==="-1")return;newPos=newPos-frm_js.offset;m=jQuery("html").css("margin-top");b=jQuery("body").css("margin-top");if(m||b)newPos=newPos-parseInt(m)-parseInt(b);if(newPos&&window.innerHeight){screenTop=document.documentElement.scrollTop||document.body.scrollTop;screenBottom=screenTop+window.innerHeight;if(newPos>screenBottom||newPos<screenTop){if(typeof animate==="undefined")jQuery(window).scrollTop(newPos);else jQuery("html,body").animate({scrollTop:newPos},500);return false}}},fieldValueChanged:function(e){var fieldId=
47
+ frmFrontForm.getFieldId(this,false);if(!fieldId||typeof fieldId==="undefined")return;if(e.frmTriggered&&e.frmTriggered==fieldId)return;jQuery(document).trigger("frmFieldChanged",[this,fieldId,e]);if(e.selfTriggered!==true)maybeValidateChange(fieldId,this)},savingDraft:function(object){console.warn("DEPRECATED: function frmFrontForm.savingDraft in v3.0 use frmProForm.savingDraft");if(typeof frmProForm!=="undefined")return frmProForm.savingDraft(object)},goingToPreviousPage:function(object){console.warn("DEPRECATED: function frmFrontForm.goingToPreviousPage in v3.0 use frmProForm.goingToPreviousPage");
48
+ if(typeof frmProForm!=="undefined")return frmProForm.goingToPreviousPage(object)},hideOrShowFields:function(){console.warn("DEPRECATED: function frmFrontForm.hideOrShowFields in v3.0 use frmProForm.hideOrShowFields");if(typeof frmProForm!=="undefined")frmProForm.hideOrShowFields()},hidePreviouslyHiddenFields:function(){console.warn("DEPRECATED: function frmFrontForm.hidePreviouslyHiddenFields in v3.0 use frmProForm.hidePreviouslyHiddenFields");if(typeof frmProForm!=="undefined")frmProForm.hidePreviouslyHiddenFields()},
49
+ checkDependentDynamicFields:function(ids){console.warn("DEPRECATED: function frmFrontForm.checkDependentDynamicFields in v3.0 use frmProForm.checkDependentDynamicFields");if(typeof frmProForm!=="undefined")frmProForm.checkDependentDynamicFields(ids)},checkDependentLookupFields:function(ids){console.warn("DEPRECATED: function frmFrontForm.checkDependentLookupFields in v3.0 use frmProForm.checkDependentLookupFields");if(typeof frmProForm!=="undefined")frmProForm.checkDependentLookupFields(ids)},loadGoogle:function(){console.warn("DEPRECATED: function frmFrontForm.loadGoogle in v3.0 use frmProForm.loadGoogle");
50
+ frmProForm.loadGoogle()},escapeHtml:function(text){return text.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")},invisible:function(classes){jQuery(classes).css("visibility","hidden")},visible:function(classes){jQuery(classes).css("visibility","visible")}}}frmFrontForm=frmFrontFormJS();jQuery(document).ready(function(){frmFrontForm.init()});
51
+ function frmRecaptcha(){var c,cl,captchas=jQuery(".frm-g-recaptcha");for(c=0,cl=captchas.length;c<cl;c++)frmFrontForm.renderRecaptcha(captchas[c])}function frmAfterRecaptcha(token){frmFrontForm.afterSingleRecaptcha(token)}
52
  function frmUpdateField(entryId,fieldId,value,message,num){jQuery(document.getElementById("frm_update_field_"+entryId+"_"+fieldId+"_"+num)).html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_update_field_ajax",entry_id:entryId,field_id:fieldId,value:value,nonce:frm_js.nonce},success:function(){if(message.replace(/^\s+|\s+$/g,"")==="")jQuery(document.getElementById("frm_update_field_"+entryId+"_"+fieldId+"_"+num)).fadeOut("slow");else jQuery(document.getElementById("frm_update_field_"+
53
  entryId+"_"+fieldId+"_"+num)).replaceWith(message)}})}
54
  function frmDeleteEntry(entryId,prefix){console.warn("DEPRECATED: function frmDeleteEntry in v2.0.13 use frmFrontForm.deleteEntry");jQuery(document.getElementById("frm_delete_"+entryId)).replaceWith('<span class="frm-loading-img" id="frm_delete_'+entryId+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:entryId,nonce:frm_js.nonce},success:function(html){if(html.replace(/^\s+|\s+$/g,"")==="success")jQuery(document.getElementById(prefix+entryId)).fadeOut("slow");
js/formidable_admin.js CHANGED
@@ -3457,6 +3457,20 @@ function frmAdminBuildJS() {
3457
  });
3458
  }
3459
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3460
  function checkActiveAction( type ) {
3461
  var limit = parseInt( jQuery( '.frm_' + type + '_action' ).data( 'limit' ), 10 );
3462
  var len = jQuery( '.frm_single_' + type + '_settings' ).length;
@@ -5353,6 +5367,9 @@ function frmAdminBuildJS() {
5353
  } else if ( document.getElementById( 'frm_dyncontent' ) !== null ) {
5354
  // only load on views settings page
5355
  frmAdminBuild.viewInit();
 
 
 
5356
  } else {
5357
  // New form selection page
5358
  initNewFormModal();
@@ -5552,6 +5569,7 @@ function frmAdminBuildJS() {
5552
  //BCC, CC, and Reply To button functionality
5553
  $formActions.on( 'click', '.frm_email_buttons', showEmailRow );
5554
  $formActions.on( 'click', '.frm_remove_field', hideEmailRow );
 
5555
  $formActions.on( 'change', '.frm_tax_selector', changePosttaxRow );
5556
  $formActions.on( 'change', 'select.frm_single_post_field', checkDupPost );
5557
  $formActions.on( 'change', 'select.frm_toggle_post_content', togglePostContent );
@@ -5798,6 +5816,31 @@ function frmAdminBuildJS() {
5798
  setDefaultPostStatus();
5799
  },
5800
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5801
  styleInit: function() {
5802
  collapseAllSections();
5803
 
3457
  });
3458
  }
3459
 
3460
+ function showEmailWarning() {
3461
+ /*jshint validthis:true */
3462
+ var actionBox = jQuery( this ).closest( '.frm_form_action_settings' ),
3463
+ emailRowSelector = '.frm_from_to_match_row',
3464
+ fromVal = actionBox.find( 'input[name$="[post_content][from]"]' ).val(),
3465