Formidable Forms – Form Builder for WordPress - Version 1.07.09

Version Description

  • Added frm_bulk_field_choices hook for adding custom prepopulated options
  • Cleanup styling on bulk option popup
  • Fixed submission error affecting some sites
  • PRO: Don't reload javascripts after ajax submit
  • PRO: Improve no conflict styling mode
  • PRO: Fixed cascading calculations
  • PRO: Allow HTML for the label and cancel links in the edit link shortcodes
Download this release

Release Info

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

Code changes from version 1.07.08 to 1.07.09

classes/controllers/FrmAppController.php CHANGED
@@ -168,11 +168,18 @@ return false;
168
 
169
  public static function admin_js(){
170
  global $pagenow;
 
 
 
 
 
171
  wp_enqueue_script('jquery');
172
  wp_enqueue_script('jquery-ui-core');
173
  wp_register_script('bootstrap_tooltip', FrmAppHelper::plugin_url() .'/js/bootstrap.min.js', array('jquery'), '3.0.3');
174
 
175
- if ( isset($_GET) && (isset($_GET['page']) && preg_match('/formidable*/', $_GET['page'])) || ($pagenow == 'edit.php' && isset($_GET) && isset($_GET['post_type']) && $_GET['post_type'] == 'frm_display') ) {
 
 
176
  $version = FrmAppHelper::plugin_version();
177
  add_filter('admin_body_class', 'FrmAppController::admin_body_class');
178
 
@@ -241,7 +248,6 @@ return false;
241
 
242
  if (is_multisite()){
243
  global $frm_vars;
244
-
245
  $old_db_version = get_option('frm_db_version');
246
  $pro_db_version = ($frm_vars['pro_is_installed']) ? get_option('frmpro_db_version') : false;
247
  if ( ( (int) $old_db_version < (int) FrmAppHelper::$db_version ) ||
@@ -252,19 +258,25 @@ return false;
252
 
253
  $version = FrmAppHelper::plugin_version();
254
  wp_register_script('formidable', FrmAppHelper::plugin_url() . '/js/formidable.min.js', array('jquery'), $version, true);
255
- if(!is_admin() or defined('DOING_AJAX'))
256
- self::localize_script('front');
257
-
258
  wp_register_script('recaptcha-ajax', 'http'. (is_ssl() ? 's' : '').'://www.google.com/recaptcha/api/js/recaptcha_ajax.js', '', true);
 
 
 
 
 
 
 
 
259
  wp_enqueue_script('jquery');
260
- wp_register_script('jquery-placeholder', FrmAppHelper::plugin_url() .'/js/jquery/jquery.placeholder.js', array('jquery'), '2.0.7', true);
261
 
262
  $style = apply_filters('get_frm_stylesheet', array('frm-forms' => FrmAppHelper::plugin_url() .'/css/frm_display.css'));
263
  if($style){
264
  foreach((array)$style as $k => $file){
265
  wp_register_style($k, $file, array(), $version);
266
- if((!is_admin() or defined('DOING_AJAX')) and $frm_settings->load_style == 'all')
267
  wp_enqueue_style($k);
 
268
  unset($k);
269
  unset($file);
270
  }
168
 
169
  public static function admin_js(){
170
  global $pagenow;
171
+
172
+ if ( 'admin-ajax.php' == $pagenow && isset($_GET['action']) && $_GET['action'] != 'frm_import_choices' ) {
173
+ return;
174
+ }
175
+
176
  wp_enqueue_script('jquery');
177
  wp_enqueue_script('jquery-ui-core');
178
  wp_register_script('bootstrap_tooltip', FrmAppHelper::plugin_url() .'/js/bootstrap.min.js', array('jquery'), '3.0.3');
179
 
180
+ if ( isset($_GET) && ((isset($_GET['page']) && strpos($_GET['page'], 'formidable') === 0 ) ||
181
+ ($pagenow == 'edit.php' && isset($_GET['post_type']) && $_GET['post_type'] == 'frm_display'))
182
+ ) {
183
  $version = FrmAppHelper::plugin_version();
184
  add_filter('admin_body_class', 'FrmAppController::admin_body_class');
185
 
248
 
249
  if (is_multisite()){
250
  global $frm_vars;
 
251
  $old_db_version = get_option('frm_db_version');
252
  $pro_db_version = ($frm_vars['pro_is_installed']) ? get_option('frmpro_db_version') : false;
253
  if ( ( (int) $old_db_version < (int) FrmAppHelper::$db_version ) ||
258
 
259
  $version = FrmAppHelper::plugin_version();
260
  wp_register_script('formidable', FrmAppHelper::plugin_url() . '/js/formidable.min.js', array('jquery'), $version, true);
261
+ wp_register_script('jquery-placeholder', FrmAppHelper::plugin_url() .'/js/jquery/jquery.placeholder.js', array('jquery'), '2.0.7', true);
 
 
262
  wp_register_script('recaptcha-ajax', 'http'. (is_ssl() ? 's' : '').'://www.google.com/recaptcha/api/js/recaptcha_ajax.js', '', true);
263
+
264
+ if ( is_admin() && !defined('DOING_AJAX') ) {
265
+ // don't load this in back-end
266
+ return;
267
+ }
268
+
269
+ self::localize_script('front');
270
+
271
  wp_enqueue_script('jquery');
 
272
 
273
  $style = apply_filters('get_frm_stylesheet', array('frm-forms' => FrmAppHelper::plugin_url() .'/css/frm_display.css'));
274
  if($style){
275
  foreach((array)$style as $k => $file){
276
  wp_register_style($k, $file, array(), $version);
277
+ if ( 'all' == $frm_settings->load_style ) {
278
  wp_enqueue_style($k);
279
+ }
280
  unset($k);
281
  unset($file);
282
  }
classes/controllers/FrmFieldsController.php CHANGED
@@ -310,6 +310,8 @@ class FrmFieldsController{
310
  __('Disagree', 'formidable'), __('Strongly Disagree', 'formidable'), __('N/A', 'formidable')
311
  );
312
 
 
 
313
  $frm_field = new FrmField();
314
  $field = $frm_field->getOne($field_id);
315
 
@@ -417,12 +419,13 @@ class FrmFieldsController{
417
  }
418
 
419
  public static function input_html($field, $echo=true){
420
- global $frm_settings;
421
 
422
  $class = ''; //$field['type'];
423
 
424
- if(is_admin() and !defined('DOING_AJAX') and !in_array($field['type'], array('scale', 'radio', 'checkbox', 'data')))
425
  $class .= 'dyn_default_value';
 
426
 
427
  $add_html = '';
428
 
310
  __('Disagree', 'formidable'), __('Strongly Disagree', 'formidable'), __('N/A', 'formidable')
311
  );
312
 
313
+ $prepop = apply_filters('frm_bulk_field_choices', $prepop);
314
+
315
  $frm_field = new FrmField();
316
  $field = $frm_field->getOne($field_id);
317
 
419
  }
420
 
421
  public static function input_html($field, $echo=true){
422
+ global $frm_settings, $frm_vars;
423
 
424
  $class = ''; //$field['type'];
425
 
426
+ if ( is_admin() && (!isset($frm_vars['preview']) || !$frm_vars['preview']) && !in_array($field['type'], array('scale', 'radio', 'checkbox', 'data')) ) {
427
  $class .= 'dyn_default_value';
428
+ }
429
 
430
  $add_html = '';
431
 
classes/helpers/FrmEntriesHelper.php CHANGED
@@ -142,24 +142,7 @@ class FrmEntriesHelper{
142
  }
143
 
144
  public static function entries_dropdown( $form_id, $field_name, $field_value='', $blank=true, $blank_label='', $onchange=false ){
145
- global $wpdb, $frmdb;
146
-
147
- $entries = $wpdb->get_results( $wpdb->prepare(
148
- "SELECT id, item_key, name FROM {$wpdb->prefix}frm_items WHERE form_id=%d ORDER BY name ASC LIMIT 999",
149
- $form_id
150
- ) );
151
- ?>
152
- <select name="<?php echo $field_name; ?>" id="<?php echo $field_name; ?>" <?php if ($onchange) echo 'onchange="'. $onchange .'"'; ?>>
153
- <?php if ($blank){ ?>
154
- <option value=""><?php echo $blank_label; ?></option>
155
- <?php } ?>
156
- <?php foreach($entries as $entry){ ?>
157
- <option value="<?php echo $entry->id; ?>" <?php selected($field_value, $entry->id); ?>><?php echo FrmAppHelper::truncate((!empty($entry->name)) ? stripslashes($entry->name) : $entry->item_key, 40); ?></option>
158
- <?php
159
- unset($entry);
160
- } ?>
161
- </select>
162
- <?php
163
  }
164
 
165
  public static function enqueue_scripts($params){
142
  }
143
 
144
  public static function entries_dropdown( $form_id, $field_name, $field_value='', $blank=true, $blank_label='', $onchange=false ){
145
+ _deprecated_function( __FUNCTION__, '1.07.09');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  }
147
 
148
  public static function enqueue_scripts($params){
classes/helpers/FrmFormsHelper.php CHANGED
@@ -277,5 +277,16 @@ BEFORE_HTML;
277
 
278
  return $html;
279
  }
 
 
 
 
 
 
 
 
 
 
 
280
 
281
  }
277
 
278
  return $html;
279
  }
280
+
281
+ public static function form_loaded($form) {
282
+ global $frm_vars;
283
+ $small_form = new stdClass();
284
+ foreach ( array('id', 'form_key', 'name' ) as $var ) {
285
+ $small_form->{$var} = $form->{$var};
286
+ unset($var);
287
+ }
288
+
289
+ $frm_vars['forms_loaded'][] = $small_form;
290
+ }
291
 
292
  }
classes/models/FrmEntry.php CHANGED
@@ -89,7 +89,7 @@ class FrmEntry{
89
  }
90
 
91
  $query_results = $wpdb->insert( $wpdb->prefix .'frm_items', $new_values );
92
-
93
  if ( $query_results ) {
94
  $entry_id = $wpdb->insert_id;
95
 
@@ -407,9 +407,9 @@ class FrmEntry{
407
 
408
 
409
  // check for spam
410
- if ( isset($values['item_meta']) && !empty($values['item_meta']) && empty($errors) ) {
411
  global $wpcom_api_key;
412
- if ( (function_exists( 'akismet_http_post' ) || method_exists('Akismet', 'http_post')) && ((get_option('wordpress_api_key') || $wpcom_api_key)) && $this->akismet($values) ) {
413
  $frm_form = new FrmForm();
414
  $form = $frm_form->getOne($values['form_id']);
415
 
@@ -463,7 +463,7 @@ class FrmEntry{
463
  //Check entries for spam -- returns true if is spam
464
  function akismet($values) {
465
  global $akismet_api_host, $akismet_api_port;
466
-
467
  $content = FrmEntriesHelper::entry_array_to_string($values);
468
 
469
  if ( empty($content) ) {
@@ -489,7 +489,7 @@ class FrmEntry{
489
  foreach ( $datas as $key => $data )
490
  $query_string .= $key . '=' . urlencode( stripslashes( $data ) ) . '&';
491
 
492
- if ( method_exists('Akismet', 'http_post') ) {
493
  $response = Akismet::http_post($query_string, 'comment-check', $akismet_api_port);
494
  } else {
495
  $response = akismet_http_post( $query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port );
89
  }
90
 
91
  $query_results = $wpdb->insert( $wpdb->prefix .'frm_items', $new_values );
92
+
93
  if ( $query_results ) {
94
  $entry_id = $wpdb->insert_id;
95
 
407
 
408
 
409
  // check for spam
410
+ if ( empty($exclude) && isset($values['item_meta']) && !empty($values['item_meta']) && empty($errors) ) {
411
  global $wpcom_api_key;
412
+ if ( (function_exists( 'akismet_http_post' ) || is_callable('Akismet::http_post')) && ((get_option('wordpress_api_key') || $wpcom_api_key)) && $this->akismet($values) ) {
413
  $frm_form = new FrmForm();
414
  $form = $frm_form->getOne($values['form_id']);
415
 
463
  //Check entries for spam -- returns true if is spam
464
  function akismet($values) {
465
  global $akismet_api_host, $akismet_api_port;
466
+
467
  $content = FrmEntriesHelper::entry_array_to_string($values);
468
 
469
  if ( empty($content) ) {
489
  foreach ( $datas as $key => $data )
490
  $query_string .= $key . '=' . urlencode( stripslashes( $data ) ) . '&';
491
 
492
+ if ( is_callable('Akismet::http_post') ) {
493
  $response = Akismet::http_post($query_string, 'comment-check', $akismet_api_port);
494
  } else {
495
  $response = akismet_http_post( $query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port );
classes/views/frm-entries/form.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  global $frm_vars, $frm_settings;
3
- $frm_vars['forms_loaded'][] = $form;
4
  if($values['custom_style']) $frm_vars['load_css'] = true;
5
 
6
  if((!isset($frm_vars['css_loaded']) || !$frm_vars['css_loaded']) && $frm_vars['load_css']){
1
  <?php
2
  global $frm_vars, $frm_settings;
3
+ FrmFormsHelper::form_loaded($form);
4
  if($values['custom_style']) $frm_vars['load_css'] = true;
5
 
6
  if((!isset($frm_vars['css_loaded']) || !$frm_vars['css_loaded']) && $frm_vars['load_css']){
classes/views/frm-entries/frm-entry.php CHANGED
@@ -25,7 +25,7 @@ if ( $params['action'] == 'create' && $params['posted_form_id'] == $form->id &&
25
  require(FrmAppHelper::plugin_path() .'/classes/views/frm-entries/new.php');
26
  } else {
27
  global $frm_vars;
28
- $frm_vars['forms_loaded'][] = $form;
29
  if ( $values['custom_style'] ) {
30
  $frm_vars['load_css'] = true;
31
  }
25
  require(FrmAppHelper::plugin_path() .'/classes/views/frm-entries/new.php');
26
  } else {
27
  global $frm_vars;
28
+ FrmFormsHelper::form_loaded($form);
29
  if ( $values['custom_style'] ) {
30
  $frm_vars['load_css'] = true;
31
  }
classes/views/frm-fields/import_choices.php CHANGED
@@ -46,9 +46,9 @@
46
  }
47
  </style>
48
  </head>
49
- <body class="wp-admin no-js <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>" style="min-width:300px;">
50
  <div style="padding:10px;">
51
- <p><?php _e('Edit or add field options (one per line)', 'formidable') ?></p>
52
  <ul class="prepop">
53
  <?php foreach($prepop as $label => $pop){ ?>
54
  <li><a onclick='frmPrePop(<?php echo str_replace("'", '&#145;', json_encode($pop)) ?>); return false;'><?php echo $label ?></a></li>
@@ -71,7 +71,6 @@ if(is_array($fopt)){
71
 
72
  <p class="submit clear">
73
  <input type="button" onclick="window.top.frmUpdateOpts(<?php echo $field->id ?>,jQuery('#frm_bulk_options').val()); window.top.tb_remove();" class="button-primary" value="<?php _e('Update Field Choices', 'formidable') ?>" />
74
- <input type="button" onclick="window.top.tb_remove();" class="button" value="<?php _e('Cancel', 'formidable') ?>" />
75
  </p>
76
  </div>
77
 
46
  }
47
  </style>
48
  </head>
49
+ <body class="wp-admin no-js wp-core-ui <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>" style="min-width:300px;background-color:#fff;">
50
  <div style="padding:10px;">
51
+ <p class="howto"><?php _e('Edit or add field options (one per line)', 'formidable') ?></p>
52
  <ul class="prepop">
53
  <?php foreach($prepop as $label => $pop){ ?>
54
  <li><a onclick='frmPrePop(<?php echo str_replace("'", '&#145;', json_encode($pop)) ?>); return false;'><?php echo $label ?></a></li>
71
 
72
  <p class="submit clear">
73
  <input type="button" onclick="window.top.frmUpdateOpts(<?php echo $field->id ?>,jQuery('#frm_bulk_options').val()); window.top.tb_remove();" class="button-primary" value="<?php _e('Update Field Choices', 'formidable') ?>" />
 
74
  </p>
75
  </div>
76
 
classes/views/frm-fields/input.php CHANGED
@@ -61,15 +61,22 @@ if (FrmAppHelper::check_selected($field['value'], $field_val)) echo ' selected="
61
  }
62
  }
63
 
64
- }else if ($field['type'] == 'captcha' and (!is_admin() or defined('DOING_AJAX'))){
65
- global $frm_settings;
66
- $error_msg = null;
67
- if(!empty($errors)){
68
- foreach($errors as $error_key => $error){
69
- if(preg_match('/^captcha-/', $error_key))
70
- $error_msg = preg_replace('/^captcha-/', '', $error_key);
 
71
  }
 
72
  }
73
- if (!empty($frm_settings->pubkey))
74
- FrmFieldsHelper::display_recaptcha($field, $error_msg);
75
- }else do_action('frm_form_fields', $field, $field_name);
 
 
 
 
 
61
  }
62
  }
63
 
64
+ } else if ( $field['type'] == 'captcha' && (!is_admin() || defined('DOING_AJAX')) ) {
65
+ global $frm_settings;
66
+ $error_msg = null;
67
+
68
+ if ( !empty($errors) ) {
69
+ foreach ( $errors as $error_key => $error ) {
70
+ if ( strpos($error_key, 'captcha-') === 0 ) {
71
+ $error_msg = preg_replace('/^captcha-/', '', $error_key);
72
  }
73
+ unset($error);
74
  }
75
+ }
76
+
77
+ if ( !empty($frm_settings->pubkey) ) {
78
+ FrmFieldsHelper::display_recaptcha($field, $error_msg);
79
+ }
80
+ } else {
81
+ do_action('frm_form_fields', $field, $field_name);
82
+ }
css/frm_admin.css CHANGED
@@ -258,7 +258,7 @@ textarea.inplace_field{width:98% !important;}
258
  .edit-slug-box{color:#777;}
259
  table td, .form-table tr td{vertical-align:top;}
260
 
261
- .frm_rte{background:url(../pro/images/rte.gif) no-repeat; }
262
  .frm_rte .howto{margin:10px 0 45px 0;}
263
  .frm_38_trigger .frm_rte .howto{margin-bottom:39px;}
264
  .button-secondary.frm_html_field{
@@ -578,7 +578,7 @@ table td.frm_left_label{float:none;line-height:inherit;padding-right:0;}
578
  font-weight:bold;
579
  border:1px solid #DFDFDF;
580
  background-color:#EEEEEE;
581
- padding-top:3px;
582
  font-size:16px;
583
  line-height:20px;
584
  }
258
  .edit-slug-box{color:#777;}
259
  table td, .form-table tr td{vertical-align:top;}
260
 
261
+ .frm_rte{background:url(../pro/images/rte.png) no-repeat; }
262
  .frm_rte .howto{margin:10px 0 45px 0;}
263
  .frm_38_trigger .frm_rte .howto{margin-bottom:39px;}
264
  .button-secondary.frm_html_field{
578
  font-weight:bold;
579
  border:1px solid #DFDFDF;
580
  background-color:#EEEEEE;
581
+ padding:3px 5px 2px;
582
  font-size:16px;
583
  line-height:20px;
584
  }
formidable.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Formidable
4
  Description: Quickly and easily create drag-and-drop forms
5
- Version: 1.07.08
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: 1.07.09
6
  Plugin URI: http://formidablepro.com/
7
  Author URI: http://strategy11.com
8
  Author: Strategy11
js/formidable.js CHANGED
@@ -464,7 +464,7 @@ function frmGetFormErrors(object){
464
  }
465
 
466
  function frmEditEntry(entry_id,prefix,post_id,form_id,cancel,hclass){
467
- var label=jQuery('#frm_edit_'+entry_id).text();
468
  var orig=jQuery('#'+prefix+entry_id).html();
469
  jQuery('#'+prefix+entry_id).html('<span class="frm-loading-img" id="'+prefix+entry_id+'"></span><div class="frm_orig_content" style="display:none">'+orig+'</div>');
470
  jQuery.ajax({
@@ -472,18 +472,18 @@ function frmEditEntry(entry_id,prefix,post_id,form_id,cancel,hclass){
472
  data:"action=frm_entries_edit_entry_ajax&post_id="+post_id+"&entry_id="+entry_id+"&id="+form_id,
473
  success:function(html){
474
  jQuery('#'+prefix+entry_id).children('.frm-loading-img').replaceWith(html);
475
- jQuery('#frm_edit_'+entry_id).replaceWith('<span id="frm_edit_'+entry_id+'"><a onclick="frmCancelEdit('+entry_id+',\''+prefix+'\',\''+label+'\','+post_id+','+form_id+',\''+hclass+'\')" class="'+hclass+'">'+cancel+'</a></span>');
476
  }
477
  });
478
  }
479
 
480
  function frmCancelEdit(entry_id,prefix,label,post_id,form_id,hclass){
481
- var cancel=jQuery('#frm_edit_'+entry_id).text();
482
  if(!jQuery('#frm_edit_'+entry_id).find('a').hasClass('frm_ajax_edited')){
483
  jQuery('#'+prefix+entry_id).children('.frm_forms').replaceWith('');
484
  jQuery('#'+prefix+entry_id).children('.frm_orig_content').fadeIn('slow').removeClass('frm_orig_content');
485
  }
486
- jQuery('#frm_edit_'+entry_id).replaceWith('<a id="frm_edit_'+entry_id+'" class="frm_edit_link '+hclass+'" href="javascript:frmEditEntry('+entry_id+',\''+prefix+'\','+post_id+','+form_id+',\''+cancel+'\',\''+hclass+'\')">'+label+'</a>');
487
  }
488
 
489
  function frmUpdateField(entry_id,field_id,value,message,num){
@@ -554,6 +554,15 @@ function frmScrollMsg(id){
554
  window.scrollTo(frmPos.left, (frmPos.top-28));
555
  }
556
 
 
 
 
 
 
 
 
 
 
557
  jQuery.fn.frmVisible = function() {
558
  return this.css('visibility', 'visible');
559
  };
464
  }
465
 
466
  function frmEditEntry(entry_id,prefix,post_id,form_id,cancel,hclass){
467
+ var label=jQuery('#frm_edit_'+entry_id).html();
468
  var orig=jQuery('#'+prefix+entry_id).html();
469
  jQuery('#'+prefix+entry_id).html('<span class="frm-loading-img" id="'+prefix+entry_id+'"></span><div class="frm_orig_content" style="display:none">'+orig+'</div>');
470
  jQuery.ajax({
472
  data:"action=frm_entries_edit_entry_ajax&post_id="+post_id+"&entry_id="+entry_id+"&id="+form_id,
473
  success:function(html){
474
  jQuery('#'+prefix+entry_id).children('.frm-loading-img').replaceWith(html);
475
+ jQuery('#frm_edit_'+entry_id).replaceWith('<span id="frm_edit_'+entry_id+'"><a onclick="frmCancelEdit('+entry_id+',\''+prefix+'\',\''+frm_escape_html(label)+'\','+post_id+','+form_id+',\''+hclass+'\')" class="'+hclass+'">'+cancel+'</a></span>');
476
  }
477
  });
478
  }
479
 
480
  function frmCancelEdit(entry_id,prefix,label,post_id,form_id,hclass){
481
+ var cancel=jQuery('#frm_edit_'+entry_id+' a').html();
482
  if(!jQuery('#frm_edit_'+entry_id).find('a').hasClass('frm_ajax_edited')){
483
  jQuery('#'+prefix+entry_id).children('.frm_forms').replaceWith('');
484
  jQuery('#'+prefix+entry_id).children('.frm_orig_content').fadeIn('slow').removeClass('frm_orig_content');
485
  }
486
+ jQuery('#frm_edit_'+entry_id).replaceWith('<a id="frm_edit_'+entry_id+'" class="frm_edit_link '+hclass+'" href="javascript:frmEditEntry('+entry_id+',\''+prefix+'\','+post_id+','+form_id+',\''+frm_escape_html(cancel)+'\',\''+hclass+'\')">'+label+'</a>');
487
  }
488
 
489
  function frmUpdateField(entry_id,field_id,value,message,num){
554
  window.scrollTo(frmPos.left, (frmPos.top-28));
555
  }
556
 
557
+ function frm_escape_html(text){
558
+ return text
559
+ .replace(/&/g, "&amp;")
560
+ .replace(/</g, "&lt;")
561
+ .replace(/>/g, "&gt;")
562
+ .replace(/"/g, "&quot;")
563
+ .replace(/'/g, "&#039;");
564
+ }
565
+
566
  jQuery.fn.frmVisible = function() {
567
  return this.css('visibility', 'visible');
568
  };
js/formidable.min.js CHANGED
@@ -28,11 +28,12 @@ jQuery(a).find('input[name="form_id"]').val()+"_container");d=c.offset().top;c.r
28
  e).find("a").addClass("frm_ajax_edited").click())}else{jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");jQuery(a).find(".frm_ajax_loading").css("visibility","hidden");h=!0;jQuery(".form-field").removeClass("frm_blank_field");jQuery(".form-field .frm_error").replaceWith("");c="";var k=!1,l;for(l in e)if(jQuery(a).find("#frm_field_"+l+"_container").length&&jQuery("#frm_field_"+l+"_container").is(":visible")){h=!1;if(""===c){c="#frm_field_"+l+"_container";d=jQuery(a).find(c).offset().top;
29
  var m=jQuery("html").css("margin-top");d&&m&&(d-=parseInt(m));f=document.documentElement.scrollTop||document.body.scrollTop;d&&f>d&&jQuery(window).scrollTop(d-4)}jQuery(a).find("#frm_field_"+l+"_container #recaptcha_area").length&&(k=!0,Recaptcha.reload());jQuery(a).find("#frm_field_"+l+"_container").addClass("frm_blank_field");"function"==typeof frmThemeOverride_frmPlaceError?frmThemeOverride_frmPlaceError(l,e):jQuery(a).find("#frm_field_"+l+"_container").append('<div class="frm_error">'+e[l]+"</div>")}else if("redirect"==
30
  l){window.location=e[l];return}!0!==k&&jQuery(a).find("#recaptcha_area").replaceWith("");h&&a.submit()}},error:function(){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");a.submit()}})}
31
- function frmEditEntry(a,c,d,f,e,h){var k=jQuery("#frm_edit_"+a).text(),l=jQuery("#"+c+a).html();jQuery("#"+c+a).html('<span class="frm-loading-img" id="'+c+a+'"></span><div class="frm_orig_content" style="display:none">'+l+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:"action=frm_entries_edit_entry_ajax&post_id="+d+"&entry_id="+a+"&id="+f,success:function(l){jQuery("#"+c+a).children(".frm-loading-img").replaceWith(l);jQuery("#frm_edit_"+a).replaceWith('<span id="frm_edit_'+
32
- a+'"><a onclick="frmCancelEdit('+a+",'"+c+"','"+k+"',"+d+","+f+",'"+h+'\')" class="'+h+'">'+e+"</a></span>")}})}
33
- function frmCancelEdit(a,c,d,f,e,h){var k=jQuery("#frm_edit_"+a).text();jQuery("#frm_edit_"+a).find("a").hasClass("frm_ajax_edited")||(jQuery("#"+c+a).children(".frm_forms").replaceWith(""),jQuery("#"+c+a).children(".frm_orig_content").fadeIn("slow").removeClass("frm_orig_content"));jQuery("#frm_edit_"+a).replaceWith('<a id="frm_edit_'+a+'" class="frm_edit_link '+h+'" href="javascript:frmEditEntry('+a+",'"+c+"',"+f+","+e+",'"+k+"','"+h+"')\">"+d+"</a>")}
34
  function frmUpdateField(a,c,d,f,e){jQuery("#frm_update_field_"+a+"_"+c).html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:"action=frm_entries_update_field_ajax&entry_id="+a+"&field_id="+c+"&value="+d,success:function(){""===f.replace(/^\s+|\s+$/g,"")?jQuery("#frm_update_field_"+a+"_"+c+"_"+e).fadeOut("slow"):jQuery("#frm_update_field_"+a+"_"+c+"_"+e).replaceWith(f)}})}
35
  function frmDeleteEntry(a,c){jQuery("#frm_delete_"+a).replaceWith('<span class="frm-loading-img" id="frm_delete_'+a+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:"action=frm_entries_destroy&entry="+a,success:function(d){"success"==d.replace(/^\s+|\s+$/g,"")?jQuery("#"+c+a).fadeOut("slow"):jQuery("#frm_delete_"+a).replaceWith(d)}})}function frmRemoveDiv(){jQuery(this).parent(".frm_uploaded_files").fadeOut("slow").replaceWith("")}
36
  function frmNextUpload(a,c){a.wrap('<div class="frm_file_names frm_uploaded_files">');for(var d=a.get(0).files,f=0;f<d.length;f++)1==d.length?a.after(d[f].name+' <a href="#" onclick="frmClearFile(jQuery(this));return false;">'+frm_js.remove+"</a>"):a.after(d[f].name+"<br/>");a.hide();jQuery("#frm_field_"+c+"_container").append('<input name="file'+c+'[]" multiple="multiple" type="file" onchange="frmNextUpload(jQuery(this),'+c+')"/>')}
37
  function frmClearFile(a){a.parent(".frm_file_names").replaceWith("");return!1}function frm_resend_email(a,c){jQuery("#frm_resend_email").replaceWith('<img id="frm_resend_email" src="'+frm_js.images_url+'/wpspin_light.gif" alt="'+frm_js.loading+'" />');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:"action=frm_entries_send_email&entry_id="+a+"&form_id="+c+"&type=email",success:function(a){jQuery("#frm_resend_email").replaceWith(a)}})}
38
- function frmScrollMsg(a){(a=jQuery("#frm_form_"+a+"_container").offset())&&window.scrollTo(a.left,a.top-28)}jQuery.fn.frmVisible=function(){return this.css("visibility","visible")};jQuery.fn.frmInvisible=function(){return this.css("visibility","hidden")};jQuery.fn.frmVisibilityToggle=function(){return this.css("visibility",function(a,c){return"visible"==c?"hidden":"visible"})};
 
28
  e).find("a").addClass("frm_ajax_edited").click())}else{jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");jQuery(a).find(".frm_ajax_loading").css("visibility","hidden");h=!0;jQuery(".form-field").removeClass("frm_blank_field");jQuery(".form-field .frm_error").replaceWith("");c="";var k=!1,l;for(l in e)if(jQuery(a).find("#frm_field_"+l+"_container").length&&jQuery("#frm_field_"+l+"_container").is(":visible")){h=!1;if(""===c){c="#frm_field_"+l+"_container";d=jQuery(a).find(c).offset().top;
29
  var m=jQuery("html").css("margin-top");d&&m&&(d-=parseInt(m));f=document.documentElement.scrollTop||document.body.scrollTop;d&&f>d&&jQuery(window).scrollTop(d-4)}jQuery(a).find("#frm_field_"+l+"_container #recaptcha_area").length&&(k=!0,Recaptcha.reload());jQuery(a).find("#frm_field_"+l+"_container").addClass("frm_blank_field");"function"==typeof frmThemeOverride_frmPlaceError?frmThemeOverride_frmPlaceError(l,e):jQuery(a).find("#frm_field_"+l+"_container").append('<div class="frm_error">'+e[l]+"</div>")}else if("redirect"==
30
  l){window.location=e[l];return}!0!==k&&jQuery(a).find("#recaptcha_area").replaceWith("");h&&a.submit()}},error:function(){jQuery(a).find('input[type="submit"], input[type="button"]').removeAttr("disabled");a.submit()}})}
31
+ function frmEditEntry(a,c,d,f,e,h){var k=jQuery("#frm_edit_"+a).html(),l=jQuery("#"+c+a).html();jQuery("#"+c+a).html('<span class="frm-loading-img" id="'+c+a+'"></span><div class="frm_orig_content" style="display:none">'+l+"</div>");jQuery.ajax({type:"POST",url:frm_js.ajax_url,dataType:"html",data:"action=frm_entries_edit_entry_ajax&post_id="+d+"&entry_id="+a+"&id="+f,success:function(l){jQuery("#"+c+a).children(".frm-loading-img").replaceWith(l);jQuery("#frm_edit_"+a).replaceWith('<span id="frm_edit_'+
32
+ a+'"><a onclick="frmCancelEdit('+a+",'"+c+"','"+frm_escape_html(k)+"',"+d+","+f+",'"+h+'\')" class="'+h+'">'+e+"</a></span>")}})}
33
+ function frmCancelEdit(a,c,d,f,e,h){var k=jQuery("#frm_edit_"+a+" a").html();jQuery("#frm_edit_"+a).find("a").hasClass("frm_ajax_edited")||(jQuery("#"+c+a).children(".frm_forms").replaceWith(""),jQuery("#"+c+a).children(".frm_orig_content").fadeIn("slow").removeClass("frm_orig_content"));jQuery("#frm_edit_"+a).replaceWith('<a id="frm_edit_'+a+'" class="frm_edit_link '+h+'" href="javascript:frmEditEntry('+a+",'"+c+"',"+f+","+e+",'"+frm_escape_html(k)+"','"+h+"')\">"+d+"</a>")}
34
  function frmUpdateField(a,c,d,f,e){jQuery("#frm_update_field_"+a+"_"+c).html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:"action=frm_entries_update_field_ajax&entry_id="+a+"&field_id="+c+"&value="+d,success:function(){""===f.replace(/^\s+|\s+$/g,"")?jQuery("#frm_update_field_"+a+"_"+c+"_"+e).fadeOut("slow"):jQuery("#frm_update_field_"+a+"_"+c+"_"+e).replaceWith(f)}})}
35
  function frmDeleteEntry(a,c){jQuery("#frm_delete_"+a).replaceWith('<span class="frm-loading-img" id="frm_delete_'+a+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:"action=frm_entries_destroy&entry="+a,success:function(d){"success"==d.replace(/^\s+|\s+$/g,"")?jQuery("#"+c+a).fadeOut("slow"):jQuery("#frm_delete_"+a).replaceWith(d)}})}function frmRemoveDiv(){jQuery(this).parent(".frm_uploaded_files").fadeOut("slow").replaceWith("")}
