Formidable Forms – Form Builder for WordPress - Version 2.0.10

Version Description

  • Add frm_action_triggers hook for adding custom triggers into the actions
  • Add frm_{action name here}_action_options hook so any action can be altered
  • Prevent extra form actions when a form is duplicated
  • Load correct version of formidable.js based on wp-config debugging constant (Thanks @naomicbush for the contributions!)
  • Revert get_sortable_columns changes for < WP 4.0 support
  • Pro Features:
  • Allow calculations inside repeating sections and embedded forms
  • Set default values for conditional checkboxes and radio fields and inside conditional sections
  • A few changes to the way section fields create divs
Download this release

Release Info

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

Code changes from version 2.0.09 to 2.0.10

classes/controllers/FrmEntriesController.php CHANGED
@@ -11,6 +11,7 @@ class FrmEntriesController {
11
  $frm_settings = FrmAppHelper::get_settings();
12
  add_filter( 'manage_' . sanitize_title( $frm_settings->menu ) . '_page_formidable-entries_columns', 'FrmEntriesController::manage_columns' );
13
  add_filter( 'get_user_option_manage' . sanitize_title( $frm_settings->menu ) . '_page_formidable-entriescolumnshidden', 'FrmEntriesController::hidden_columns' );
 
14
  }
15
  }
16
 
@@ -195,6 +196,29 @@ class FrmEntriesController {
195
  return $save;
196
  }
197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  public static function hidden_columns($result) {
199
  global $frm_vars;
200
 
11
  $frm_settings = FrmAppHelper::get_settings();
12
  add_filter( 'manage_' . sanitize_title( $frm_settings->menu ) . '_page_formidable-entries_columns', 'FrmEntriesController::manage_columns' );
13
  add_filter( 'get_user_option_manage' . sanitize_title( $frm_settings->menu ) . '_page_formidable-entriescolumnshidden', 'FrmEntriesController::hidden_columns' );
14
+ add_filter( 'manage_' . sanitize_title( $frm_settings->menu ) . '_page_formidable-entries_sortable_columns', 'FrmEntriesController::sortable_columns' );
15
  }
16
  }
17
 
196
  return $save;
197
  }
198
 
