Formidable Forms – Form Builder for WordPress - Version 2.0.12

Version Description

  • Add option to center form on page
  • Improve styling classes for more consistency across different field classes, and make all classes responsive
  • Added a few more styling classes: frm_three_fourths, frm_two_fifths, frm_three_fifths
  • Remove in-place-editing from the field keys on the form builder page
  • Add 'frm_after_update_field_name' hook for changing a field name during editing
  • Update Bootstrap multiselect to v0.9.13
  • Add license page to prepare for add-ons. Big things are coming.
  • Fix: Prevent loading icon from being huge in some themes
  • Fix: When the jQuery UI css is loaded by another plugin on the form builder page, the required icon looked the same whether required or not. This styling conflict is resolved.
  • Fix: Make sure the form description size can be changed in the styling settings.
  • Pro Features:
  • Views can now be filtered by fields in the repeating sections.
  • Added [parent_id] shortcode for use in views. This shortcode will only have a value when the displaying entries in repeating sections.
  • Allow views to be created using the repeated entries. Since each repeating row is an entry in a hidden form, we can allow views to be created using those repeating rows for more flexability.
  • Added order parameter to frm-entry-links
  • Allow options in a post status field to come from the form builder. The options should have separate values and the saved values can include 'publish', 'draft', 'private', 'scheduled'.
  • Remove the option to lock field and form keys. This is more of a hassle than a feature.
  • Allow the entry key to be used with the frm-field-value shortcode instead of forcing the entry
  • Replaced inline 50px height for image fields with .frm_image_from_url class for easier control
  • Improve file upload field in Chrome to prevent extra space from showing.
  • Added 'frm_save_post_name' filter. This can be used for custom form actions that create posts.
  • Added 'frm_display_data_opts' filter.
  • Prevent frm_display_id custom field from saving when a field is selected in the create post settings instead of customized content
  • Fix: When forms were submitted without ajax, the redirect wasn't working consistently.
  • Fix: The shortcodes weren't processing in the message shown after an entry is updated.
  • Fix: When we prevented the PayPal action from triggering on import, we stopped all actions. This is now fixed so an action can be set (in the code) to be triggered on import. Posts will now be created on import again.
  • Fix: The dynamic list field was showing the entry ID in the entries tab instead of the value.
  • Fix: The Add row button wasn't showing in a repeating section when returning to edit an entry if there were more than two rows in the section.
  • Fix: Improve dropping a field between two sections.
  • Fix: Remove nonce check for frm-entry-update-field shortode. Page caching gives front-end nonce checks issues.
  • Fix: We changed the parameters sent to the frm_after_update_field hook without realizing it. The 'field_id' attribute was sometimes an object, but was previously always an integer. This has been updated for reverse compatibility, and 'field' has been added with the full field object.
  • Fix: If you put -100 for the start date in a date field, -100 would show in the date field instead of 1915. This is now working correctly for dynamic values like this with three digits.
  • Fix: When filtering a view with a Dynamic field, NOT EQUAL TO will work correctly.
  • Fix: Double quotes were causing trouble when included inside an error message returned by the frm_validate_field_entry hook
  • Fix: Graphs using x_axis and start_date were having trouble
  • Fix: The js error after selecting an option in autocomplete field is fixed when there are calculations in the form.
Download this release

Release Info

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

Code changes from version 2.0.11 to 2.0.12

Files changed (39) hide show
  1. classes/controllers/FrmAddonsController.php +14 -0
  2. classes/controllers/FrmAppController.php +1 -1
  3. classes/controllers/FrmFieldsController.php +3 -0
  4. classes/controllers/FrmFormActionsController.php +5 -3
  5. classes/controllers/FrmFormsController.php +12 -9
  6. classes/controllers/FrmHooksController.php +4 -0
  7. classes/controllers/FrmSettingsController.php +6 -1
  8. classes/helpers/FrmAppHelper.php +8 -18
  9. classes/helpers/FrmFieldsHelper.php +1 -0
  10. classes/helpers/FrmFormsHelper.php +9 -2
  11. classes/helpers/FrmXMLHelper.php +4 -1
  12. classes/models/EDD_SL_Plugin_Updater.php +341 -0
  13. classes/models/FrmAddon.php +168 -0
  14. classes/models/FrmEntry.php +9 -0
  15. classes/models/FrmEntryFormat.php +2 -2
  16. classes/models/FrmEntryMeta.php +12 -3
  17. classes/models/FrmField.php +10 -2
  18. classes/models/FrmForm.php +1 -0
  19. classes/models/FrmFormAction.php +9 -0
  20. classes/models/FrmSettings.php +0 -3
  21. classes/models/FrmStyle.php +1 -0
  22. classes/views/addons/settings.php +31 -0
  23. classes/views/frm-entries/form.php +1 -1
  24. classes/views/frm-form-actions/_action_inside.php +1 -5
  25. classes/views/frm-forms/add_field.php +1 -5
  26. classes/views/frm-forms/settings.php +25 -6
  27. classes/views/frm-statistics/list.php +5 -5
  28. classes/views/styles/_general.php +6 -0
  29. css/_single_theme.css.php +41 -44
  30. css/custom_theme.css.php +113 -165
  31. css/frm_admin.css +33 -5
  32. formidable.php +1 -1
  33. js/bootstrap-multiselect.js +429 -229
  34. js/formidable.js +222 -147
  35. js/formidable.min.js +49 -48
  36. js/formidable_admin.js +38 -14
  37. languages/formidable-da_DK.po +1 -1
  38. languages/formidable-fr_FR.po +2 -2
  39. readme.txt +39 -1
classes/controllers/FrmAddonsController.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FrmAddonsController {
4
+
5
+ public static function show_addons() {
6
+ $plugins = apply_filters( 'frm_installed_addons', array() );
7
+ if ( empty( $plugins ) ) {
8
+ _e( 'There are not any plugins on your site the require a license', 'formidable' );
9
+ return;
10
+ }
11
+
12
+ include( FrmAppHelper::plugin_path() . '/classes/views/addons/settings.php' );
13
+ }
14
+ }
classes/controllers/FrmAppController.php CHANGED
@@ -23,7 +23,7 @@ class FrmAppController {
23
  FrmAppHelper::load_font_style();
24
  }
25
 
26
- public static function get_form_nav( $form, $show_nav = '', $title = 'show' ) {
27
  global $pagenow, $frm_vars;
28
 
29
  $show_nav = FrmAppHelper::get_param( 'show_nav', $show_nav, 'get', 'absint' );
23
  FrmAppHelper::load_font_style();
24
  }
25
 
26
+ public static function get_form_nav( $form, $show_nav = false, $title = 'show' ) {
27
  global $pagenow, $frm_vars;
28
 
29
  $show_nav = FrmAppHelper::get_param( 'show_nav', $show_nav, 'get', 'absint' );
classes/controllers/FrmFieldsController.php CHANGED
@@ -119,6 +119,9 @@ class FrmFieldsController {
119
  }
120
 
121
  FrmField::update( $id, array( $field => $value ) );
 
 
 
122
  echo stripslashes( wp_kses_post( $value ) );
123
  wp_die();
124
  }
119
  }
120
 
121
  FrmField::update( $id, array( $field => $value ) );
122
+
123
+ do_action( 'frm_after_update_field_' . $field, compact( 'id', 'value' ) );
124
+
125
  echo stripslashes( wp_kses_post( $value ) );
126
  wp_die();
127
  }