36
  function frmNextUpload(a,c){a.wrap('<div class="frm_file_names frm_uploaded_files">');for(var d=a.get(0).files,f=0;f<d.length;f++)1==d.length?a.after(d[f].name+' <a href="#" onclick="frmClearFile(jQuery(this));return false;">'+frm_js.remove+"</a>"):a.after(d[f].name+"<br/>");a.hide();jQuery("#frm_field_"+c+"_container").append('<input name="file'+c+'[]" multiple="multiple" type="file" onchange="frmNextUpload(jQuery(this),'+c+')"/>')}
37
  function frmClearFile(a){a.parent(".frm_file_names").replaceWith("");return!1}function frm_resend_email(a,c){jQuery("#frm_resend_email").replaceWith('<img id="frm_resend_email" src="'+frm_js.images_url+'/wpspin_light.gif" alt="'+frm_js.loading+'" />');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:"action=frm_entries_send_email&entry_id="+a+"&form_id="+c+"&type=email",success:function(a){jQuery("#frm_resend_email").replaceWith(a)}})}
38
+ function frmScrollMsg(a){(a=jQuery("#frm_form_"+a+"_container").offset())&&window.scrollTo(a.left,a.top-28)}function frm_escape_html(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}jQuery.fn.frmVisible=function(){return this.css("visibility","visible")};jQuery.fn.frmInvisible=function(){return this.css("visibility","hidden")};
39
+ jQuery.fn.frmVisibilityToggle=function(){return this.css("visibility",function(a,c){return"visible"==c?"hidden":"visible"})};
js/formidable_admin.js CHANGED
@@ -82,7 +82,7 @@ if($('#frm_adv_info').length || $('.frm_field_list').length){
82
  }