199
+ public static function sortable_columns() {
200
+ $form_id = FrmForm::get_current_form_id();
201
+ $fields = FrmField::get_all_for_form( $form_id );
202
+
203
+ $columns = array(
204
+ $form_id . '_id' => 'id',
205
+ $form_id . '_created_at' => 'created_at',
206
+ $form_id . '_updated_at' => 'updated_at',
207
+ $form_id . '_ip' => 'ip',
208
+ $form_id . '_item_key' => 'item_key',
209
+ $form_id . '_is_draft' => 'is_draft',
210
+ );
211
+
212
+ foreach ( $fields as $field ) {
213
+ if ( $field->type != 'checkbox' && ( ! isset( $field->field_options['post_field'] ) || $field->field_options['post_field'] == '' ) ) {
214
+ // Can't sort on checkboxes because they are stored serialized, or post fields
215
+ $columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id;
216
+ }
217
+ }
218
+
219
+ return $columns;
220
+ }
221
+
222
  public static function hidden_columns($result) {
223
  global $frm_vars;
224
 
classes/controllers/FrmFormsController.php CHANGED
@@ -8,6 +8,7 @@ class FrmFormsController {
8
  add_filter('get_user_option_managetoplevel_page_formidablecolumnshidden', 'FrmFormsController::hidden_columns' );
9
 
10
  add_filter('manage_toplevel_page_formidable_columns', 'FrmFormsController::get_columns', 0 );
 
11
  }
12
 
13
  public static function head() {
@@ -522,6 +523,16 @@ class FrmFormsController {
522
  return $columns;
523
  }
524
 
 
 
 
 
 
 
 
 
 
 
525
  public static function hidden_columns( $result ) {
526
  $return = false;
527
  foreach ( (array) $result as $r ) {
@@ -1151,7 +1162,8 @@ class FrmFormsController {
1151
 
1152
  public static function front_head() {
1153
  $version = FrmAppHelper::plugin_version();
1154
- wp_register_script( 'formidable', FrmAppHelper::plugin_url() . '/js/formidable.min.js', array( 'jquery' ), $version, true );
 
1155
  wp_register_script( 'jquery-placeholder', FrmAppHelper::plugin_url() . '/js/jquery/jquery.placeholder.js', array( 'jquery' ), '2.0.7', true );
1156
 
1157
  if ( FrmAppHelper::is_admin() ) {
8
  add_filter('get_user_option_managetoplevel_page_formidablecolumnshidden', 'FrmFormsController::hidden_columns' );
9
 
10
  add_filter('manage_toplevel_page_formidable_columns', 'FrmFormsController::get_columns', 0 );
11
+ add_filter('manage_toplevel_page_formidable_sortable_columns', 'FrmFormsController::get_sortable_columns' );
12
  }
13
 
14
  public static function head() {
523
  return $columns;
524
  }
525
 
526
+ public static function get_sortable_columns() {
527
+ return array(
528
+ 'id' => 'id',
529
+ 'name' => 'name',
530
+ 'description' => 'description',
531
+ 'form_key' => 'form_key',
532
+ 'created_at' => 'created_at',
533
+ );
534
+ }
535
+
536
  public static function hidden_columns( $result ) {
537
  $return = false;
538
  foreach ( (array) $result as $r ) {
1162
 
1163
  public static function front_head() {
1164
  $version = FrmAppHelper::plugin_version();
1165
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
1166
+ wp_register_script( 'formidable', FrmAppHelper::plugin_url() . "/js/formidable{$suffix}.js", array( 'jquery' ), $version, true );
1167
  wp_register_script( 'jquery-placeholder', FrmAppHelper::plugin_url() . '/js/jquery/jquery.placeholder.js', array( 'jquery' ), '2.0.7', true );
1168
 
1169
  if ( FrmAppHelper::is_admin() ) {
classes/helpers/FrmAppHelper.php CHANGED
@@ -10,7 +10,7 @@ class FrmAppHelper {
10
  /**
11
  * @since 2.0
12
  */
13
- public static $plug_version = '2.0.09';
14
 
15
  /**
16
  * @since 1.07.02
10
  /**
11
  * @since 2.0
12
  */
13
+ public static $plug_version = '2.0.10';
14
 
15
  /**
16
  * @since 1.07.02
classes/helpers/FrmEntriesListHelper.php CHANGED
@@ -73,29 +73,6 @@ class FrmEntriesListHelper extends FrmListHelper {
73
  // Searching is a pro feature
74
  }
75
 
76
- protected function get_sortable_columns() {
77
- $form_id = FrmForm::get_current_form_id();
78
- $fields = FrmField::get_all_for_form( $form_id );
79
-
80
- $columns = array(
81
- $form_id . '_id' => 'id',
82
- $form_id . '_created_at' => 'created_at',
83
- $form_id . '_updated_at' => 'updated_at',
84
- $form_id . '_ip' => 'ip',
85
- $form_id . '_item_key' => 'item_key',
86
- $form_id . '_is_draft' => 'is_draft',
87
- );
88
-
89
- foreach ( $fields as $field ) {
90
- if ( $field->type != 'checkbox' && ( ! isset( $field->field_options['post_field'] ) || $field->field_options['post_field'] == '' ) ) {
91
- // Can't sort on checkboxes because they are stored serialized, or post fields
92
- $columns[ $form_id . '_' . $field->field_key ] = 'meta_' . $field->id;
93
- }
94
- }
95
-
96
- return $columns;
97
- }
98
-
99
  public function single_row( $item, $style = '' ) {
100
  // Set up the hover actions for this user
101
  $actions = array();
73
  // Searching is a pro feature
74
  }
75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  public function single_row( $item, $style = '' ) {
77
  // Set up the hover actions for this user
78
  $actions = array();
classes/helpers/FrmFormsListHelper.php CHANGED
@@ -158,16 +158,6 @@ class FrmFormsListHelper extends FrmListHelper {
158
  <?php
159
  }
160
 
161
- protected function get_sortable_columns() {
162
- return array(
163
- 'id' => 'id',
164
- 'name' => 'name',
165
- 'description' => 'description',
166
- 'form_key' => 'form_key',
167
- 'created_at' => 'created_at',
168
- );
169
- }
170
-
171
  public function get_views() {
172
 
173
  $statuses = array(
158
  <?php
159
  }
160
 
 
 
 
 
 
 
 
 
 
 
161
  public function get_views() {
162
 
163
  $statuses = array(
classes/models/FrmDb.php CHANGED
@@ -46,8 +46,10 @@ class FrmDb {
46
  do_action('frm_after_install');
47
 
48
  /**** update the styling settings ****/
49
- $frm_style = new FrmStyle();
50
- $frm_style->update( 'default' );
 
 
51
  }
52
 
53
  public function collation() {
46
  do_action('frm_after_install');
47
 
48
  /**** update the styling settings ****/
49
+ if ( is_admin() ) {
50
+ $frm_style = new FrmStyle();
51
+ $frm_style->update( 'default' );
52
+ }
53
  }
54
 
55
  public function collation() {
classes/models/FrmFormAction.php CHANGED
@@ -88,6 +88,7 @@ class FrmFormAction {
88
  'tooltip' => $name,
89
  );
90
 
 
91
  $this->action_options = wp_parse_args( $action_options, $default_options );
92
  $this->control_options = wp_parse_args( $control_options, array( 'id_base' => $this->id_base ) );
93
  }
@@ -175,7 +176,7 @@ class FrmFormAction {
175
  }
176
 
177
  $this->form_id = $old_id;
178
- $actions = $this->get_all();
179
 
180
  $this->form_id = $form_id;
181
  foreach ( $actions as $action ) {
88
  'tooltip' => $name,
89
  );
90
 
91
+ $action_options = apply_filters( 'frm_' . $id_base . '_action_options', $action_options );
92
  $this->action_options = wp_parse_args( $action_options, $default_options );
93
  $this->control_options = wp_parse_args( $control_options, array( 'id_base' => $this->id_base ) );
94
  }
176
  }
177
 
178
  $this->form_id = $old_id;
179
+ $actions = $this->get_all( $old_id );
180
 
181
  $this->form_id = $form_id;
182
  foreach ( $actions as $action ) {
classes/views/frm-entries/form.php CHANGED
@@ -38,6 +38,12 @@ if ( FrmAppHelper::is_admin() && ! $frm_settings->lock_keys ) { ?>
38
  do_action('frm_entry_form', $form, $form_action, $errors);
39
 
40
  global $frm_vars;
 
 
 
 
 
 
41
  // close open collapsible toggle div
42
  if ( isset($frm_vars['collapse_div']) && $frm_vars['collapse_div'] ) {
43
  echo "</div>\n";
38
  do_action('frm_entry_form', $form, $form_action, $errors);
39
 
40
  global $frm_vars;
41
+ // close open section div
42
+ if ( isset( $frm_vars['div'] ) && $frm_vars['div'] ) {
43
+ echo "</div>\n";
44
+ unset( $frm_vars['div'] );
45
+ }
46
+
47
  // close open collapsible toggle div
48
  if ( isset($frm_vars['collapse_div']) && $frm_vars['collapse_div'] ) {
49
  echo "</div>\n";
classes/views/frm-form-actions/_action_inside.php CHANGED
@@ -32,11 +32,11 @@ if ( count( $action_control->action_options['event'] ) == 1 || $action_control->
32
  ?>
33
  <p><label><?php _e( 'Trigger this action after', 'formidable' ) ?></label>
34
  <?php
35
- $event_labels = array(
36
  'create' => __( 'Create', 'formidable' ),
37
  'update' => __( 'Update', 'formidable' ),
38
  'delete' => __( 'Delete', 'formidable' ),
39
- );
40
 
41
  foreach ( $action_control->action_options['event'] as $event ) { ?>
42
  <label for="frm_action_event_<?php echo esc_attr( $event ) ?>" class="frm_action_events">
32
  ?>
33
  <p><label><?php _e( 'Trigger this action after', 'formidable' ) ?></label>
34
  <?php
35
+ $event_labels = apply_filters( 'frm_action_triggers', array(
36
  'create' => __( 'Create', 'formidable' ),
37
  'update' => __( 'Update', 'formidable' ),
38
  'delete' => __( 'Delete', 'formidable' ),
39
+ ) );
40
 
41
  foreach ( $action_control->action_options['event'] as $event ) { ?>
42
  <label for="frm_action_event_<?php echo esc_attr( $event ) ?>" class="frm_action_events">
classes/views/frm-forms/add_field.php CHANGED
@@ -158,16 +158,8 @@ if ( $display['options'] ) { ?>
158
  <div class="widget-inside">
159
  <table class="form-table frm_clear_none">
160
  <?php $field_types = FrmFieldsHelper::get_field_types($field['type']); ?>
161
- <tr><td class="frm_150_width"><label><?php _e( 'Field Type', 'formidable' ) ?></label></td>
162
  <td>
163
- <div class="hide-if-no-js edit-slug-box frm_help" title="<?php esc_attr_e( 'The field key can be used as an alternative to the field ID in many cases.', 'formidable' ) ?>">
164
- <?php _e( 'Field Key:', 'formidable' ) ?>
165
- <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>
166
- <?php if ( ! $frm_settings->lock_keys ) { ?>
167
- <input type="hidden" name="field_options[field_key_<?php echo esc_attr( $field['id'] ) ?>]" value="<?php echo esc_attr( $field['field_key'] ); ?>" />
168
- <?php } ?>
169
- </div>
170
-
171
  <select <?php if ( count($field_types) == 1 ) { ?>disabled="disabled"<?php } else { ?>name="field_options[type_<?php echo esc_attr( $field['id'] ) ?>]"<?php } ?>>
172
  <?php
173
  foreach ( $field_types as $fkey => $ftype ) { ?>
@@ -212,6 +204,19 @@ if ( $display['options'] ) { ?>
212
  <?php } ?>
213
  </td>
214
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
215
 
216
  <?php
217
  if ( $display['css'] ) { ?>
158
  <div class="widget-inside">
159
  <table class="form-table frm_clear_none">
160
  <?php $field_types = FrmFieldsHelper::get_field_types($field['type']); ?>
161
+ <tr><td class="frm_150_width"><label><?php _e( 'Field Type', 'formidable' ) ?></label></td>
162
  <td>
 
 
 
 
 
 
 
 
163
  <select <?php if ( count($field_types) == 1 ) { ?>disabled="disabled"<?php } else { ?>name="field_options[type_<?php echo esc_attr( $field['id'] ) ?>]"<?php } ?>>
164
  <?php
165
  foreach ( $field_types as $fkey => $ftype ) { ?>
204
  <?php } ?>
205
  </td>
206
  </tr>
207
+ <tr>
208
+ <td class="frm_150_width">
209
+ <div class="hide-if-no-js edit-slug-box frm_help" title="<?php esc_attr_e( 'The field key can be used as an alternative to the field ID in many cases.', 'formidable' ) ?>">
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
 
221
  <?php
222
  if ( $display['css'] ) { ?>
css/_single_theme.css.php CHANGED
@@ -248,6 +248,9 @@ if ( ! isset($collapse_icon) ) {
248
  .<?php echo $style_class ?> .frm_inline_container label.frm_primary_label,
249
  .<?php echo $style_class ?> .frm_inline_container:not(.frm_dynamic_select_container) .frm_opt_container{
250
  display:inline<?php echo $important ?>;
 
 
 
251
  margin-right:10px<?php echo $important ?>;
252
  }
253
 
248
  .<?php echo $style_class ?> .frm_inline_container label.frm_primary_label,
249
  .<?php echo $style_class ?> .frm_inline_container:not(.frm_dynamic_select_container) .frm_opt_container{
250
  display:inline<?php echo $important ?>;
251
+ }
252
+
253
+ .<?php echo $style_class ?> .frm_inline_container.frm_scale_container label.frm_primary_label{
254
  margin-right:10px<?php echo $important ?>;
255
  }
256
 
css/custom_theme.css.php CHANGED
@@ -63,6 +63,12 @@ legend.frm_hidden{
63
  width:auto;
64
  }
65
 
 
 
 
 
 
 
66
  .with_frm_style .frm_right_container label.frm_primary_label,
67
  .with_frm_style .frm_pos_right{
68
  display:inline;
63
  width:auto;
64
  }
65
 
66
+ .with_frm_style .frm_inline_container label.frm_primary_label,
67
+ .with_frm_style .frm_inline_container:not(.frm_dynamic_select_container) .frm_opt_container{
68
+ display:inline;
69
+ margin-right:10px;
70
+ }
71
+
72
  .with_frm_style .frm_right_container label.frm_primary_label,
73
  .with_frm_style .frm_pos_right{
74
  display:inline;
css/frm_admin.css CHANGED
@@ -669,6 +669,16 @@ textarea.inplace_field{
669
  border: 1px solid #DDD;
670
  cursor:text;
671
  }
 
 
 
 
 
 
 
 
 
 
672
  .frm_ipe_form_key.editInPlace-active, .frm_ipe_field_key.editInPlace-active{
673
  white-space:normal;
674
  width:auto;
@@ -716,8 +726,7 @@ textarea.inplace_field{
716
  /* End In place edit */
717
 
718
  .frm_field_key{background-color:#F7F7F7;}
719
- .edit-slug-box{width:13em;max-width:30%;float:right;}
720
- .edit-slug-box{color:#777;}
721
  #frm_form_editor_container #edit-slug-box {padding:0;}
722
  table td, .form-table tr td{vertical-align:top;}
723
 
@@ -2076,6 +2085,10 @@ Responsive Design
2076
  background: none;
2077
  border:none;
2078
  }
 
 
 
 
2079
  }
2080
  @media only screen and (max-width: 1050px) {
2081
  .frm_drag_inst{font-size: 20px;}
669
  border: 1px solid #DDD;
670
  cursor:text;
671
  }
672
+ .frm_ipe_field_key,
673
+ .frm_field_key {
674
+ float: none;
675
+ margin: 1px;
676
+ padding: 3px 5px;
677
+ width:14em;
678
+ }
679
+ .frm_ipe_field_key .inplace_field {
680
+ width: 14.5em !important;
681
+ }
682
  .frm_ipe_form_key.editInPlace-active, .frm_ipe_field_key.editInPlace-active{
683
  white-space:normal;
684
  width:auto;
726
  /* End In place edit */
727
 
728
  .frm_field_key{background-color:#F7F7F7;}
729
+
 
730
  #frm_form_editor_container #edit-slug-box {padding:0;}
731
  table td, .form-table tr td{vertical-align:top;}
732
 
2085
  background: none;
2086
  border:none;
2087
  }
2088
+ .frm_inline_label {
2089
+ display: block;
2090
+ margin: 5px 0;
2091
+ }
2092
  }
2093
  @media only screen and (max-width: 1050px) {
2094
  .frm_drag_inst{font-size: 20px;}
formidable.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
- Version: 2.0.09
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
2
  /*
3
  Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
+ Version: 2.0.10
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
js/formidable.js ADDED
@@ -0,0 +1,1990 @@