classes/controllers/FrmFormActionsController.php CHANGED
@@ -241,7 +241,7 @@ class FrmFormActionsController {
241
  public static function trigger_actions( $event, $form, $entry, $type = 'all', $args = array() ) {
242
  $form_actions = FrmFormAction::get_action_for_form( ( is_object( $form ) ? $form->id : $form ), $type );
243
 
244
- if ( empty( $form_actions ) || ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) ) {
245
  return;
246
  }
247
 
@@ -254,9 +254,11 @@ class FrmFormActionsController {
254
 
255
  $stored_actions = $action_priority = array();
256
 
257
- foreach ( $form_actions as $action ) {
258
 
259
- if ( ! in_array( $event, $action->post_content['event'] ) ) {
 
 
260
  continue;
261
  }
262
 
241
  public static function trigger_actions( $event, $form, $entry, $type = 'all', $args = array() ) {
242
  $form_actions = FrmFormAction::get_action_for_form( ( is_object( $form ) ? $form->id : $form ), $type );
243
 
244
+ if ( empty( $form_actions ) ) {
245
  return;
246
  }
247
 
254
 
255
  $stored_actions = $action_priority = array();
256
 
257
+ $importing = in_array( $event, array( 'create', 'update' ) ) && defined( 'WP_IMPORTING' ) && WP_IMPORTING;
258
 
259
+ foreach ( $form_actions as $action ) {
260
+ $trigger_on_import = $importing && in_array( 'import', $action->post_content['event'] );
261
+ if ( ! in_array( $event, $action->post_content['event'] ) && ! $trigger_on_import ) {
262
  continue;
263
  }
264
 
classes/controllers/FrmFormsController.php CHANGED
@@ -112,7 +112,7 @@ class FrmFormsController {
112
  if ( ! $id || ! is_numeric($id) ) {
113
  $id = FrmAppHelper::get_param( 'id', '', 'get', 'absint' );
114
  }
115
- return self::get_settings_vars($id, '', $message);
116
  }
117
 
118
  public static function update_settings() {
@@ -130,7 +130,7 @@ class FrmFormsController {
130
  FrmForm::update( $id, $_POST );
131
 
132
  $message = __( 'Settings Successfully Updated', 'formidable' );
133
- return self::get_settings_vars($id, '', $message);
134
  }
135
 
136
  public static function edit_key() {
@@ -185,9 +185,9 @@ class FrmFormsController {
185
  FrmForm::update( $id, $values );
186
  $message = __( 'Form was Successfully Updated', 'formidable' );
187
  if ( defined( 'DOING_AJAX' ) ) {
188
- die( $message );
189
  }
190
- return self::get_edit_vars( $id, '', $message );
191
  }
192
  }
193
 
@@ -227,7 +227,7 @@ class FrmFormsController {
227
  $form = FrmForm::duplicate( $params['id'], $params['template'], true );
228
  $message = ($params['template']) ? __( 'Form template was Successfully Created', 'formidable' ) : __( 'Form was Successfully Copied', 'formidable' );
229
  if ( $form ) {
230
- return self::get_edit_vars($form, '', $message, true);
231
  } else {
232
  return self::display_forms_list($params, __( 'There was a problem creating new template.', 'formidable' ));
233
  }
@@ -564,7 +564,7 @@ class FrmFormsController {
564
  return $save;
565
  }
566
 
567
- private static function get_edit_vars( $id, $errors = '', $message = '', $create_link = false ) {
568
  global $frm_vars;
569
 
570
  $form = FrmForm::getOne( $id );
@@ -609,7 +609,7 @@ class FrmFormsController {
609
  }
610
  }
611
 
612
- public static function get_settings_vars( $id, $errors = '', $message = '' ) {
613
  FrmAppHelper::permission_check( 'frm_edit_forms' );
614
 
615
  global $frm_vars;
@@ -1145,8 +1145,11 @@ class FrmFormsController {
1145
  $message = $frm_settings->failed_msg;
1146
  $class = 'frm_error_style';
1147
  }
1148
- $message = apply_filters('frm_content', $message, $form, $created);
1149
- $message = '<div class="' . esc_attr( $class ) . '">' . wpautop( do_shortcode( $message ) ) . '</div>';
 
 
 
1150
  $message = apply_filters('frm_main_feedback', $message, $form, $created);
1151
 
1152
  if ( ! isset($form->options['show_form']) || $form->options['show_form'] ) {
112
  if ( ! $id || ! is_numeric($id) ) {
113
  $id = FrmAppHelper::get_param( 'id', '', 'get', 'absint' );
114
  }
115
+ return self::get_settings_vars( $id, array(), $message );
116
  }
117
 
118
  public static function update_settings() {
130
  FrmForm::update( $id, $_POST );
131
 
132
  $message = __( 'Settings Successfully Updated', 'formidable' );
133
+ return self::get_settings_vars( $id, array(), $message );
134
  }
135
 
136
  public static function edit_key() {
185
  FrmForm::update( $id, $values );
186
  $message = __( 'Form was Successfully Updated', 'formidable' );
187
  if ( defined( 'DOING_AJAX' ) ) {
188
+ wp_die( $message );
189
  }
190
+ return self::get_edit_vars( $id, array(), $message );
191
  }
192
  }
193
 
227
  $form = FrmForm::duplicate( $params['id'], $params['template'], true );
228
  $message = ($params['template']) ? __( 'Form template was Successfully Created', 'formidable' ) : __( 'Form was Successfully Copied', 'formidable' );
229
  if ( $form ) {
230
+ return self::get_edit_vars( $form, array(), $message, true );
231
  } else {
232
  return self::display_forms_list($params, __( 'There was a problem creating new template.', 'formidable' ));
233
  }
564
  return $save;
565
  }
566
 
567
+ private static function get_edit_vars( $id, $errors = array(), $message = '', $create_link = false ) {
568
  global $frm_vars;
569
 
570
  $form = FrmForm::getOne( $id );
609
  }
610
  }
611
 
612
+ public static function get_settings_vars( $id, $errors = array(), $message = '' ) {
613
  FrmAppHelper::permission_check( 'frm_edit_forms' );
614
 
615
  global $frm_vars;
1145
  $message = $frm_settings->failed_msg;
1146
  $class = 'frm_error_style';
1147
  }
1148
+
1149
+ $message = FrmFormsHelper::get_success_message( array(
1150
+ 'message' => $message, 'form' => $form,
1151
+ 'entry_id' => $created, 'class' => $class,
1152
+ ) );
1153
  $message = apply_filters('frm_main_feedback', $message, $form, $created);
1154
 
1155
  if ( ! isset($form->options['show_form']) || $form->options['show_form'] ) {
classes/controllers/FrmHooksController.php CHANGED
@@ -142,6 +142,10 @@ class FrmHooksController {
142
  add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' );
143
  add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' );
144
 
 
 
 
 
145
  // Fields Controller
146
  add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' );
147
  add_action( 'wp_ajax_frm_insert_field', 'FrmFieldsController::create' );
142
  add_action( 'wp_ajax_frm_uninstall', 'FrmAppController::uninstall' );
143
  add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' );
144
 
145
+ // Addons Controller
146
+ add_action('wp_ajax_frm_addon_activate', 'FrmAddon::activate' );
147
+ add_action('wp_ajax_frm_addon_deactivate', 'FrmAddon::deactivate' );
148
+
149
  // Fields Controller
150
  add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' );
151
  add_action( 'wp_ajax_frm_insert_field', 'FrmFieldsController::create' );
classes/controllers/FrmSettingsController.php CHANGED
@@ -22,7 +22,12 @@ class FrmSettingsController {
22
 
23
  $uploads = wp_upload_dir();
24
  $target_path = $uploads['basedir'] . '/formidable/css';
25
- $sections = apply_filters( 'frm_add_settings_section', array() );
 
 
 
 
 
26
 
27
  $captcha_lang = FrmAppHelper::locales( 'captcha' );
28
 
22
 
23
  $uploads = wp_upload_dir();
24
  $target_path = $uploads['basedir'] . '/formidable/css';
25
+
26
+ $sections = array();
27
+ if ( apply_filters( 'frm_include_addon_page', false ) ) {
28
+ $sections['licenses'] = array( 'class' => 'FrmAddonsController', 'function' => 'show_addons' );
29
+ }
30
+ $sections = apply_filters( 'frm_add_settings_section', $sections );
31
 
32
  $captcha_lang = FrmAppHelper::locales( 'captcha' );
33
 
classes/helpers/FrmAppHelper.php CHANGED
@@ -5,12 +5,12 @@ if ( ! defined('ABSPATH') ) {
5
 
6
  class FrmAppHelper {
7
  public static $db_version = 26; //version of the database we are moving to
8
- public static $pro_db_version = 28;
9
 
10
  /**
11
  * @since 2.0
12
  */
13
- public static $plug_version = '2.0.11';
14
 
15
  /**
16
  * @since 1.07.02
@@ -30,30 +30,20 @@ class FrmAppHelper {
30
  return dirname(dirname(dirname(__FILE__)));
31
  }
32
 
33
- public static function plugin_url( $url = '' ) {
34
  //prevously FRM_URL constant
35
- if ( empty($url) ) {
36
- $url = plugins_url('', self::plugin_folder() .'/formidable.php');
37
- }
38
-
39
- if ( is_ssl() && ! preg_match( '/^https:\/\/.*\..*$/', $url ) ) {
40
- $url = str_replace( 'http://', 'https://', $url );
41
- }
42
-
43
- return $url;
44
  }
45
 
46
- public static function relative_plugin_url( $url = '' ) {
47
- $url = self::plugin_url( $url );
48
- return str_replace( array( 'https:', 'http:' ), '', $url );
49
- }
50
 
51
  /**
52
  * @return string Site URL
53
  */
54
  public static function site_url() {
55
- $url = self::plugin_url(site_url());
56
- return $url;
57
  }
58
 
59
  /**
5
 
6
  class FrmAppHelper {
7
  public static $db_version = 26; //version of the database we are moving to
8
+ public static $pro_db_version = 29;
9
 
10
  /**
11
  * @since 2.0
12
  */
13
+ public static $plug_version = '2.0.12';
14
 
15
  /**
16
  * @since 1.07.02
30
  return dirname(dirname(dirname(__FILE__)));
31
  }
32
 
33
+ public static function plugin_url() {
34
  //prevously FRM_URL constant
35
+ return plugins_url( '', self::plugin_folder() .'/formidable.php' );
 
 
 
 
 
 
 
 
36
  }
37
 
38
+ public static function relative_plugin_url() {
39
+ return str_replace( array( 'https:', 'http:' ), '', self::plugin_url() );
40
+ }
 
41
 
42
  /**
43
  * @return string Site URL
44
  */
45
  public static function site_url() {
46
+ return site_url();
 
47
  }
48
 
49
  /**
classes/helpers/FrmFieldsHelper.php CHANGED
@@ -687,6 +687,7 @@ DEFAULT_HTML;
687
  'editlink', 'id', 'key', 'ip',
688
  'siteurl', 'sitename', 'admin_email',
689
  'post[-|_]id', 'created[-|_]at', 'updated[-|_]at', 'updated[-|_]by',
 
690
  );
691
 
692
  foreach ( $fields as $field ) {
687
  'editlink', 'id', 'key', 'ip',
688
  'siteurl', 'sitename', 'admin_email',
689
  'post[-|_]id', 'created[-|_]at', 'updated[-|_]at', 'updated[-|_]by',
690
+ 'parent[-|_]id',
691
  );
692
 
693
  foreach ( $fields as $field ) {
classes/helpers/FrmFormsHelper.php CHANGED
@@ -24,6 +24,7 @@ class FrmFormsHelper {
24
  'onchange' => false,
25
  'exclude' => false,
26
  'class' => '',
 
27
  );
28
  $args = wp_parse_args( $args, $defaults );
29
 
@@ -37,7 +38,7 @@ class FrmFormsHelper {
37
  }
38
 
39
  $where = apply_filters('frm_forms_dropdown', $query, $field_name);
40
- $forms = FrmForm::get_published_forms( $where );
41
  $add_html = array();
42
  self::add_html_attr( $args['onchange'], 'onchange', $add_html );
43
  self::add_html_attr( $args['class'], 'class', $add_html );
@@ -49,7 +50,7 @@ class FrmFormsHelper {
49
  <?php } ?>
50
  <?php foreach ( $forms as $form ) { ?>
51
  <option value="<?php echo esc_attr( $form->id ); ?>" <?php selected( $field_value, $form->id ); ?>><?php
52
- echo ( '' == $form->name ) ? esc_html__( '(no title)', 'formidable' ) : esc_html( FrmAppHelper::truncate( $form->name, 33 ) );
53
  ?></option>
54
  <?php } ?>
55
  </select>
@@ -118,6 +119,12 @@ class FrmFormsHelper {
118
  echo ($sort_col == $col && $sort_dir == 'desc') ? ' asc' : ' desc';
119
  }
120
 
 
 
 
 
 
 
121
  /**
122
  * Used when a form is created
123
  */
24
  'onchange' => false,
25
  'exclude' => false,
26
  'class' => '',
27
+ 'inc_children' => 'exclude',
28
  );
29
  $args = wp_parse_args( $args, $defaults );
30
 
38
  }
39
 
40
  $where = apply_filters('frm_forms_dropdown', $query, $field_name);
41
+ $forms = FrmForm::get_published_forms( $where, 999, $args['inc_children'] );
42
  $add_html = array();
43
  self::add_html_attr( $args['onchange'], 'onchange', $add_html );
44
  self::add_html_attr( $args['class'], 'class', $add_html );
50
  <?php } ?>
51
  <?php foreach ( $forms as $form ) { ?>
52
  <option value="<?php echo esc_attr( $form->id ); ?>" <?php selected( $field_value, $form->id ); ?>><?php
53
+ echo ( '' == $form->name ) ? esc_html__( '(no title)', 'formidable' ) : esc_html( FrmAppHelper::truncate( $form->name, 33 ) ) . ( $form->parent_form_id ? esc_html__( ' (child)', 'formidable' ) : '' ) ;
54
  ?></option>
55
  <?php } ?>
56
  </select>
119
  echo ($sort_col == $col && $sort_dir == 'desc') ? ' asc' : ' desc';
120
  }
121
 
122
+ public static function get_success_message( $atts ) {
123
+ $message = apply_filters( 'frm_content', $atts['message'], $atts['form'], $atts['entry_id'] );
124
+ $message = '<div class="' . esc_attr( $atts['class'] ) . '">' . wpautop( do_shortcode( $message ) ) . '</div>';
125
+ return $message;
126
+ }
127
+
128
  /**
129
  * Used when a form is created
130
  */
classes/helpers/FrmXMLHelper.php CHANGED
@@ -367,9 +367,12 @@ class FrmXMLHelper {
367
 
368
  unset($item);
369
 
 
370
  if ( $post['post_type'] == $form_action_type ) {
371
  $action_control = FrmFormActionsController::get_form_actions( $post['post_excerpt'] );
372
- $post_id = $action_control->maybe_create_action( $post, $imported['form_status'] );
 
 
373
  unset($action_control);
374
  } else if ( $post['post_type'] == 'frm_styles' ) {
375
  // Properly encode post content before inserting the post
367
 
368
  unset($item);
369
 
370
+ $post_id = false;
371
  if ( $post['post_type'] == $form_action_type ) {
372
  $action_control = FrmFormActionsController::get_form_actions( $post['post_excerpt'] );
373
+ if ( $action_control ) {
374
+ $post_id = $action_control->maybe_create_action( $post, $imported['form_status'] );
375
+ }
376
  unset($action_control);
377
  } else if ( $post['post_type'] == 'frm_styles' ) {
378
  // Properly encode post content before inserting the post
classes/models/EDD_SL_Plugin_Updater.php ADDED
@@ -0,0 +1,341 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // uncomment this line for testing
4
+ //set_site_transient( 'update_plugins', null );
5
+
6
+ // Exit if accessed directly
7
+ if ( ! defined( 'ABSPATH' ) ) {
8
+ exit;
9
+ }
10
+
11
+ /**
12
+ * Allows plugins to use their own update API.
13
+ *
14
+ * @author Pippin Williamson
15
+ * @version 1.6
16
+ */
17
+ class EDD_SL_Plugin_Updater {
18
+ private $api_url = '';
19
+ private $api_data = array();
20
+ private $name = '';
21
+ private $slug = '';
22
+ private $version = '';
23
+
24
+ /**
25
+ * Class constructor.
26
+ *
27
+ * @uses plugin_basename()
28
+ * @uses hook()
29
+ *
30
+ * @param string $_api_url The URL pointing to the custom API endpoint.
31
+ * @param string $_plugin_file Path to the plugin file.
32
+ * @param array $_api_data Optional data to send with API calls.
33
+ */
34
+ public function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
35
+ $this->api_url = trailingslashit( $_api_url );
36
+ $this->api_data = $_api_data;
37
+ $this->name = plugin_basename( $_plugin_file );
38
+ $this->slug = basename( $_plugin_file, '.php' );
39
+ $this->version = $_api_data['version'];
40
+
41
+ // Set up hooks.
42
+ $this->init();
43
+ add_action( 'admin_init', array( $this, 'show_changelog' ) );
44
+ }
45
+
46
+ /**
47
+ * Set up WordPress filters to hook into WP's update process.
48
+ *
49
+ * @uses add_filter()
50
+ *
51
+ * @return void
52
+ */
53
+ public function init() {
54
+
55
+ add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
56
+ add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
57
+
58
+ add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
59
+ }
60
+
61
+ /**
62
+ * Check for Updates at the defined API endpoint and modify the update array.
63
+ *
64
+ * This function dives into the update API just when WordPress creates its update array,
65
+ * then adds a custom API call and injects the custom plugin data retrieved from the API.
66
+ * It is reassembled from parts of the native WordPress plugin update code.
67
+ * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
68
+ *
69
+ * @uses api_request()
70
+ *
71
+ * @param array $_transient_data Update array build by WordPress.
72
+ * @return array Modified update array with custom plugin data.
73
+ */
74
+ function check_update( $_transient_data ) {
75
+
76
+ global $pagenow;
77
+
78
+ if( ! is_object( $_transient_data ) ) {
79
+ $_transient_data = new stdClass;
80
+ }
81
+
82
+ if ( 'plugins.php' == $pagenow && is_multisite() ) {
83
+ return $_transient_data;
84
+ }
85
+
86
+ if ( empty( $_transient_data->response ) || empty( $_transient_data->response[ $this->name ] ) ) {
87
+
88
+ $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
89
+
90
+ if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
91
+
92
+ if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
93
+
94
+ if ( empty( $version_info->plugin ) ) {
95
+ $version_info->plugin = $this->name;
96
+ }
97
+
98
+ $_transient_data->response[ $this->name ] = $version_info;
99
+
100
+ }
101
+
102
+ $_transient_data->last_checked = time();
103
+ $_transient_data->checked[ $this->name ] = $this->version;
104
+
105
+ }
106
+ }
107
+
108
+ return $_transient_data;
109
+ }
110
+
111
+ /**
112
+ * show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise!
113
+ *
114
+ * @param string $file
115
+ * @param array $plugin
116
+ */
117
+ public function show_update_notification( $file, $plugin ) {
118
+
119
+ if ( ! current_user_can( 'update_plugins' ) ) {
120
+ return;
121
+ }
122
+
123
+ if ( ! is_multisite() ) {
124
+ return;
125
+ }
126
+
127
+ if ( $this->name != $file ) {
128
+ return;
129
+ }
130
+
131
+ // Remove our filter on the site transient
132
+ remove_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
133
+
134
+ $update_cache = get_site_transient( 'update_plugins' );
135
+
136
+ if ( ! is_object( $update_cache ) || empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
137
+
138
+ $cache_key = md5( 'edd_plugin_' .sanitize_key( $this->name ) . '_version_info' );
139
+ $version_info = get_transient( $cache_key );
140
+
141
+ if( false === $version_info ) {
142
+
143
+ $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
144
+
145
+ set_transient( $cache_key, $version_info, 3600 );
146
+ }
147
+
148
+ if ( ! is_object( $version_info ) ) {
149
+ return;
150
+ }
151
+
152
+ if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
153
+
154
+ $update_cache->response[ $this->name ] = $version_info;
155
+
156
+ }
157
+
158
+ $update_cache->last_checked = time();
159
+ $update_cache->checked[ $this->name ] = $this->version;
160
+
161
+ set_site_transient( 'update_plugins', $update_cache );
162
+
163
+ } else {
164
+
165
+ $version_info = $update_cache->response[ $this->name ];
166
+
167
+ }
168
+
169
+ // Restore our filter
170
+ add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
171
+
172
+ if ( ! empty( $update_cache->response[ $this->name ] ) && version_compare( $this->version, $version_info->new_version, '<' ) ) {
173
+
174
+ // build a plugin list row, with update notification
175
+ $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
176
+ echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
177
+
178
+ $changelog_link = self_admin_url( 'index.php?edd_sl_action=view_plugin_changelog&plugin=' . $this->name . '&slug=' . $this->slug . '&TB_iframe=true&width=772&height=911' );
179
+
180
+ if ( empty( $version_info->download_link ) ) {
181
+ printf(
182
+ __( 'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a>.', 'edd' ),
183
+ esc_html( $version_info->name ),
184
+ esc_url( $changelog_link ),
185
+ esc_html( $version_info->new_version )
186
+ );
187
+ } else {
188
+ printf(
189
+ __( 'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a> or <a href="%4$s">update now</a>.', 'edd' ),
190
+ esc_html( $version_info->name ),
191
+ esc_url( $changelog_link ),
192
+ esc_html( $version_info->new_version ),
193
+ esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) )
194
+ );
195
+ }
196
+
197
+ echo '</div></td></tr>';
198
+ }
199
+ }
200
+
201
+
202
+ /**
203
+ * Updates information on the "View version x.x details" page with custom data.
204
+ *
205
+ * @uses api_request()
206
+ *
207
+ * @param mixed $_data
208
+ * @param string $_action
209
+ * @param object $_args
210
+ * @return object $_data
211
+ */
212
+ function plugins_api_filter( $_data, $_action = '', $_args = null ) {
213
+
214
+ if ( $_action != 'plugin_information' ) {
215
+
216
+ return $_data;
217
+
218
+ }
219
+
220
+ if ( ! isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) {
221
+
222
+ return $_data;
223
+
224
+ }
225
+
226
+ $to_send = array(
227
+ 'slug' => $this->slug,
228
+ 'is_ssl' => is_ssl(),
229
+ 'fields' => array(
230
+ 'banners' => false, // These will be supported soon hopefully
231
+ 'reviews' => false,
232
+ )
233
+ );
234
+
235
+ $api_response = $this->api_request( 'plugin_information', $to_send );
236
+
237
+ if ( false !== $api_response ) {
238
+ $_data = $api_response;
239
+ }
240
+
241
+ return $_data;
242
+ }
243
+
244
+
245
+ /**
246
+ * Disable SSL verification in order to prevent download update failures
247
+ *
248
+ * @param array $args
249
+ * @param string $url
250
+ * @return object $array
251
+ */
252
+ function http_request_args( $args, $url ) {
253
+ // If it is an https request and we are performing a package download, disable ssl verification
254
+ if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
255
+ $args['sslverify'] = false;
256
+ }
257
+ return $args;
258
+ }
259
+
260
+ /**
261
+ * Calls the API and, if successfull, returns the object delivered by the API.
262
+ *
263
+ * @uses get_bloginfo()
264
+ * @uses wp_remote_post()
265
+ * @uses is_wp_error()
266
+ *
267
+ * @param string $_action The requested action.
268
+ * @param array $_data Parameters for the API action.
269
+ * @return false|object
270
+ */
271
+ private function api_request( $_action, $_data ) {
272
+
273
+ global $wp_version;
274
+
275
+ $data = array_merge( $this->api_data, $_data );
276
+
277
+ if ( $data['slug'] != $this->slug ) {
278
+ return;
279
+ }
280
+
281
+ if ( empty( $data['license'] ) ) {
282
+ return;
283
+ }
284
+
285
+ if ( $this->api_url == home_url() ) {
286
+ return false; // Don't allow a plugin to ping itself
287
+ }
288
+
289
+ $api_params = array(
290
+ 'edd_action' => 'get_version',
291
+ 'license' => $data['license'],
292
+ 'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false,
293
+ 'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
294
+ 'slug' => $data['slug'],
295
+ 'author' => $data['author'],
296
+ 'url' => home_url()
297
+ );
298
+
299
+ $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
300
+
301
+ if ( ! is_wp_error( $request ) ) {
302
+ $request = json_decode( wp_remote_retrieve_body( $request ) );
303
+ }
304
+
305
+ if ( $request && isset( $request->sections ) ) {
306
+ $request->sections = maybe_unserialize( $request->sections );
307
+ } else {
308
+ $request = false;
309
+ }
310
+
311
+ return $request;
312
+ }
313
+
314
+ public function show_changelog() {
315
+
316
+ if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
317
+ return;
318
+ }
319
+
320
+ if ( empty( $_REQUEST['plugin'] ) ) {
321
+ return;
322
+ }
323
+
324
+ if ( empty( $_REQUEST['slug'] ) ) {
325
+ return;
326
+ }
327
+
328
+ if ( ! current_user_can( 'update_plugins' ) ) {
329
+ wp_die( __( 'You do not have permission to install plugin updates', 'edd' ), __( 'Error', 'edd' ), array( 'response' => 403 ) );
330
+ }
331
+
332
+ $response = $this->api_request( 'plugin_latest_version', array( 'slug' => $_REQUEST['slug'] ) );
333
+
334
+ if ( $response && isset( $response->sections['changelog'] ) ) {
335
+ echo '<div style="background:#fff;padding:10px;">' . $response->sections['changelog'] . '</div>';
336
+ }
337
+
338
+ exit;
339
+ }
340
+
341
+ }
classes/models/FrmAddon.php ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ die( 'You are not allowed to call this page directly.' );
5
+ }
6
+
7
+ class FrmAddon {
8
+ public $store_url = 'http://formidablepros.com';
9
+ public $plugin_file;
10
+ public $plugin_name;
11
+ public $plugin_slug;
12
+ public $option_name;
13
+ public $version;
14
+ public $author = 'Strategy11';
15
+
16
+ public function __construct() {
17
+
18
+ if ( empty( $this->plugin_slug ) ) {
19
+ $this->plugin_slug = preg_replace( '/[^a-zA-Z0-9_\s]/', '', str_replace( ' ', '_', strtolower( $this->plugin_name ) ) );
20
+ }
21
+ if ( empty( $this->option_name ) ) {
22
+ $this->option_name = 'edd_' . $this->plugin_slug . '_license_';
23
+ }
24
+
25
+ add_filter( 'frm_installed_addons', array( &$this, 'insert_installed_addon' ) );
26
+ }
27
+
28
+ public function insert_installed_addon( $plugins ) {
29
+ $plugins[ $this->plugin_slug ] = $this;
30
+ return $plugins;
31
+ }
32
+
33
+ public static function get_addon( $plugin_slug ) {
34
+ $plugins = apply_filters( 'frm_installed_addons', array() );
35
+ $plugin = false;
36
+ if ( isset( $plugins[ $plugin_slug ] ) ) {
37
+ $plugin = $plugins[ $plugin_slug ];
38
+ }
39
+ return $plugin;
40
+ }
41
+
42
+ public function edd_plugin_updater() {
43
+
44
+ // retrieve our license key from the DB
45
+ $license = trim( get_option( $this->option_name . 'key' ) );
46
+
47
+ if ( ! empty( $license ) ) {
48
+ if ( ! class_exists('EDD_SL_Plugin_Updater') ) {
49
+ include( dirname( __FILE__ ) . '/EDD_SL_EDD_SL_Plugin_Updater.php' );
50
+ }
51
+
52
+ // setup the updater
53
+ new EDD_SL_Plugin_Updater( $this->store_url, $this->plugin_file, array(
54
+ 'version' => $this->version,
55
+ 'license' => $license,
56
+ 'item_name' => $this->plugin_name,
57
+ 'author' => $this->author,
58
+ ) );
59
+ }
60
+ }
61
+
62
+ public static function activate() {
63
+ check_ajax_referer( 'frm_ajax', 'nonce' );
64
+
65
+ if ( ! isset( $_POST['license'] ) || empty( $_POST['license'] ) ) {
66
+ wp_die( __( 'Oops! You forgot to enter your license number.', 'formidable' ) );
67
+ }
68
+
69
+ $license = stripslashes( sanitize_text_field( $_POST['license'] ) );
70
+ $plugin_slug = sanitize_text_field( $_POST['plugin'] );
71
+ $this_plugin = self::get_addon( $plugin_slug );
72
+ update_option( $this_plugin->option_name . 'key', $license );
73
+
74
+ $response = array( 'success' => false, 'message' => '' );
75
+ try{
76
+ $license_data = $this_plugin->send_mothership_request( 'activate_license', $license );
77
+
78
+ // $license_data->license will be either "valid" or "invalid"
79
+ $is_valid = 'invalid';
80
+ if ( is_array( $license_data ) && $license_data['license'] == 'valid' ) {
81
+ $is_valid = $license_data['license'];
82
+ $response['success'] = __( 'Enjoy!', 'formidable' );
83
+ } else {
84
+ $response['message'] = __( 'That license is invalid', 'formidable' );
85
+ }
86
+
87
+ update_option( $this_plugin->option_name . 'active', $is_valid );
88
+ }
89
+ catch(Exception $e) {
90
+ $response['message'] = $e->getMessage();
91
+ }
92
+
93
+ echo json_encode( $response );
94
+ wp_die();
95
+ }
96
+
97
+ public static function deactivate() {
98
+ check_ajax_referer( 'frm_ajax', 'nonce' );
99
+
100
+ $license = stripslashes( sanitize_text_field( $_POST['license'] ) );
101
+ $plugin_slug = sanitize_text_field( $_POST['plugin'] );
102
+ $this_plugin = self::get_addon( $plugin_slug );
103
+
104
+ $response = array( 'success' => false, 'message' => '' );
105
+ try{
106
+ // $license_data->license will be either "deactivated" or "failed"
107
+ $license_data = $this_plugin->send_mothership_request( 'deactivate_license', $license );
108
+ if ( is_array( $license_data ) && $license_data['license'] == 'deactivated' ) {
109
+ $response['success'] = true;
110
+ $response['message'] = __( 'That license was removed successfully', 'helpdesk' );
111
+ } else {
112
+ $response['message'] = __( 'There was an error deactivating your license.', 'formidable' );
113
+ }
114
+ }
115
+ catch ( Exception $e ) {
116
+ $response['message'] = $e->getMessage();
117
+ }
118
+
119
+ delete_option( $this_plugin->option_name . 'active' );
120
+ delete_option( $this_plugin->option_name . 'key' );
121
+
122
+ echo json_encode( $response );
123
+ wp_die();
124
+ }
125
+
126
+ public function send_mothership_request( $action, $license ) {
127
+ $api_params = array(
128
+ 'edd_action' => $action,
129
+ 'license' => $license,
130
+ 'item_name' => urlencode( $this->plugin_name ),
131
+ 'url' => home_url(),
132
+ );
133
+
134
+ $arg_array = array(
135
+ 'body' => $api_params,
136
+ 'timeout' => 15,
137
+ 'sslverify' => false,
138
+ 'user-agent' => $this->plugin_slug . '/' . $this->version . '; ' . get_bloginfo( 'url' ),
139
+ );
140
+
141
+ $resp = wp_remote_post( $this->store_url, $arg_array );
142
+ $body = wp_remote_retrieve_body( $resp );
143
+
144
+ if ( is_wp_error( $resp ) ) {
145
+ $message = sprintf( __( 'You had an error communicating with Formidable Pro\'s API. %1$sClick here%2$s for more information.', 'formidable' ), '<a href="http://formidablepro.com/knowledgebase/why-cant-i-activate-formidable-pro/" target="_blank">', '</a>');
146
+ if ( is_wp_error( $resp ) ) {
147
+ $message .= ' '. $resp->get_error_message();
148
+ }
149
+ return $message;
150
+ } else if ( $body == 'error' || is_wp_error( $body ) ) {
151
+ return __( 'You had an HTTP error connecting to Formidable Pro\'s API', 'formidable' );
152
+ } else {
153
+ $json_res = json_decode( $body, true );
154
+ if ( null !== $json_res ) {
155
+ if ( is_array( $json_res ) && isset( $json_res['error'] ) ) {
156
+ return $json_res['error'];
157
+ } else {
158
+ return $json_res;
159
+ }
160
+ } else if ( isset( $resp['response'] ) && isset( $resp['response']['code'] ) ) {
161
+ return sprintf( __( 'There was a %1$s error: %2$s', 'formidable' ), $resp['response']['code'], $resp['response']['message'] .' '. $resp['body'] );
162
+ }
163
+ }
164
+
165
+ return __( 'Your License Key was invalid', 'formidable' );
166
+ }
167
+
168
+ }
classes/models/FrmEntry.php CHANGED
@@ -525,6 +525,15 @@ class FrmEntry {
525
  FrmAppHelper::sanitize_request( $sanitize_method, $values );
526
  }