83
  }
84
 
85
- $('.hide_dyncontent,#entry_select_container,#date_select_container').hide();
86
  frm_show_count($("input[name='show_count']:checked").val());
87
  frm_show_loc($('#insert_loc').val());
88
  }
@@ -180,6 +180,7 @@ $('.frm_reset_style').click(function(){
180
  }
181
  $('select[name="frm_theme_selector"]').val(errObj['theme_css']).change();
182
  $('#frm_submit_style, #frm_auto_width').prop('checked', false); //checkboxes
 
183
  $('#frm_fieldset').change();
184
  }
185
  });
@@ -815,10 +816,6 @@ function frmDisplayFormSelected(form_id){
815
  data:"action=frm_get_cd_tags_box&form_id="+form_id,
816
  success:function(html){ jQuery('#frm_adv_info .categorydiv').html(html);}
817
  });
818
- jQuery.ajax({type:"POST",url:ajaxurl,
819
- data:"action=frm_get_entry_select&form_id="+form_id,
820
- success:function(html){ jQuery('#entry_select_container').html(html);}
821
- });
822
  jQuery.ajax({type:"POST",url:ajaxurl,
823
  data:"action=frm_get_date_field_select&form_id="+form_id,
824
  success:function(html){ jQuery('#date_select_container').html(html);}
@@ -1026,9 +1023,9 @@ function frm_show_loc(val){
1026
 
1027
  function frm_show_count(value){
1028
  if(value=='dynamic' || value=='calendar'){ jQuery('.hide_dyncontent').show();}
1029
- else jQuery('.hide_dyncontent').hide();
1030
- if(value=='one'){jQuery('#entry_select_container').show();jQuery('.limit_container').hide();}
1031
- else{jQuery("#entry_select_container").hide();jQuery('.limit_container').show();}
1032
  if(value=='calendar'){jQuery('#date_select_container').show();jQuery('.limit_container').hide();}
1033
  else{jQuery('#date_select_container').hide();}
1034
  }
82
  }
83
  }
84
 
85
+ $('.hide_dyncontent,#date_select_container').hide();
86
  frm_show_count($("input[name='show_count']:checked").val());
87
  frm_show_loc($('#insert_loc').val());
88
  }
180
  }
181
  $('select[name="frm_theme_selector"]').val(errObj['theme_css']).change();
182
  $('#frm_submit_style, #frm_auto_width').prop('checked', false); //checkboxes
183
+ $('input.hex').validHex();
184
  $('#frm_fieldset').change();
185
  }
186
  });
816
  data:"action=frm_get_cd_tags_box&form_id="+form_id,
817
  success:function(html){ jQuery('#frm_adv_info .categorydiv').html(html);}
818
  });
 
 
 
 
819
  jQuery.ajax({type:"POST",url:ajaxurl,
820
  data:"action=frm_get_date_field_select&form_id="+form_id,
821
  success:function(html){ jQuery('#date_select_container').html(html);}
1023
 
1024
  function frm_show_count(value){
1025
  if(value=='dynamic' || value=='calendar'){ jQuery('.hide_dyncontent').show();}
1026
+ else{jQuery('.hide_dyncontent').hide();}
1027
+ if(value=='one'){jQuery('.limit_container').hide();}
1028
+ else{jQuery('.limit_container').show();}
1029
  if(value=='calendar'){jQuery('#date_select_container').show();jQuery('.limit_container').hide();}
1030
  else{jQuery('#date_select_container').hide();}
1031
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: sswells, srwells, jamie.wahlin
3
  Donate link: http://formidablepro.com/donate
4
  Tags: admin, AJAX, captcha, contact, contact form, database, email, feedback, form, forms, javascript, jquery, page, plugin, poll, Post, spam, survey, template, widget, wpmu, form builder
5
  Requires at least: 3.3
6
- Tested up to: 3.8
7
- Stable tag: 1.07.08
8
 
9
  Quickly and easily build forms with a simple drag-and-drop interface and in-place editing.
10
 
@@ -64,6 +64,15 @@ A. Try clearing your browser cache. As plugin modifications are made, frequent j
64
  [See more FAQs](http://formidablepro.com/formidable-faqs/ "Formidable Pro FAQs")
65
 
66
  == Changelog ==
 
 
 
 
 
 
 
 
 
67
  = 1.07.08 =
68
  * Check the words on the WordPress blacklist before submitting an entry
69
  * PRO: Added server dynamic default value for getting values from the PHP SERVER array like the current url
3
  Donate link: http://formidablepro.com/donate
4
  Tags: admin, AJAX, captcha, contact, contact form, database, email, feedback, form, forms, javascript, jquery, page, plugin, poll, Post, spam, survey, template, widget, wpmu, form builder
5
  Requires at least: 3.3
6
+ Tested up to: 3.9.1
7
+ Stable tag: 1.07.09
8
 
9
  Quickly and easily build forms with a simple drag-and-drop interface and in-place editing.
10
 
64
  [See more FAQs](http://formidablepro.com/formidable-faqs/ "Formidable Pro FAQs")
65
 
66
  == Changelog ==
67
+ = 1.07.09 =
68
+ * Added frm_bulk_field_choices hook for adding custom prepopulated options
69
+ * Cleanup styling on bulk option popup
70
+ * Fixed submission error affecting some sites
71
+ * PRO: Don't reload javascripts after ajax submit
72
+ * PRO: Improve no conflict styling mode
73
+ * PRO: Fixed cascading calculations
74
+ * PRO: Allow HTML for the label and cancel links in the edit link shortcodes
75
+
76
  = 1.07.08 =
77
  * Check the words on the WordPress blacklist before submitting an entry
78
  * PRO: Added server dynamic default value for getting values from the PHP SERVER array like the current url