527
 
 
 
 
 
 
 
 
 
 
528
  public static function validate( $values, $exclude = false ) {
529
  _deprecated_function( __FUNCTION__, '2.0.9', 'FrmEntryValidate::validate' );
530
  return FrmEntryValidate::validate( $values, $exclude );
525
  FrmAppHelper::sanitize_request( $sanitize_method, $values );
526
  }
527
 
528
+ /**
529
+ * @param string $key
530
+ * @return int entry_id
531
+ */
532
+ public static function get_id_by_key( $key ) {
533
+ $entry_id = FrmDb::get_var( 'frm_items', array( 'item_key' => sanitize_title( $key ) ) );
534
+ return $entry_id;
535
+ }
536
+
537
  public static function validate( $values, $exclude = false ) {
538
  _deprecated_function( __FUNCTION__, '2.0.9', 'FrmEntryValidate::validate' );
539
  return FrmEntryValidate::validate( $values, $exclude );
classes/models/FrmEntryFormat.php CHANGED
@@ -64,7 +64,7 @@ class FrmEntryFormat {
64
 
65
  if ( $atts['clickable'] ) {
66
  $content = make_clickable( $content );
67
- }
68
 
69
  return $content;
70
  }
@@ -182,7 +182,7 @@ class FrmEntryFormat {
182
  $data = $default_data;
183
 
184
  if ( isset( $atts['entry']->description ) ) {
185
- $data = maybe_unserialize( $atts['entry']->description );
186
  } else if ( $atts['default_email'] ) {
187
  $data = array(
188
  'browser' => '[browser]',
64
 
65
  if ( $atts['clickable'] ) {
66
  $content = make_clickable( $content );
67
+ }
68
 
69
  return $content;
70
  }
182
  $data = $default_data;
183
 
184
  if ( isset( $atts['entry']->description ) ) {
185
+ $data = (array) maybe_unserialize( $atts['entry']->description );
186
  } else if ( $atts['default_email'] ) {
187
  $data = array(
188
  'browser' => '[browser]',
classes/models/FrmEntryMeta.php CHANGED
@@ -273,7 +273,7 @@ class FrmEntryMeta {
273
  $args = wp_parse_args($args, $defaults);
274
 
275
  $query = array();
276
- self::get_ids_query($where, $order_by, $limit, $unique, $args, $query);
277
  $query = implode(' ', $query);
278
 
279
  $cache_key = 'ids_'. maybe_serialize($where) . $order_by . 'l'. $limit . 'u'. $unique . maybe_serialize($args);
@@ -287,10 +287,19 @@ class FrmEntryMeta {
287
  * @param string $order_by
288
  * @param string $limit
289
  */
290
- private static function get_ids_query($where, $order_by, $limit, $unique, $args, array &$query) {
291
  global $wpdb;
292
  $query[] = 'SELECT';
293
- $query[] = $unique ? 'DISTINCT(it.item_id)' : 'it.item_id';
 
 
 
 
 
 
 
 
 
294
  $query[] = 'FROM '. $wpdb->prefix .'frm_item_metas it LEFT OUTER JOIN '. $wpdb->prefix .'frm_fields fi ON it.field_id=fi.id';
295
 
296
  $query[] = 'INNER JOIN '. $wpdb->prefix .'frm_items e ON (e.id=it.item_id)';
273
  $args = wp_parse_args($args, $defaults);
274
 
275
  $query = array();
276
+ self::get_ids_query($where, $order_by, $limit, $unique, $args, $query );
277
  $query = implode(' ', $query);
278
 
279
  $cache_key = 'ids_'. maybe_serialize($where) . $order_by . 'l'. $limit . 'u'. $unique . maybe_serialize($args);
287
  * @param string $order_by
288
  * @param string $limit
289
  */
290
+ private static function get_ids_query($where, $order_by, $limit, $unique, $args, array &$query ) {
291
  global $wpdb;
292
  $query[] = 'SELECT';
293
+
294
+ $defaults = array( 'return_parent_id' => false );
295
+ $args = array_merge( $defaults, $args );
296
+
297
+ if ( $args['return_parent_id'] ) {
298
+ $query[] = $unique ? 'DISTINCT(e.parent_item_id)' : 'e.parent_item_id';
299
+ } else {
300
+ $query[] = $unique ? 'DISTINCT(it.item_id)' : 'it.item_id';
301
+ }
302
+
303
  $query[] = 'FROM '. $wpdb->prefix .'frm_item_metas it LEFT OUTER JOIN '. $wpdb->prefix .'frm_fields fi ON it.field_id=fi.id';
304
 
305
  $query[] = 'INNER JOIN '. $wpdb->prefix .'frm_items e ON (e.id=it.item_id)';
classes/models/FrmField.php CHANGED
@@ -122,8 +122,7 @@ class FrmField {
122
  // If this is a repeating section, create new form
123
  if ( $field->type == 'divider' && self::is_option_true( $field, 'repeat' ) ) {
124
  // create the repeatable form
125
- $repeat_form_values = FrmFormsHelper::setup_new_vars( array( 'parent_form_id' => $form_id ) );
126
- $new_repeat_form_id = FrmForm::create( $repeat_form_values );
127
 
128
  // Save old form_select
129
  $old_repeat_form_id = $field->field_options['form_select'];
@@ -675,4 +674,13 @@ class FrmField {
675
  }
676
  return ( $is_repeating_field && self::is_option_true( $field, 'repeat' ) );
677
  }
 
 
 
 
 
 
 
 
 
678
  }
122
  // If this is a repeating section, create new form
123
  if ( $field->type == 'divider' && self::is_option_true( $field, 'repeat' ) ) {
124
  // create the repeatable form
125
+ $new_repeat_form_id = apply_filters( 'frm_create_repeat_form', 0, array( 'parent_form_id' => $form_id, 'field_name' => $field->name ) );
 
126
 
127
  // Save old form_select
128
  $old_repeat_form_id = $field->field_options['form_select'];
674
  }
675
  return ( $is_repeating_field && self::is_option_true( $field, 'repeat' ) );
676
  }
677
+
678
+ /**
679
+ * @param string $key
680
+ * @return int field id
681
+ */
682
+ public static function get_id_by_key( $key ) {
683
+ $id = FrmDb::get_var( 'frm_fields', array( 'field_key' => sanitize_title( $key ) ) );
684
+ return $id;
685
+ }
686
  }
classes/models/FrmForm.php CHANGED
@@ -527,6 +527,7 @@ class FrmForm {
527
  /**
528
  * Get all published forms
529
  * @since 2.0
 
530
  */
531
  public static function get_published_forms( $query = array(), $limit = 999, $inc_children = 'exclude' ) {
532
  $query['is_template'] = 0;
527
  /**
528
  * Get all published forms
529
  * @since 2.0
530
+ * @return array of forms
531
  */
532
  public static function get_published_forms( $query = array(), $limit = 999, $inc_children = 'exclude' ) {
533
  $query['is_template'] = 0;
classes/models/FrmFormAction.php CHANGED
@@ -626,4 +626,13 @@ class FrmFormAction {
626
  'limit' => 0,
627
  );
628
  }
 
 
 
 
 
 
 
 
 
629
  }
626
  'limit' => 0,
627
  );
628
  }
629
+
630
+ public static function trigger_labels() {
631
+ return apply_filters( 'frm_action_triggers', array(
632
+ 'create' => __( 'Create', 'formidable' ),
633
+ 'update' => __( 'Update', 'formidable' ),
634
+ 'delete' => __( 'Delete', 'formidable' ),
635
+ 'import' => __( 'Import', 'formidable' ),
636
+ ) );
637
+ }
638
  }
classes/models/FrmSettings.php CHANGED
@@ -5,7 +5,6 @@ class FrmSettings{
5
  public $menu;
6
  public $mu_menu;
7
  public $preview_page_id;
8
- public $lock_keys;
9
  public $use_html;
10
  public $jquery_css;
11
  public $accordion_js;
@@ -79,7 +78,6 @@ class FrmSettings{
79
  'menu' => 'Formidable',
80
  'mu_menu' => 0,
81
  'preview_page_id' => 0,
82
- 'lock_keys' => false,
83
  'use_html' => true,
84
  'jquery_css' => false,
85
  'accordion_js' => false,
@@ -193,7 +191,6 @@ class FrmSettings{
193
 
194
  $this->load_style = $params['frm_load_style'];
195
  $this->preview_page_id = (int) $params['frm-preview-page-id'];
196
- $this->lock_keys = isset($params['frm_lock_keys']) ? $params['frm_lock_keys'] : 0;
197
 
198
  $this->use_html = isset($params['frm_use_html']) ? $params['frm_use_html'] : 0;
199
  //$this->custom_style = isset($params['frm_custom_style']) ? $params['frm_custom_style'] : 0;
5
  public $menu;
6
  public $mu_menu;
7
  public $preview_page_id;
 
8
  public $use_html;
9
  public $jquery_css;
10
  public $accordion_js;
78
  'menu' => 'Formidable',
79
  'mu_menu' => 0,
80
  'preview_page_id' => 0,
 
81
  'use_html' => true,
82
  'jquery_css' => false,
83
  'accordion_js' => false,
191
 
192
  $this->load_style = $params['frm_load_style'];
193
  $this->preview_page_id = (int) $params['frm-preview-page-id'];
 
194
 
195
  $this->use_html = isset($params['frm_use_html']) ? $params['frm_use_html'] : 0;
196
  //$this->custom_style = isset($params['frm_custom_style']) ? $params['frm_custom_style'] : 0;
classes/models/FrmStyle.php CHANGED
@@ -306,6 +306,7 @@ class FrmStyle {
306
  'theme_css' => 'ui-lightness',
307
  'theme_name' => 'UI Lightness',
308
 
 
309
  'form_width' => '100%',
310
  'form_align' => 'left',
311
  'direction' => is_rtl() ? 'rtl' : 'ltr',
306
  'theme_css' => 'ui-lightness',
307
  'theme_name' => 'UI Lightness',
308
 
309
+ 'center_form' => '',
310
  'form_width' => '100%',
311
  'form_align' => 'left',
312
  'direction' => is_rtl() ? 'rtl' : 'ltr',
classes/views/addons/settings.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <h2><?php _e( 'Plugin Licenses', 'formidable' ); ?></h2>
3
+
4
+ <?php
5
+
6
+ foreach ( $plugins as $slug => $plugin ) {
7
+ $license = get_option( 'edd_'. $slug .'_license_key' );
8
+ $status = get_option( 'edd_'. $slug .'_license_active' );
9
+ $activate = ( false !== $license && $status == 'valid' ) ? 'deactivate' : 'activate';
10
+ $icon_class = ( empty( $license ) ) ? 'frm_hidden' : '';
11
+ ?>
12
+
13
+ <div class="edd_frm_license_row">
14
+ <label class="frm_left_label" for="edd_<?php echo esc_attr( $slug ) ?>_license_key"><?php echo FrmAppHelper::kses( $plugin->plugin_name ) ?></label>
15
+ <div class="edd_frm_authorized alignleft <?php echo esc_attr( $activate == 'activate' ) ? 'frm_hidden' : '' ?>">
16
+ <span class="edd_frm_license"><?php echo esc_html( $license ); ?></span>
17
+ <span class="frm_icon_font frm_action_icon frm_error_icon edd_frm_status_icon frm_inactive_icon"></span>
18
+ <input type="button" class="button-secondary edd_frm_save_license" data-plugin="<?php echo esc_attr( $slug ) ?>" name="edd_<?php echo esc_attr( $slug ) ?>_license_deactivate" value="<?php esc_attr_e( 'Deactivate', 'formidable' ) ?>"/>
19
+ <p class="frm_license_msg"></p>
20
+ </div>
21
+ <div class="edd_frm_unauthorized alignleft <?php echo esc_attr( $activate == 'deactivate' ) ? 'frm_hidden' : '' ?>">
22
+ <input id="edd_<?php echo esc_attr( $slug ) ?>_license_key" name="edd_<?php echo esc_attr( $slug ) ?>_license_key" type="text" class="regular-text" value="<?php echo esc_attr( $license ); ?>" />
23
+ <span class="frm_icon_font frm_action_icon frm_error_icon edd_frm_status_icon <?php echo esc_attr( $icon_class ); ?>"></span>
24
+ <input type="button" class="button-secondary edd_frm_save_license" data-plugin="<?php echo esc_attr( $slug ) ?>" name="edd_<?php echo esc_attr( $slug ) ?>_license_activate" value="<?php esc_attr_e( 'Activate', 'formidable' ) ?>"/>
25
+ <p class="frm_license_msg"></p>
26
+ </div>
27
+
28
+ </div>
29
+ <?php } ?>
30
+
31
+ </div>
classes/views/frm-entries/form.php CHANGED
@@ -34,7 +34,7 @@ if ( $values['fields'] ) {
34
  }
35
 
36
  $frm_settings = FrmAppHelper::get_settings();
37
- if ( FrmAppHelper::is_admin() && ! $frm_settings->lock_keys ) { ?>
38
  <div class="frm_form_field form-field">
39
  <label class="frm_primary_label"><?php _e( 'Entry Key', 'formidable' ) ?></label>
40
  <input type="text" name="item_key" value="<?php echo esc_attr($values['item_key']) ?>" />
34
  }
35
 
36
  $frm_settings = FrmAppHelper::get_settings();
37
+ if ( FrmAppHelper::is_admin() ) { ?>
38
  <div class="frm_form_field form-field">
39
  <label class="frm_primary_label"><?php _e( 'Entry Key', 'formidable' ) ?></label>
40
  <input type="text" name="item_key" value="<?php echo esc_attr($values['item_key']) ?>" />
classes/views/frm-form-actions/_action_inside.php CHANGED
@@ -33,12 +33,8 @@ if ( count( $action_control->action_options['event'] ) == 1 || $action_control->
33
  <p><label class="frm_left_label"><?php _e( 'Trigger this action after', 'formidable' ) ?></label>
34
  <select name="<?php echo esc_attr( $action_control->get_field_name('event') ) ?>[]" multiple="multiple" class="frm_multiselect" id="<?php echo esc_attr( $action_control->get_field_id('event') ) ?>">
35
  <?php
36
- $event_labels = apply_filters( 'frm_action_triggers', array(
37
- 'create' => __( 'Create', 'formidable' ),
38
- 'update' => __( 'Update', 'formidable' ),
39
- 'delete' => __( 'Delete', 'formidable' ),
40
- ) );
41
 
 
42
  foreach ( $action_control->action_options['event'] as $event ) { ?>
43
  <option value="<?php echo esc_attr( $event ) ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo isset( $event_labels[ $event ] ) ? $event_labels[ $event ] : $event; ?></option>
44
  <?php
33
  <p><label class="frm_left_label"><?php _e( 'Trigger this action after', 'formidable' ) ?></label>
34
  <select name="<?php echo esc_attr( $action_control->get_field_name('event') ) ?>[]" multiple="multiple" class="frm_multiselect" id="<?php echo esc_attr( $action_control->get_field_id('event') ) ?>">
35
  <?php
 
 
 
 
 
36
 
37
+ $event_labels = FrmFormAction::trigger_labels();
38
  foreach ( $action_control->action_options['event'] as $event ) { ?>
39
  <option value="<?php echo esc_attr( $event ) ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo isset( $event_labels[ $event ] ) ? $event_labels[ $event ] : $event; ?></option>
40
  <?php
classes/views/frm-forms/add_field.php CHANGED
@@ -210,11 +210,7 @@ if ( $display['options'] ) { ?>
210
  <?php _e( 'Field Key', 'formidable' ) ?>
211
  </td>
212
  <td>
213
- <div class="<?php echo $frm_settings->lock_keys ? 'frm_field_key' : 'frm_ipe_field_key" title="'. esc_attr( __( 'Click to edit.', 'formidable' ) ); ?>" ><?php echo esc_html( $field['field_key'] ); ?></div>
214
- <?php if ( ! $frm_settings->lock_keys ) { ?>
215
- <input type="hidden" name="field_options[field_key_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['field_key'] ); ?>" />
216
- <?php } ?>
217
- </div>
218
  </td>
219
  </tr>
220
 
210
  <?php _e( 'Field Key', 'formidable' ) ?>
211
  </td>
212
  <td>
213
+ <input type="text" name="field_options[field_key_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['field_key'] ); ?>" />
 
 
 
 
214
  </td>
215
  </tr>
216
 
classes/views/frm-forms/settings.php CHANGED
@@ -32,8 +32,14 @@
32
  <li <?php echo ($a == 'advanced_settings') ? 'class="tabs active"' : '' ?>><a href="#advanced_settings"><?php _e( 'General', 'formidable' ) ?></a></li>
33
  <li <?php echo ($a == 'email_settings') ? 'class="tabs active"' : '' ?>><a href="#email_settings"><?php _e( 'Form Actions', 'formidable' ); ?></a></li>
34
  <li <?php echo ($a == 'html_settings') ? 'class="tabs active"' : '' ?>><a href="#html_settings"><?php _e( 'Customize HTML', 'formidable' ) ?></a></li>
35
- <?php foreach ( $sections as $sec_name => $section ) { ?>
36
- <li <?php echo ($a == $sec_name .'_settings') ? 'class="tabs active"' : '' ?>><a href="#<?php echo esc_attr( $sec_name ) ?>_settings"><?php echo ucfirst($sec_name) ?></a></li>
 
 
 
 
 
 
37
  <?php } ?>
38
  </ul>
39
  </div>
@@ -100,7 +106,6 @@
100
  </td>
101
  </tr>
102
  <?php } ?>
103
- <?php do_action('frm_additional_form_options', $values); ?>
104
  </table>
105
 
106
  <!--AJAX Section-->
@@ -159,7 +164,16 @@
159
  </tr>
160
  <?php do_action('frm_add_form_msg_options', $values); ?>
161
  </table>
162
- </div>
 
 
 
 
 
 
 
 
 
163
 
164
 
165
  <div id="frm_notification_settings" class="frm_email_settings email_settings tabs-panel widgets-holder-wrap <?php echo ($a == 'email_settings') ? ' frm_block' : ' frm_hidden'; ?>">
@@ -223,8 +237,13 @@
223
  </div>
224
  </div>
225
 
226
- <?php foreach ( $sections as $sec_name => $section ) { ?>
227
- <div id="<?php echo esc_attr( $sec_name ) ?>_settings" class="tabs-panel <?php echo ($a == $sec_name .'_settings') ? ' frm_block' : ' frm_hidden'; ?>"><?php
 
 
 
 
 
228
  if ( isset( $section['class'] ) ) {
229
  call_user_func( array( $section['class'], $section['function'] ), $values );
230
  } else {
32
  <li <?php echo ($a == 'advanced_settings') ? 'class="tabs active"' : '' ?>><a href="#advanced_settings"><?php _e( 'General', 'formidable' ) ?></a></li>
33
  <li <?php echo ($a == 'email_settings') ? 'class="tabs active"' : '' ?>><a href="#email_settings"><?php _e( 'Form Actions', 'formidable' ); ?></a></li>
34
  <li <?php echo ($a == 'html_settings') ? 'class="tabs active"' : '' ?>><a href="#html_settings"><?php _e( 'Customize HTML', 'formidable' ) ?></a></li>
35
+ <?php foreach ( $sections as $key => $section ) {
36
+ if ( isset( $section['name'] ) ) {
37
+ $sec_name = $section['name'];
38
+ $sec_anchor = $section['anchor'];
39
+ } else {
40
+ $sec_anchor = $sec_name = $key;
41
+ } ?>
42
+ <li <?php echo ($a == $sec_anchor .'_settings') ? 'class="tabs active"' : '' ?>><a href="#<?php echo esc_attr( $sec_anchor ) ?>_settings"><?php echo ucfirst($sec_name) ?></a></li>
43
  <?php } ?>
44
  </ul>
45
  </div>
106
  </td>
107
  </tr>
108
  <?php } ?>
 
109
  </table>
110
 
111
  <!--AJAX Section-->
164
  </tr>
165
  <?php do_action('frm_add_form_msg_options', $values); ?>
166
  </table>
167
+
168
+ <!--Misc Section-->
169
+ <?php if ( has_action( 'frm_additional_form_options' ) ) { ?>
170
+ <h3><?php _e( 'Miscellaneous', 'formidable' ); ?></h3>
171
+ <table class="form-table">
172
+ <?php do_action('frm_additional_form_options', $values); ?>
173
+ </table>
174
+ <?php } ?>
175
+
176
+ </div>
177
 
178
 
179
  <div id="frm_notification_settings" class="frm_email_settings email_settings tabs-panel widgets-holder-wrap <?php echo ($a == 'email_settings') ? ' frm_block' : ' frm_hidden'; ?>">
237
  </div>
238
  </div>
239
 
240
+ <?php foreach ( $sections as $key => $section ) {
241
+ if ( isset( $section['anchor'] ) ) {
242
+ $sec_anchor = $section['anchor'];
243
+ } else {
244
+ $sec_anchor = $key;
245
+ } ?>
246
+ <div id="<?php echo esc_attr( $sec_anchor ) ?>_settings" class="tabs-panel <?php echo ($a == $sec_anchor .'_settings') ? ' frm_block' : ' frm_hidden'; ?>"><?php
247
  if ( isset( $section['class'] ) ) {
248
  call_user_func( array( $section['class'], $section['function'] ), $values );
249
  } else {
classes/views/frm-statistics/list.php CHANGED
@@ -6,12 +6,12 @@
6
  </h2>
7
 
8
  <?php
9
- if ( $form ) {
10
- FrmAppController::get_form_nav( $form, true );
11
- }
12
- require( FrmAppHelper::plugin_path() . '/classes/views/shared/errors.php' );
13
 
14
- FrmAppHelper::update_message( __( 'view reports and statistics on your saved entries', 'formidable' ) );
15
  ?>
16
 
17
  <img class="frm_no_reports" src="http://fp.strategy11.com/wp-content/themes/formidablepro/images/reports1.png" alt="Reports"/>
6
  </h2>
7
 
8
  <?php
9
+ if ( $form ) {
10
+ FrmAppController::get_form_nav( $form, true );
11
+ }
12
+ require( FrmAppHelper::plugin_path() . '/classes/views/shared/errors.php' );
13
 
14
+ FrmAppHelper::update_message( __( 'view reports and statistics on your saved entries', 'formidable' ) );
15
  ?>
16
 
17
  <img class="frm_no_reports" src="http://fp.strategy11.com/wp-content/themes/formidablepro/images/reports1.png" alt="Reports"/>
classes/views/styles/_general.php CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  <div class="field-group clearfix frm-first-row">
2
  <label><?php _e( 'Alignment', 'formidable' ) ?></label>
3
  <select name="<?php echo esc_attr( $frm_style->get_field_name('form_align') ) ?>" id="frm_form_align">
1
+ <p>
2
+ <label><input type="checkbox" name="<?php echo esc_attr( $frm_style->get_field_name('center_form') ) ?>" id="frm_center_form" value="1" <?php checked($style->post_content['center_form'], 1) ?> />
3
+ <?php _e( 'Center form on page', 'formidable' ) ?> <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'This will center your form on the page where it is published if the form width is less than the available width on the page.', 'formidable' ) ?>" ></span>
4
+ </label>
5
+ </p>
6
+
7
  <div class="field-group clearfix frm-first-row">
8
  <label><?php _e( 'Alignment', 'formidable' ) ?></label>
9
  <select name="<?php echo esc_attr( $frm_style->get_field_name('form_align') ) ?>" id="frm_form_align">
css/_single_theme.css.php CHANGED
@@ -51,6 +51,9 @@ if ( ! isset($collapse_icon) ) {
51
  <?php if ( 'rtl' == $direction ) { ?>
52
  unicode-bidi:embed;
53
  <?php } ?>
 
 
 
54
  }
55
 
56
  .<?php echo $style_class ?>,
@@ -58,6 +61,12 @@ if ( ! isset($collapse_icon) ) {
58
  text-align:<?php echo $form_align . $important ?>;
59
  }
60
 
 
 
 
 
 
 
61
  .<?php echo $style_class ?> fieldset{
62
  border:<?php echo $fieldset ?> solid #<?php echo $fieldset_color . $important ?>;
63
  margin:0;
@@ -173,7 +182,7 @@ if ( ! isset($collapse_icon) ) {
173
  }
174
 
175
  /* Form description */
176
- .<?php echo $style_class ?> .frm-show-form > div.frm_description p{
177
  font-size:<?php echo $form_desc_size . $important ?>;
178
  color:#<?php echo $form_desc_color . $important ?>;
179
  }
@@ -331,6 +340,16 @@ if ( ! isset($collapse_icon) ) {
331
  box-shadow:0 1px 1px rgba(0, 0, 0, 0.075) inset;
332
  }
333
 
 
 
 
 
 
 
 
 
 
 
334
  .<?php echo $style_class ?> input[type=text],
335
  .<?php echo $style_class ?> input[type=password],
336
  .<?php echo $style_class ?> input[type=email],
@@ -448,14 +467,15 @@ if ( ! $submit_style ) { ?>
448
  .<?php echo $style_class ?>.frm_login_form input[type=submit]{
449
  width:<?php echo ($submit_width == '' ? 'auto' : $submit_width) . $important ?>;
450
  font-family:<?php echo stripslashes($font) ?>;
451
- font-size:<?php echo $submit_font_size; ?>;
452
  height:<?php echo $submit_height . $important ?>;
453
  line-height:normal<?php echo $important ?>;
454
  text-align:center;
455
  background:#<?php echo $submit_bg_color;
456
  if ( ! empty($submit_bg_img) ) {
457
  echo ' url('. $submit_bg_img .')';
458
- } ?>;
 
459
  border-width:<?php echo $submit_border_width ?>;
460
  border-color:#<?php echo $submit_border_color . $important ?>;
461
  border-style:solid;
@@ -496,7 +516,7 @@ if ( ! $submit_style ) { ?>
496
 
497
  .<?php echo $style_class ?> input[type=submit]:focus,
498
  .<?php echo $style_class ?> .frm_submit input[type=button]:focus,
499
- .<?php echo $style_class ?>.frm_login_form input[type=submit]:focus.
500
  .<?php echo $style_class ?> input[type=submit]:active,
501
  .<?php echo $style_class ?> .frm_submit input[type=button]:active,
502
  .<?php echo $style_class ?>.frm_login_form input[type=submit]:active{
@@ -690,7 +710,7 @@ if ( ! $submit_style ) { ?>
690
  font-family:<?php echo stripslashes($font) . $important ?>;
691
  font-weight:<?php echo $submit_weight . $important ?>;
692
  color:#<?php echo $submit_text_color . $important ?>;
693
- background:#<?php echo $submit_bg_color ?>;
694
  border-width:<?php echo $submit_border_width ?>;
695
  border-color:#<?php echo $submit_border_color . $important ?>;
696
  }
@@ -707,8 +727,12 @@ if ( ! $submit_style ) { ?>
707
 
708
  .<?php echo $style_class ?> .frm_form_field.frm_half,
709
  .<?php echo $style_class ?> .frm_form_field.frm_third,
 
710
  .<?php echo $style_class ?> .frm_form_field.frm_fourth,
711
  .<?php echo $style_class ?> .frm_form_field.frm_fifth,
 
 
 
712
  .<?php echo $style_class ?> .frm_form_field.frm_inline,
713
  .<?php echo $style_class ?> .frm_form_field.frm_left_half,
714
  .<?php echo $style_class ?> .frm_form_field.frm_left_third,
@@ -719,13 +743,9 @@ if ( ! $submit_style ) { ?>
719
  .<?php echo $style_class ?> .frm_form_field.frm_first_half,
720
  .<?php echo $style_class ?> .frm_form_field.frm_first_third,
721
  .<?php echo $style_class ?> .frm_form_field.frm_first_two_thirds,
722
- .<?php echo $style_class ?> .frm_form_field.frm_two_thirds.frm_first,
723
  .<?php echo $style_class ?> .frm_form_field.frm_first_fourth,
724
  .<?php echo $style_class ?> .frm_form_field.frm_first_fifth,
725
- .<?php echo $style_class ?> .frm_form_field.frm_first_inline{
726
- float:right;
727
- }
728
-
729
  .<?php echo $style_class ?> .frm_form_field.frm_right_half,
730
  .<?php echo $style_class ?> .frm_form_field.frm_right_third,
731
  .<?php echo $style_class ?> .frm_form_field.frm_right_two_thirds,
@@ -737,51 +757,28 @@ if ( ! $submit_style ) { ?>
737
  .<?php echo $style_class ?> .frm_form_field.frm_last_two_thirds,
738
  .<?php echo $style_class ?> .frm_form_field.frm_last_fourth,
739
  .<?php echo $style_class ?> .frm_form_field.frm_last_fifth,
740
- .<?php echo $style_class ?> .frm_form_field.frm_last_inline,
741
- .<?php echo $style_class ?> .frm_form_field.frm_last{
742
- float:left;
 
 
743
  }
744
 
745
  .<?php echo $style_class ?> .frm_form_field.frm_left_half,
746
  .<?php echo $style_class ?> .frm_form_field.frm_first_half,
747
- .<?php echo $style_class ?> .frm_form_field.frm_half.frm_first{
748
- margin-left:4%;
749
- margin-right:0
750
- }
751
-
752
  .<?php echo $style_class ?> .frm_form_field.frm_left_third,
753
  .<?php echo $style_class ?> .frm_form_field.frm_first_third,
754
- .<?php echo $style_class ?> .frm_form_field.frm_third,
755
- .<?php echo $style_class ?> .frm_form_field.frm_left_two_thirds,
756
  .<?php echo $style_class ?> .frm_form_field.frm_first_two_thirds,
757
- .<?php echo $style_class ?> .frm_form_field.frm_two_thirds{
758
- margin-right:0;
759
- margin-left:5%;
760
- }
761
-
762
  .<?php echo $style_class ?> .frm_form_field.frm_left_fourth,
763
- .<?php echo $style_class ?> .frm_form_field.frm_fourth,
764
- .<?php echo $style_class ?> .frm_form_field.frm_first_fourth{
765
- margin-right:0;
766
- margin-left:4%;
767
- }
768
-
769
  .<?php echo $style_class ?> .frm_form_field.frm_left_fifth,
770
- .<?php echo $style_class ?> .frm_form_field.frm_fifth,
771
- .<?php echo $style_class ?> .frm_form_field.frm_first_fifth{
772
- margin-right:0;
773
- margin-left:5%;
774
- }
775
-
776
  .<?php echo $style_class ?> .frm_form_field.frm_left_inline,
777
- .<?php echo $style_class ?> .frm_form_field.frm_first_inline,
778
- .<?php echo $style_class ?> .frm_form_field.frm_inline{
779
  margin-right:0;
780
- margin-left:4%;
781
- }
782
-
783
- .frm_form_field.frm_last{
784
- margin-left:0;
785
  }
786
 
787
  .<?php echo $style_class ?> .frm_grid .frm_primary_label,
51
  <?php if ( 'rtl' == $direction ) { ?>
52
  unicode-bidi:embed;
53
  <?php } ?>
54
+ <?php if ( $center_form ) { ?>
55
+ margin:0 auto;
56
+ <?php } ?>
57
  }
58
 
59
  .<?php echo $style_class ?>,
61
  text-align:<?php echo $form_align . $important ?>;
62
  }
63
 
64
+ <?php if ( $center_form ) {?>
65
+ .frm_inline_form.<?php echo $style_class ?> form{
66
+ text-align:center;
67
+ }
68
+ <?php } ?>
69
+
70
  .<?php echo $style_class ?> fieldset{
71
  border:<?php echo $fieldset ?> solid #<?php echo $fieldset_color . $important ?>;
72
  margin:0;
182
  }
183
 
184
  /* Form description */
185
+ .<?php echo $style_class ?> .frm-show-form div.frm_description p{
186
  font-size:<?php echo $form_desc_size . $important ?>;
187
  color:#<?php echo $form_desc_color . $important ?>;
188
  }
340
  box-shadow:0 1px 1px rgba(0, 0, 0, 0.075) inset;
341
  }
342
 
343
+ .<?php echo $style_class ?> input[type=file]::-webkit-file-upload-button{
344
+ color:#<?php echo $text_color . $important ?>;
345
+ background-color:#<?php echo $bg_color . $important; ?>;
346
+ padding:<?php echo $field_pad . $important ?>;
347
+ border-radius:<?php echo $border_radius . $important ?>;
348
+ border-color:#<?php echo $border_color . $important ?>;
349
+ border-width:<?php echo $field_border_width . $important ?>;
350
+ border-style:<?php echo $field_border_style . $important ?>;
351
+ }
352
+
353
  .<?php echo $style_class ?> input[type=text],
354
  .<?php echo $style_class ?> input[type=password],
355
  .<?php echo $style_class ?> input[type=email],
467
  .<?php echo $style_class ?>.frm_login_form input[type=submit]{
468
  width:<?php echo ($submit_width == '' ? 'auto' : $submit_width) . $important ?>;
469
  font-family:<?php echo stripslashes($font) ?>;
470
+ font-size:<?php echo $submit_font_size . $important; ?>;
471
  height:<?php echo $submit_height . $important ?>;
472
  line-height:normal<?php echo $important ?>;
473
  text-align:center;
474
  background:#<?php echo $submit_bg_color;
475
  if ( ! empty($submit_bg_img) ) {
476
  echo ' url('. $submit_bg_img .')';
477
+ }
478
+ echo $important; ?>;
479
  border-width:<?php echo $submit_border_width ?>;
480
  border-color:#<?php echo $submit_border_color . $important ?>;
481
  border-style:solid;
516
 
517
  .<?php echo $style_class ?> input[type=submit]:focus,
518
  .<?php echo $style_class ?> .frm_submit input[type=button]:focus,
519
+ .<?php echo $style_class ?>.frm_login_form input[type=submit]:focus,
520
  .<?php echo $style_class ?> input[type=submit]:active,
521
  .<?php echo $style_class ?> .frm_submit input[type=button]:active,
522
  .<?php echo $style_class ?>.frm_login_form input[type=submit]:active{
710
  font-family:<?php echo stripslashes($font) . $important ?>;
711
  font-weight:<?php echo $submit_weight . $important ?>;
712
  color:#<?php echo $submit_text_color . $important ?>;
713
+ background:#<?php echo $submit_bg_color . $important ?>;
714
  border-width:<?php echo $submit_border_width ?>;
715
  border-color:#<?php echo $submit_border_color . $important ?>;
716
  }
727
 
728
  .<?php echo $style_class ?> .frm_form_field.frm_half,
729
  .<?php echo $style_class ?> .frm_form_field.frm_third,
730
+ .<?php echo $style_class ?> .frm_form_field.frm_two_thirds,
731
  .<?php echo $style_class ?> .frm_form_field.frm_fourth,
732
  .<?php echo $style_class ?> .frm_form_field.frm_fifth,
733
+ .<?php echo $style_class ?> .frm_form_field.frm_sixth,
734
+ .<?php echo $style_class ?> .frm_form_field.frm_seventh,
735
+ .<?php echo $style_class ?> .frm_form_field.frm_eighth,
736
  .<?php echo $style_class ?> .frm_form_field.frm_inline,
737
  .<?php echo $style_class ?> .frm_form_field.frm_left_half,
738
  .<?php echo $style_class ?> .frm_form_field.frm_left_third,
743
  .<?php echo $style_class ?> .frm_form_field.frm_first_half,
744
  .<?php echo $style_class ?> .frm_form_field.frm_first_third,
745
  .<?php echo $style_class ?> .frm_form_field.frm_first_two_thirds,
 
746
  .<?php echo $style_class ?> .frm_form_field.frm_first_fourth,
747
  .<?php echo $style_class ?> .frm_form_field.frm_first_fifth,
748
+ .<?php echo $style_class ?> .frm_form_field.frm_first_inline,
 
 
 
749
  .<?php echo $style_class ?> .frm_form_field.frm_right_half,
750
  .<?php echo $style_class ?> .frm_form_field.frm_right_third,
751
  .<?php echo $style_class ?> .frm_form_field.frm_right_two_thirds,
757
  .<?php echo $style_class ?> .frm_form_field.frm_last_two_thirds,
758
  .<?php echo $style_class ?> .frm_form_field.frm_last_fourth,
759
  .<?php echo $style_class ?> .frm_form_field.frm_last_fifth,
760
+ .<?php echo $style_class ?> .frm_form_field.frm_last_inline{
761
+ float:right;
762
+ margin-right:2.5%;
763
+ margin-left:0;
764
+ clear:none;
765
  }
766
 
767
  .<?php echo $style_class ?> .frm_form_field.frm_left_half,
768
  .<?php echo $style_class ?> .frm_form_field.frm_first_half,
769
+ .<?php echo $style_class ?> .frm_form_field.frm_first,
 
 
 
 
770
  .<?php echo $style_class ?> .frm_form_field.frm_left_third,
771
  .<?php echo $style_class ?> .frm_form_field.frm_first_third,
 
 
772
  .<?php echo $style_class ?> .frm_form_field.frm_first_two_thirds,
773
+ .<?php echo $style_class ?> .frm_form_field.frm_left_two_thirds,
774
+ .<?php echo $style_class ?> .frm_form_field.frm_first_fourth,
 
 
 
775
  .<?php echo $style_class ?> .frm_form_field.frm_left_fourth,
 
 
 
 
 
 
776
  .<?php echo $style_class ?> .frm_form_field.frm_left_fifth,
777
+ .<?php echo $style_class ?> .frm_form_field.frm_first_fifth,
 
 
 
 
 
778
  .<?php echo $style_class ?> .frm_form_field.frm_left_inline,
779
+ .<?php echo $style_class ?> .frm_form_field.frm_first_inline{
780
+ clear:right;
781
  margin-right:0;
 
 
 
 
 
782
  }
783
 
784
  .<?php echo $style_class ?> .frm_grid .frm_primary_label,
css/custom_theme.css.php CHANGED
@@ -37,6 +37,10 @@ legend.frm_hidden{
37
  box-shadow:none;
38
  }
39
 
 
 
 
 
40
  .frm_preview_page:before{
41
  content:normal !important;
42
  }
@@ -152,50 +156,12 @@ legend.frm_hidden{
152
  }
153
 
154
  .frm_inline_form .frm_form_field.form-field{
155
- float:left;
156
- margin-right:4%;
157
- clear:none;
158
- }
159
-
160
- .frm_inline_form .frm_form_field.frm_left_half,
161
- .frm_inline_form .frm_form_field.frm_left_third,
162
- .frm_inline_form .frm_form_field.frm_left_two_thirds,
163
- .frm_inline_form .frm_form_field.frm_left_fourth,
164
- .frm_inline_form .frm_form_field.frm_left_fifth,
165
- .frm_inline_form .frm_form_field.frm_left_inline,
166
- .frm_inline_form .frm_form_field.frm_first_half,
167
- .frm_inline_form .frm_form_field.frm_first_third,
168
- .frm_inline_form .frm_form_field.frm_first_two_thirds,
169
- .frm_inline_form .frm_form_field.frm_first_fourth,
170
- .frm_inline_form .frm_form_field.frm_first_fifth,
171
- .frm_inline_form .frm_form_field.frm_first_sixth,
172
- .frm_inline_form .frm_form_field.frm_first_seventh,
173
- .frm_inline_form .frm_form_field.frm_first_eighth,
174
- .frm_inline_form .frm_form_field.frm_first_inline {
175
- clear:left;
176
- }
177
-
178
- .frm_inline_form .frm_form_field.frm_right_half,
179
- .frm_inline_form .frm_form_field.frm_right_third,
180
- .frm_inline_form .frm_form_field.frm_right_two_thirds,
181
- .frm_inline_form .frm_form_field.frm_right_fourth,
182
- .frm_inline_form .frm_form_field.frm_right_fifth,
183
- .frm_inline_form .frm_form_field.frm_right_inline,
184
- .frm_inline_form .frm_form_field.frm_last_half,
185
- .frm_inline_form .frm_form_field.frm_last_third,
186
- .frm_inline_form .frm_form_field.frm_last_two_thirds,
187
- .frm_inline_form .frm_form_field.frm_last_fourth,
188
- .frm_inline_form .frm_form_field.frm_last_fifth,
189
- .frm_inline_form .frm_form_field.frm_last_sixth,
190
- .frm_inline_form .frm_form_field.frm_last_seventh,
191
- .frm_inline_form .frm_form_field.frm_last_eighth,
192
- .frm_inline_form .frm_form_field.frm_last_inline{
193
- margin-right:0;
194
  }
195
 
196
  .frm_inline_form .frm_submit{
197
- clear:none;
198
- float:left;
199
  }
200
 
201
  .with_frm_style.frm_center_submit .frm_submit{
@@ -219,6 +185,7 @@ foreach ( $styles as $style ) {
219
 
220
  .frm_ajax_loading{
221
  visibility:hidden;
 
222
  }
223
 
224
  .frm_ajax_loading.frm_loading_now{
@@ -564,6 +531,10 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
564
  }
565
  /* End Calendar Styling */
566
 
 
 
 
 
567
  .frm-loading-img{
568
  background:url(<?php echo FrmAppHelper::relative_plugin_url() ?>/images/ajax_loader.gif) no-repeat center center;
569
  padding:6px 12px;
@@ -644,16 +615,38 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
644
  clear:both;
645
  }
646
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
647
  .frm_form_field.frm_half,
648
  .frm_form_field.frm_third,
 
649
  .frm_form_field.frm_fourth,
 
650
  .frm_form_field.frm_fifth,
 
 
 
651
  .frm_form_field.frm_sixth,
652
  .frm_form_field.frm_seventh,
653
  .frm_form_field.frm_eighth,
654
  .frm_form_field.frm_inline{
655
  clear:none;
656
  float:left;
 
657
  }
658
 
659
  .frm_form_field.frm_left_half,
@@ -674,26 +667,11 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
674
  .frm_form_field.frm_first{
675
  clear:left;
676
  float:left;
 
677
  }
678
 
679
- .frm_form_field.frm_right_half,
680
- .frm_form_field.frm_right_third,
681
- .frm_form_field.frm_right_two_thirds,
682
- .frm_form_field.frm_right_fourth,
683
- .frm_form_field.frm_right_fifth,
684
- .frm_form_field.frm_right_inline,
685
- .frm_form_field.frm_last_half,
686
- .frm_form_field.frm_last_third,
687
- .frm_form_field.frm_last_two_thirds,
688
- .frm_form_field.frm_last_fourth,
689
- .frm_form_field.frm_last_fifth,
690
- .frm_form_field.frm_last_sixth,
691
- .frm_form_field.frm_last_seventh,
692
- .frm_form_field.frm_last_eighth,
693
- .frm_form_field.frm_last_inline,
694
- .frm_form_field.frm_last{
695
- clear:none;
696
- float:right;
697
  }
698
 
699
  .frm_form_field.frm_left_half,
@@ -701,37 +679,7 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
701
  .frm_form_field.frm_first_half,
702
  .frm_form_field.frm_last_half,
703
  .frm_form_field.frm_half{
704
- width:48%;
705
- }
706
-
707
- .frm_form_field.frm_left_half,
708
- .frm_form_field.frm_first_half,
709
- .frm_form_field.frm_half.frm_first{
710
- margin-right:4%;
711
- }
712
-
713
- .with_frm_style .frm_form_field.frm_first_half.frm_right_container div.frm_description,
714
- .with_frm_style .frm_form_field.frm_first_half.frm_right_container .frm_error,
715
- .with_frm_style .frm_form_field.frm_first_half .frm_right_container div.frm_description,
716
- .with_frm_style .frm_form_field.frm_first_half .frm_right_container .frm_error,
717
- .with_frm_style .frm_form_field.frm_last_half.frm_right_container div.frm_description,
718
- .with_frm_style .frm_form_field.frm_last_half.frm_right_container .frm_error,
719
- .with_frm_style .frm_form_field.frm_half.frm_right_container div.frm_description,
720
- .with_frm_style .frm_form_field.frm_half.frm_right_container .frm_error{
721
- margin-right:33%;
722
- padding-right:12px;
723
- }
724
-
725
- .with_frm_style .frm_form_field.frm_first_half.frm_left_container div.frm_description,
726
- .with_frm_style .frm_form_field.frm_first_half.frm_left_container .frm_error,
727
- .with_frm_style .frm_form_field.frm_first_half .frm_left_container div.frm_description,
728
- .with_frm_style .frm_form_field.frm_first_half .frm_left_container .frm_error,
729
- .with_frm_style .frm_form_field.frm_last_half.frm_left_container div.frm_description,
730
- .with_frm_style .frm_form_field.frm_last_half.frm_left_container .frm_error,
731
- .with_frm_style .frm_form_field.frm_half.frm_left_container div.frm_description,
732
- .with_frm_style .frm_form_field.frm_half.frm_left_container .frm_error{
733
- margin-left:33%;
734
- padding-left:12px;
735
  }
736
 
737
  .frm_form_field.frm_left_third,
@@ -739,7 +687,7 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
739
  .frm_form_field.frm_right_third,
740
  .frm_form_field.frm_first_third,
741
  .frm_form_field.frm_last_third{
742
- width:30%;
743
  }
744
 
745
  .frm_form_field.frm_left_two_thirds,
@@ -747,16 +695,7 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
747
  .frm_form_field.frm_first_two_thirds,
748
  .frm_form_field.frm_last_two_thirds,
749
  .frm_form_field.frm_two_thirds{
750
- width:65%;
751
- }
752
-
753
- .frm_form_field.frm_left_third,
754
- .frm_form_field.frm_first_third,
755
- .frm_form_field.frm_third,
756
- .frm_form_field.frm_left_two_thirds,
757
- .frm_form_field.frm_first_two_thirds,
758
- .frm_form_field.frm_two_thirds{
759
- margin-right:5%;
760
  }
761
 
762
  .frm_form_field.frm_left_fourth,
@@ -764,13 +703,11 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
764
  .frm_form_field.frm_right_fourth,
765
  .frm_form_field.frm_first_fourth,
766
  .frm_form_field.frm_last_fourth{
767
- width:22%;
768
  }
769
 
770
- .frm_form_field.frm_left_fourth,
771
- .frm_form_field.frm_fourth,
772
- .frm_form_field.frm_first_fourth{
773
- margin-right:4%;
774
  }
775
 
776
  .frm_form_field.frm_left_fifth,
@@ -778,46 +715,37 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
778
  .frm_form_field.frm_right_fifth,
779
  .frm_form_field.frm_first_fifth,
780
  .frm_form_field.frm_last_fifth{
781
- width:16%;
782
  }
783
 
784
- .frm_form_field.frm_left_fifth,
785
- .frm_form_field.frm_fifth,
786
- .frm_form_field.frm_first_fifth{
787
- margin-right:5%;
788
  }
789
 
790
- .frm_form_field.frm_sixth,
791
- .frm_form_field.frm_first_sixth,
792
- .frm_form_field.frm_last_sixth{
793
- width:13%;
 
 
794
  }
795
 
796
  .frm_form_field.frm_sixth,
797
- .frm_form_field.frm_first_sixth{
798
- margin-right:4%;
 
799
  }
800
 
801
  .frm_form_field.frm_seventh,
802
  .frm_form_field.frm_first_seventh,
803
  .frm_form_field.frm_last_seventh{
804
- width:11%;
805
- }
806
-
807
- .frm_form_field.frm_seventh,
808
- .frm_form_field.frm_first_seventh{
809
- margin-right:3%;
810
  }
811
 
812
  .frm_form_field.frm_eighth,
813
  .frm_form_field.frm_first_eighth,
814
  .frm_form_field.frm_last_eighth{
815
- width:10%;
816
- }
817
-
818
- .frm_form_field.frm_eighth,
819
- .frm_form_field.frm_first_eighth{
820
- margin-right:2.5%;
821
  }
822
 
823
  .frm_form_field.frm_left_inline,
@@ -828,14 +756,28 @@ table.frmcal-calendar .frmcal-today .frmcal_date{
828
  width:auto;
829
  }
830
 
831
- .frm_form_field.frm_left_inline,
832
- .frm_form_field.frm_first_inline,
833
- .frm_form_field.frm_inline{
834
- margin-right:4%;
 
 
 
 
 
 
835
  }
836
 
837
- .frm_form_field.frm_last{
838
- margin-right:0;
 
 
 
 
 
 
 
 
839
  }
840
 
841