Formidable Forms – Form Builder for WordPress - Version 3.04

Version Description

  • New: Add option to duplicate a form action
  • New: Add option to turn form actions on or off
  • New: Add frm_is_multiple_select hook
Download this release

Release Info

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

Code changes from version 3.03.03 to 3.04

classes/controllers/FrmFieldsController.php CHANGED
@@ -168,13 +168,15 @@ class FrmFieldsController {
168
 
169
  $copy_field = FrmField::getOne( $field_id );
170
  if ( ! $copy_field ) {
171
- wp_die();
172
  }
173
 
174
  do_action( 'frm_duplicate_field', $copy_field, $form_id );
175
  do_action( 'frm_duplicate_field_' . $copy_field->type, $copy_field, $form_id );
176
 
177
- $values = array();
 
 
178
  FrmFieldsHelper::fill_field( $values, $copy_field, $copy_field->form_id );
179
  $values = apply_filters( 'frm_prepare_single_field_for_duplication', $values );
180
 
168
 
169
  $copy_field = FrmField::getOne( $field_id );
170
  if ( ! $copy_field ) {
171
+ wp_die();
172
  }
173
 
174
  do_action( 'frm_duplicate_field', $copy_field, $form_id );
175
  do_action( 'frm_duplicate_field_' . $copy_field->type, $copy_field, $form_id );
176
 
177
+ $values = array(
178
+ 'id' => $copy_field->id,
179
+ );
180
  FrmFieldsHelper::fill_field( $values, $copy_field, $copy_field->form_id );
181
  $values = apply_filters( 'frm_prepare_single_field_for_duplication', $values );
182
 
classes/controllers/FrmFormActionsController.php CHANGED
@@ -112,7 +112,10 @@ class FrmFormActionsController {
112
  */
113
  do_action( 'frm_before_list_actions', $form );
114
 
115
- $form_actions = FrmFormAction::get_action_for_form( $form->id );
 
 
 
116
 
117
  $action_controls = self::get_form_actions();
118
 
@@ -300,7 +303,7 @@ class FrmFormActionsController {
300
  continue;
301
  }
302
 
303
- $child_entry = ( ( $form && is_numeric( $form->parent_form_id ) && $form->parent_form_id ) || ( $entry && ( $entry->form_id != $form->id || $entry->parent_item_id ) ) || ( isset( $args['is_child'] ) && $args['is_child'] ) );
304
 
305
  if ( $child_entry ) {
306
  // maybe trigger actions for sub forms
112
  */
113
  do_action( 'frm_before_list_actions', $form );
114
 
115
+ $filters = array(
116
+ 'post_status' => 'all',
117
+ );
118
+ $form_actions = FrmFormAction::get_action_for_form( $form->id, 'all', $filters );
119
 
120
  $action_controls = self::get_form_actions();
121
 
303
  continue;
304
  }
305
 
306
+ $child_entry = ( ( is_object( $form ) && is_numeric( $form->parent_form_id ) && $form->parent_form_id ) || ( $entry && ( $entry->form_id != $form->id || $entry->parent_item_id ) ) || ( isset( $args['is_child'] ) && $args['is_child'] ) );
307
 
308
  if ( $child_entry ) {
309
  // maybe trigger actions for sub forms
classes/helpers/FrmAppHelper.php CHANGED
@@ -11,7 +11,7 @@ class FrmAppHelper {
11
  /**
12
  * @since 2.0
13
  */
14
- public static $plug_version = '3.03.03';
15
 
16
  /**
17
  * @since 1.07.02
11
  /**
12
  * @since 2.0
13
  */
14
+ public static $plug_version = '3.04';
15
 
16
  /**
17
  * @since 1.07.02
classes/models/FrmField.php CHANGED
@@ -765,7 +765,8 @@ class FrmField {
765
  $field_type = self::get_field_type( $field );
766
  $data_type = self::get_option( $field, 'data_type' );
767
 
768
- return self::is_option_true( $field, 'multiple' ) && ( ( $field_type == 'select' || ( $field_type == 'data' && $data_type == 'select' ) ) );
 
769
  }
770
 
771
  /**
765
  $field_type = self::get_field_type( $field );
766
  $data_type = self::get_option( $field, 'data_type' );
767
 
768
+ $is_multiple = self::is_option_true( $field, 'multiple' ) && ( ( $field_type == 'select' || ( $field_type == 'data' && $data_type == 'select' ) ) );
769
+ return apply_filters( 'frm_is_multiple_select', $is_multiple, $field );
770
  }
771
 
772
  /**
classes/models/FrmFormAction.php CHANGED
@@ -289,20 +289,24 @@ class FrmFormAction {
289
  foreach ( $settings as $number => $new_instance ) {
290
  $this->_set( $number );
291
 
 
 
 
 
 
 
 
292
  if ( ! isset( $new_instance['post_title'] ) ) {
293
- // settings were never opened, so don't update
294
  $action_ids[] = $new_instance['ID'];
295
  $this->updated = true;
296
  continue;
297
  }
298
 
299
- $old_instance = isset( $all_instances[ $number ] ) ? $all_instances[ $number ] : array();
300
-
301
- $new_instance['post_type'] = FrmFormActionsController::$action_post_type;
302
  $new_instance['post_name'] = $this->form_id . '_' . $this->id_base . '_' . $this->number;
303
- $new_instance['menu_order'] = $this->form_id;
304
- $new_instance['post_status'] = 'publish';
305
- $new_instance['post_date'] = isset( $old_instance->post_date ) ? $old_instance->post_date : '';
306
 
307
  $instance = $this->update( $new_instance, $old_instance );
308
 
@@ -336,6 +340,23 @@ class FrmFormAction {
336
  return $action_ids;
337
  }
338
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
339
  public function save_settings( $settings ) {
340
  self::clear_cache();
341
  return FrmDb::save_settings( $settings, 'frm_actions' );
@@ -354,20 +375,23 @@ class FrmFormAction {
354
  return $this->get_all( $form_id, 1 );
355
  }
356
 
357
- public static function get_action_for_form( $form_id, $type = 'all', $limit = 99 ) {
358
  $action_controls = FrmFormActionsController::get_form_actions( $type );
359
  if ( empty( $action_controls ) ) {
360
  // don't continue if there are no available actions
361
  return array();
362
  }
363
 
364
- $limit = apply_filters( 'frm_form_action_limit', $limit, compact( 'type', 'form_id' ) );
 
 
365
 
366
  if ( 'all' != $type ) {
367
  return $action_controls->get_all( $form_id, $limit );
368
  }
369
 
370
  $args = self::action_args( $form_id, $limit );
 
371
  $actions = FrmDb::check_cache( serialize( $args ), 'frm_actions', $args, 'get_posts' );
372
 
373
  if ( ! $actions ) {
@@ -398,6 +422,23 @@ class FrmFormAction {
398
  return $settings;
399
  }
400
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  /**
402
  * @param int $action_id
403
  */
289
  foreach ( $settings as $number => $new_instance ) {
290
  $this->_set( $number );
291
 
292
+ $old_instance = isset( $all_instances[ $number ] ) ? $all_instances[ $number ] : array();
293
+
294
+ if ( ! isset( $new_instance['post_status'] ) ) {
295
+ $new_instance['post_status'] = 'draft';
296
+ }
297
+
298
+ // settings were never opened, so don't update
299
  if ( ! isset( $new_instance['post_title'] ) ) {
300
+ $this->maybe_update_status( $new_instance, $old_instance );
301
  $action_ids[] = $new_instance['ID'];
302
  $this->updated = true;
303
  continue;
304
  }
305
 
306
+ $new_instance['post_type'] = FrmFormActionsController::$action_post_type;
 
 
307
  $new_instance['post_name'] = $this->form_id . '_' . $this->id_base . '_' . $this->number;
308
+ $new_instance['menu_order'] = $this->form_id;
309
+ $new_instance['post_date'] = isset( $old_instance->post_date ) ? $old_instance->post_date : '';
 
310
 
311
  $instance = $this->update( $new_instance, $old_instance );
312
 
340
  return $action_ids;
341
  }
342
 
343
+ /**
344
+ * If the status of the action has changed, update it
345
+ *
346
+ * @since 3.04
347
+ */
348
+ protected function maybe_update_status( $new_instance, $old_instance ) {
349
+ if ( $new_instance['post_status'] !== $old_instance->post_status ) {
350
+ self::clear_cache();
351
+ wp_update_post(
352
+ array(
353
+ 'ID' => $new_instance['ID'],
354
+ 'post_status' => $new_instance['post_status'],
355
+ )
356
+ );
357
+ }
358
+ }
359
+
360
  public function save_settings( $settings ) {
361
  self::clear_cache();
362
  return FrmDb::save_settings( $settings, 'frm_actions' );
375
  return $this->get_all( $form_id, 1 );
376
  }
377
 
378
+ public static function get_action_for_form( $form_id, $type = 'all', $atts = array() ) {
379
  $action_controls = FrmFormActionsController::get_form_actions( $type );
380
  if ( empty( $action_controls ) ) {
381
  // don't continue if there are no available actions
382
  return array();
383
  }
384
 
385
+ self::prepare_get_action( $atts );
386
+
387
+ $limit = apply_filters( 'frm_form_action_limit', $atts['limit'], compact( 'type', 'form_id' ) );
388
 
389
  if ( 'all' != $type ) {
390
  return $action_controls->get_all( $form_id, $limit );
391
  }
392
 
393
  $args = self::action_args( $form_id, $limit );
394
+ $args['post_status'] = $atts['post_status'];
395
  $actions = FrmDb::check_cache( serialize( $args ), 'frm_actions', $args, 'get_posts' );
396
 
397
  if ( ! $actions ) {
422
  return $settings;
423
  }
424
 
425
+ /**
426
+ * @since 3.04
427
+ */
428
+ protected static function prepare_get_action( &$args ) {
429
+ if ( is_numeric( $args ) ) {
430
+ // for reverse compatibility. $limit was changed to $args
431
+ $args = array(
432
+ 'limit' => $args,
433
+ );
434
+ }
435
+ $defaults = array(
436
+ 'limit' => 99,
437
+ 'post_status' => 'publish',
438
+ );
439
+ $args = wp_parse_args( $args, $defaults );
440
+ }
441
+
442
  /**
443
  * @param int $action_id
444
  */
classes/views/frm-form-actions/form_action.php CHANGED
@@ -13,7 +13,16 @@ $form_action = apply_filters( 'frm_form_' . $form_action->post_excerpt . '_actio
13
  </button>
14
  </div>
15
  <span class="frm_email_icons alignright">
16
- <a href="javascript:void(0)" data-removeid="frm_form_action_<?php echo esc_attr( $action_key ) ?>" class="frm_icon_font frm_delete_icon frm_remove_form_action" data-frmverify="<?php echo esc_attr( 'Really?', 'formidable' ) ?>"> </a>
 
 
 
 
 
 
 
 
 
17
  </span>
18
  <div class="widget-title">
19
  <h4><span class="frm_form_action_icon <?php echo esc_attr( $action_control->action_options['classes'] ) ?>"></span>
13
  </button>
14
  </div>
15
  <span class="frm_email_icons alignright">
16
+ <?php if ( $action_control->action_options['limit'] > 2 ) { ?>
17
+ <a href="javascript:void(0)" class="frm_icon_font frm_duplicate_icon frm_duplicate_form_action" title="<?php esc_attr_e( 'Duplicate', 'formidable' ); ?>"> </a>
18
+ <?php } ?>
19
+ <a href="javascript:void(0)" data-removeid="frm_form_action_<?php echo esc_attr( $action_key ) ?>" class="frm_icon_font frm_delete_icon frm_remove_form_action" data-frmverify="<?php echo esc_attr( 'Really?', 'formidable' ) ?>" title="<?php esc_attr_e( 'Delete', 'formidable' ); ?>"> </a>
20
+
21
+ <label class="frm_toggle">
22
+ <input type="checkbox" value="publish" name="<?php echo esc_attr( $action_control->get_field_name( 'post_status', '' ) ); ?>" <?php checked( $form_action->post_status, 'publish' ); ?> />
23
+ <span class="frm_toggle_slider"></span>
24
+ <span class="frm_toggle_on">ON</span>
25
+ </label>
26
  </span>
27
  <div class="widget-title">
28
  <h4><span class="frm_form_action_icon <?php echo esc_attr( $action_control->action_options['classes'] ) ?>"></span>
css/frm_admin.css CHANGED
@@ -128,7 +128,7 @@ td.column-title .frm_actions_dropdown{
128
  color: #e37222;
129
  line-height: 1.4;
130
  font-weight: 600;
131
- margin: 1px 0 0 2px;
132
  padding: 1px 4px;
133
  vertical-align: top;
134
  -webkit-border-radius: 10px;
@@ -1472,6 +1472,72 @@ li.ui-state-default.selected .frm-show-click.frm_import_options select {
1472
  #form_settings_page .frm_posttax_row select{max-width:35%;}
1473
  select.frm_cancelnew, input.frm_enternew{width:175px;}
1474
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1475
 
1476
  /* Global Settings */
1477
  .categorydiv .frm_settings_form div.tabs-panel.general_settings{border-top:none;}
@@ -1653,9 +1719,6 @@ label.default-style-box input[type="checkbox"]{
1653
  .frm_actions_list a{
1654
  color:#A0A0A0;
1655
  }
1656
- .frm_actions_list a:hover{
1657
- color:#B7B7B7;
1658
- }
1659
 
1660
  .frm_actions_list a:active, .frm_actions_list a:focus{
1661
  outline: none;
@@ -1725,6 +1788,11 @@ label.frm_action_events{
1725
  .frm_email_icons{
1726
  padding-left:6px;
1727
  }
 
 
 
 
 
1728
  .frm_actions_list a.frm_inactive_action:before{
1729
  color:#d6d6d6;
1730
  cursor:not-allowed;
@@ -1843,7 +1911,7 @@ label.frm_action_events{
1843
  position: absolute;
1844
  padding: 5px 10px;
1845
  right: 10px;
1846
- bottom: 5px;
1847
  }
1848
  .frm_right_addon input {
1849
  padding-right: 30px;
@@ -1853,6 +1921,14 @@ label.frm_action_events{
1853
  color:#A0A0A0;
1854
  }
1855
 
 
 
 
 
 
 
 
 
1856
  .misc-pub-revisions.frm_icon_font,
1857
  .misc-pub-revisions.frm_icon_font:hover{
1858
  color:inherit;
128
  color: #e37222;
129
  line-height: 1.4;
130
  font-weight: 600;
131
+ margin: 1px 0 0 10px;
132
  padding: 1px 4px;
133
  vertical-align: top;
134
  -webkit-border-radius: 10px;
1472
  #form_settings_page .frm_posttax_row select{max-width:35%;}
1473
  select.frm_cancelnew, input.frm_enternew{width:175px;}
1474
 
1475
+ /* Admin toggle */
1476
+ .frm_toggle_on {
1477
+ display: none;
1478
+ color: #fff;
1479
+ z-index: 999;
1480
+ position: absolute;
1481
+ font-size: 9px;
1482
+ left: 4px;
1483
+ line-height: 18px;
1484
+ }
1485
+
1486
+ .frm_toggle {
1487
+ position: relative;
1488
+ display: inline-block;
1489
+ width: 34px;
1490
+ height: 18px;
1491
+ vertical-align: middle;
1492
+ margin-left: 5px;
1493
+ }
1494
+
1495
+ .frm_toggle input {
1496
+ display:none !important;
1497
+ }
1498
+
1499
+ .frm_toggle_slider {
1500
+ position: absolute;
1501
+ cursor: pointer;
1502
+ top: 0;
1503
+ left: 0;
1504
+ right: 0;
1505
+ bottom: 0;
1506
+ transition: .4s;
1507
+ border-radius: 30px;
1508
+ background-color: transparent;
1509
+ border: 2px solid #A0A0A0;
1510
+ }
1511
+
1512
+ .frm_toggle_slider:before {
1513
+ border-radius: 50%;
1514
+ position: absolute;
1515
+ content: "";
1516
+ height: 10px;
1517
+ width: 10px;
1518
+ left: 2px;
1519
+ top: 2px;
1520
+ transition: .3s;
1521
+ background-color: #A0A0A0;
1522
+ }
1523
+
1524
+ input:checked + .frm_toggle_slider {
1525
+ background-color: #82b4cb;
1526
+ border-color: #82b4cb;
1527
+ }
1528
+
1529
+ input:checked + .frm_toggle_slider:before {
1530
+ background-color: #fff;
1531
+ transform: translateX(16px);
1532
+ }
1533
+
1534
+ input:checked + .frm_toggle_slider + .frm_toggle_on{
1535
+ display:inline;
1536
+ }
1537
+
1538
+ input:focus + .frm_toggle_slider {
1539
+ box-shadow: 0 0 1px #008ec2;
1540
+ }
1541
 
1542
  /* Global Settings */
1543
  .categorydiv .frm_settings_form div.tabs-panel.general_settings{border-top:none;}
1719
  .frm_actions_list a{
1720
  color:#A0A0A0;
1721
  }
 
 
 
1722
 
1723
  .frm_actions_list a:active, .frm_actions_list a:focus{
1724
  outline: none;
1788
  .frm_email_icons{
1789
  padding-left:6px;
1790
  }
1791
+
1792
+ .frm_email_icons a {
1793
+ margin-left: 3px;
1794
+ }
1795
+
1796
  .frm_actions_list a.frm_inactive_action:before{
1797
  color:#d6d6d6;
1798
  cursor:not-allowed;
1911
  position: absolute;
1912
  padding: 5px 10px;
1913
  right: 10px;
1914
+ bottom: 0;
1915
  }
1916
  .frm_right_addon input {
1917
  padding-right: 30px;
1921
  color:#A0A0A0;
1922
  }
1923
 
1924
+ a.frm_icon_font:hover, a.frm_icon_font:active, a.frm_icon_font:focus {
1925
+ color: #82b4cb;
1926
+ }
1927
+
1928
+ .frm_confirming.frm_icon_font:before {
1929
+ content:'' !important;
1930
+ }
1931
+
1932
  .misc-pub-revisions.frm_icon_font,
1933
  .misc-pub-revisions.frm_icon_font:hover{
1934
  color:inherit;
formidable.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Formidable Forms
4
  Description: Quickly and easily create drag-and-drop forms
5
- Version: 3.03.03
6
  Plugin URI: https://formidableforms.com/
7
  Author URI: https://formidableforms.com/
8
  Author: Strategy11
2
  /*
3
  Plugin Name: Formidable Forms
4
  Description: Quickly and easily create drag-and-drop forms
5
+ Version: 3.04
6
  Plugin URI: https://formidableforms.com/
7
  Author URI: https://formidableforms.com/
8
  Author: Strategy11
js/formidable_admin.js CHANGED
@@ -131,7 +131,10 @@ function frmAdminBuildJS(){
131
  };
132
 
133
  var wrapClass = jQuery('.wrap, .frm_wrap');
134
- wrapClass.on('click', '.widget-top,a.widget-action', clickWidget);
 
 
 
135
 
136
  wrapClass.on('mouseenter.frm', '.frm_help', function(){
137
  jQuery(this).off('mouseenter.frm');
@@ -207,15 +210,22 @@ function frmAdminBuildJS(){
207
  return false;
208
  }
209
 
210
- function clickWidget(b){
211
  /*jshint validthis:true */
212
- if(typeof b.target !== 'undefined'){
 
213
  b = this;
214
  }
215
 
216
  popCalcFields(b);
217
 
218
  var cont = jQuery(b).closest('.frm_form_action_settings');
 
 
 
 
 
 
219
  if ( cont.length && cont.find('.form-table').length < 1 ) {
220
  var action_id = cont.find('input[name$="[ID]"]').val();
221
  var action_type = cont.find('input[name$="[post_excerpt]"]').val();
@@ -758,7 +768,7 @@ function frmAdminBuildJS(){
758
  * @returns {RegExp}
759
  */
760
  function getNonFormShortcodes() {
761
- return /\[(if\b|foreach|created-at|created-by|updated-at|updated-by)|((key|id)\])/;
762
  }
763
 
764
  function popCalcFields(v){
@@ -1224,7 +1234,7 @@ function frmAdminBuildJS(){
1224
  function clickSectionVis(e){
1225
  /*jshint validthis:true */
1226
  if(typeof jQuery(e.target).closest('.widget-top').attr('class') !== 'undefined'){
1227
- clickWidget(jQuery(e.target).closest('.widget-top'));
1228
  }
1229
 
1230
  // Do not stop propagation if opening TB_iframe
@@ -1755,7 +1765,48 @@ function frmAdminBuildJS(){
1755
  jQuery('.'+c+'_action_message_box.'+c+'_action_box').fadeIn('slow');
1756
  }
1757
  }
1758
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1759
  function addFormAction(){
1760
  /*jshint validthis:true */
1761
  var actionId = getNewActionId();
@@ -3030,10 +3081,6 @@ function frmAdminBuildJS(){
3030
 
3031
  loadTooltips();
3032
 
3033
- jQuery(document).on('click', 'a[data-frmverify]', confirmClick);
3034
-
3035
- jQuery(document.getElementById('wpbody')).on('click', '.frm_remove_tag, .frm_remove_form_action', removeThisTag);
3036
-
3037
  // used on build, form settings, and view settings
3038
  var $shortCodeDiv = jQuery(document.getElementById('frm_shortcodediv'));
3039
  if($shortCodeDiv.length > 0){
@@ -3191,6 +3238,7 @@ function frmAdminBuildJS(){
3191
  $formActions.on('click', '.frm_add_postmeta_row', addPostmetaRow);
3192
  $formActions.on('click', '.frm_add_posttax_row', addPosttaxRow);
3193
  $formActions.on('click', '.frm_toggle_cf_opts', toggleCfOpts);
 
3194
  jQuery('select[data-toggleclass], input[data-toggleclass]').change(toggleFormOpts);
3195
  jQuery('.frm_actions_list').on('click', '.frm_active_action', addFormAction);
3196
  initiateMultiselect();
131
  };
132
 
133
  var wrapClass = jQuery('.wrap, .frm_wrap');
134
+
135
+ wrapClass.on( 'click', '.frm_remove_tag, .frm_remove_form_action', removeThisTag );
136
+ wrapClass.on( 'click', 'a[data-frmverify]', confirmClick );
137
+ wrapClass.on( 'click', '.widget-top,a.widget-action', clickWidget );
138
 
139
  wrapClass.on('mouseenter.frm', '.frm_help', function(){
140
  jQuery(this).off('mouseenter.frm');
210
  return false;
211
  }
212
 
213
+ function clickWidget( event, b ) {
214
  /*jshint validthis:true */
215
+ var target = event.target;
216
+ if ( typeof b === 'undefined' ) {
217
  b = this;
218
  }
219
 
220
  popCalcFields(b);
221
 
222
  var cont = jQuery(b).closest('.frm_form_action_settings');
223
+ if ( cont.length && typeof target !== 'undefined' && ( target.parentElement.className.indexOf( 'frm_email_icons' ) > -1 || target.parentElement.className.indexOf( 'frm_toggle' ) > -1 ) ) {
224
+ // clicking on delete icon shouldn't open it
225
+ event.stopPropagation();
226
+ return;
227
+ }
228
+
229
  if ( cont.length && cont.find('.form-table').length < 1 ) {
230
  var action_id = cont.find('input[name$="[ID]"]').val();
231
  var action_type = cont.find('input[name$="[post_excerpt]"]').val();
768
  * @returns {RegExp}
769
  */
770
  function getNonFormShortcodes() {
771
+ return /\[id\]|\[key\]|\[if\s\w+\]|\[foreach\s\w+\]|\[created-at(\s*)?/g;
772
  }
773
 
774
  function popCalcFields(v){
1234
  function clickSectionVis(e){
1235
  /*jshint validthis:true */
1236
  if(typeof jQuery(e.target).closest('.widget-top').attr('class') !== 'undefined'){
1237
+ clickWidget( e, jQuery(e.target).closest('.widget-top') );
1238
  }
1239
 
1240
  // Do not stop propagation if opening TB_iframe
1765
  jQuery('.'+c+'_action_message_box.'+c+'_action_box').fadeIn('slow');
1766
  }
1767
  }
1768
+
1769
+ function copyFormAction() {
1770
+ /*jshint validthis:true */
1771
+ var action = jQuery(this).closest('.frm_form_action_settings').clone();
1772
+ var currentID = action.attr('id').replace( 'frm_form_action_', '' );
1773
+ var newID = newActionId( currentID );
1774
+ action.find('.frm_action_id, .frm-btn-group').remove();
1775
+ action.find('input[name$="[' + currentID + '][ID]"]').val('');
1776
+ action.find('.widget-inside').hide();
1777
+
1778
+ // the .html() gets original values, so they need to be set
1779
+ action.find('input[type=text], textarea, input[type=number]').prop('defaultValue', function() {
1780
+ return this.value;
1781
+ });
1782
+
1783
+ action.find('input[type=checkbox], input[type=radio]').prop('defaultChecked', function() {
1784
+ return this.checked;
1785
+ });
1786
+
1787
+ var rename = new RegExp( '\\[' + currentID + '\\]', 'g' );
1788
+ var reid = new RegExp( '_' + currentID + '"', 'g' );
1789
+ var reclass = new RegExp( '-' + currentID + '"', 'g' );
1790
+ var revalue = new RegExp( '"' + currentID + '"', 'g' ); // if a field id matches, this could cause trouble
1791
+
1792
+ var html = action.html().replace( rename, '[' + newID + ']' ).replace( reid, '_' + newID + '"' );
1793
+ html = html.replace( reclass, '-' + newID + '"' ).replace( revalue, '"' + newID + '"' );
1794
+ var div = '<div id="frm_form_action_' + newID + '" class="widget frm_form_action_settings frm_single_email_settings" data-actionkey="' + newID + '">';
1795
+
1796
+ jQuery('#frm_notification_settings').append( div + html + '</div>' );
1797
+ initiateMultiselect();
1798
+ }
1799
+
1800
+ function newActionId( currentID ) {
1801
+ var newID = parseInt( currentID ) + 11;
1802
+ var exists = document.getElementById( 'frm_form_action_' + newID );
1803
+ if ( exists !== null ) {
1804
+ newID++;
1805
+ newID = newActionId( newID );
1806
+ }
1807
+ return newID;
1808
+ }
1809
+
1810
  function addFormAction(){
1811
  /*jshint validthis:true */
1812
  var actionId = getNewActionId();
3081
 
3082
  loadTooltips();
3083
 
 
 
 
 
3084
  // used on build, form settings, and view settings
3085
  var $shortCodeDiv = jQuery(document.getElementById('frm_shortcodediv'));
3086
  if($shortCodeDiv.length > 0){
3238
  $formActions.on('click', '.frm_add_postmeta_row', addPostmetaRow);
3239
  $formActions.on('click', '.frm_add_posttax_row', addPosttaxRow);
3240
  $formActions.on('click', '.frm_toggle_cf_opts', toggleCfOpts);
3241
+ $formActions.on( 'click', '.frm_duplicate_form_action', copyFormAction );
3242
  jQuery('select[data-toggleclass], input[data-toggleclass]').change(toggleFormOpts);
3243
  jQuery('.frm_actions_list').on('click', '.frm_active_action', addFormAction);
3244
  initiateMultiselect();
languages/formidable.pot CHANGED
@@ -3,7 +3,7 @@ msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Formidable v2.05\n"
5
  "Report-Msgid-Bugs-To: \n"
6
- "POT-Creation-Date: 2018-09-12 16:44+0000\n"
7
  "POT-Revision-Date: Tue Sep 26 2017 16:06:46 GMT-0600 (MDT)\n"
8
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
9
  "Last-Translator: \n"
@@ -39,17 +39,17 @@ msgstr ""
39
  msgid "There are no plugins on your site that require a license"
40
  msgstr ""
41
 
42
- #: classes/controllers/FrmAppController.php:91
43
  msgid "Build"
44
  msgstr ""
45
 
46
- #: classes/controllers/FrmAppController.php:98
47
  #: classes/helpers/FrmFormsListHelper.php:336
48
  #: classes/views/frm-forms/settings.php:10
49
  msgid "Settings"
50
  msgstr ""
51
 
52
- #: classes/controllers/FrmAppController.php:105
53
  #: classes/controllers/FrmEntriesController.php:8
54
  #: classes/controllers/FrmEntriesController.php:8
55
  #: classes/controllers/FrmEntriesController.php:126
@@ -59,11 +59,11 @@ msgstr ""
59
  msgid "Entries"
60
  msgstr ""
61
 
62
- #: classes/controllers/FrmAppController.php:121
63
  msgid "Build a Form"
64
  msgstr ""
65
 
66
- #: classes/controllers/FrmAppController.php:154
67
  #, php-format
68
  msgid ""
69
  "This site has been previously authorized to run Formidable Forms. "
@@ -71,7 +71,7 @@ msgid ""
71
  "running the free version and remove this message."
72
  msgstr ""
73
 
74
- #: classes/controllers/FrmAppController.php:513
75
  #, php-format
76
  msgid ""
77
  "Help us spread the %1$sFormidable Forms%2$s love with %3$s %5$s on WordPress."
@@ -163,11 +163,11 @@ msgstr ""
163
  msgid "No entries were specified"
164
  msgstr ""
165
 
166
- #: classes/controllers/FrmFieldsController.php:302
167
  msgid "Other"
168
  msgstr ""
169
 
170
- #: classes/controllers/FrmFieldsController.php:305
171
  msgid "New Option"
172
  msgstr ""
173
 
@@ -176,7 +176,7 @@ msgstr ""
176
  msgid "Form Actions"
177
  msgstr ""
178
 
179
- #: classes/controllers/FrmFormActionsController.php:210
180
  #: classes/models/FrmEntryValidate.php:14 classes/models/FrmSettings.php:100
181
  msgid "You do not have permission to do that"
182
  msgstr ""
@@ -2185,7 +2185,8 @@ msgstr ""
2185
  msgid "Delete Permanently"
2186
  msgstr ""
2187
 
2188
- #: classes/helpers/FrmFormsHelper.php:835 classes/models/FrmFormAction.php:703
 
2189
  msgid "Delete"
2190
  msgstr ""
2191
 
@@ -2601,7 +2602,7 @@ msgid_plural "%1$s Forms"
2601
  msgstr[0] ""
2602
  msgstr[1] ""
2603
 
2604
- #: classes/helpers/FrmXMLHelper.php:853
2605
  #, php-format
2606
  msgid "%1$s Field"
2607
  msgid_plural "%1$s Fields"
@@ -2912,18 +2913,18 @@ msgstr ""
2912
  msgid "There are no options for this action."
2913
  msgstr ""
2914
 
2915
- #: classes/models/FrmFormAction.php:700
2916
  #: classes/views/frm-forms/_publish_box.php:30
2917
  msgid "Save Draft"
2918
  msgstr ""
2919
 
2920
- #: classes/models/FrmFormAction.php:701
2921
  #: classes/views/frm-forms/add_field_links.php:7
2922
  #: classes/views/frm-forms/form.php:61
2923
  msgid "Create"
2924
  msgstr ""
2925
 
2926
- #: classes/models/FrmFormAction.php:702
2927
  #: classes/views/frm-forms/_publish_box.php:34
2928
  #: classes/views/frm-forms/_publish_box.php:38
2929
  #: classes/views/frm-forms/add_field_links.php:7
@@ -2932,10 +2933,22 @@ msgstr ""
2932
  msgid "Update"
2933
  msgstr ""
2934
 
2935
- #: classes/models/FrmFormAction.php:704 classes/views/xml/import_form.php:10
2936
  msgid "Import"
2937
  msgstr ""
2938
 
 
 
 
 
 
 
 
 
 
 
 
 
2939
  #: classes/models/FrmMigrate.php:485
2940
  msgid "Sending"
2941
  msgstr ""
@@ -3297,6 +3310,10 @@ msgstr ""
3297
  msgid "Highrise"
3298
  msgstr ""
3299
 
 
 
 
 
3300
  #: classes/views/frm-forms/_publish_box.php:44
3301
  msgid "Preview"
3302
  msgstr ""
@@ -4418,23 +4435,23 @@ msgstr ""
4418
  msgid "Reset to Default"
4419
  msgstr ""
4420
 
4421
- #: classes/views/xml/import_form.php:12
4422
  msgid ""
4423
  "Upload your Formidable XML file to import forms into this site. If your "
4424
  "imported form key and creation date match a form on your site, that form "
4425
  "will be updated."
4426
  msgstr ""
4427
 
4428
- #: classes/views/xml/import_form.php:19
4429
  msgid "Choose a Formidable XML file"
4430
  msgstr ""
4431
 
4432
- #: classes/views/xml/import_form.php:20
4433
  #, php-format
4434
  msgid "Maximum size: %s"
4435
  msgstr ""
4436
 
4437
- #: classes/views/xml/import_form.php:28
4438
  msgid "Upload file and import"
4439
  msgstr ""
4440
 
3
  msgstr ""
4
  "Project-Id-Version: Formidable v2.05\n"
5
  "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2018-10-10 19:29+0000\n"
7
  "POT-Revision-Date: Tue Sep 26 2017 16:06:46 GMT-0600 (MDT)\n"
8
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
9
  "Last-Translator: \n"
39
  msgid "There are no plugins on your site that require a license"
40
  msgstr ""
41
 
42
+ #: classes/controllers/FrmAppController.php:83
43
  msgid "Build"
44
  msgstr ""
45
 
46
+ #: classes/controllers/FrmAppController.php:90
47
  #: classes/helpers/FrmFormsListHelper.php:336
48
  #: classes/views/frm-forms/settings.php:10
49
  msgid "Settings"
50
  msgstr ""
51
 
52
+ #: classes/controllers/FrmAppController.php:97
53
  #: classes/controllers/FrmEntriesController.php:8
54
  #: classes/controllers/FrmEntriesController.php:8
55
  #: classes/controllers/FrmEntriesController.php:126
59
  msgid "Entries"
60
  msgstr ""
61
 
62
+ #: classes/controllers/FrmAppController.php:113
63
  msgid "Build a Form"
64
  msgstr ""
65
 
66
+ #: classes/controllers/FrmAppController.php:146
67
  #, php-format
68
  msgid ""
69
  "This site has been previously authorized to run Formidable Forms. "
71
  "running the free version and remove this message."
72
  msgstr ""
73
 
74
+ #: classes/controllers/FrmAppController.php:505
75
  #, php-format
76
  msgid ""
77
  "Help us spread the %1$sFormidable Forms%2$s love with %3$s %5$s on WordPress."
163
  msgid "No entries were specified"
164
  msgstr ""
165
 
166
+ #: classes/controllers/FrmFieldsController.php:304
167
  msgid "Other"
168
  msgstr ""
169
 
170
+ #: classes/controllers/FrmFieldsController.php:307
171
  msgid "New Option"
172
  msgstr ""
173
 
176
  msgid "Form Actions"
177
  msgstr ""
178
 
179
+ #: classes/controllers/FrmFormActionsController.php:213
180
  #: classes/models/FrmEntryValidate.php:14 classes/models/FrmSettings.php:100
181
  msgid "You do not have permission to do that"
182
  msgstr ""
2185
  msgid "Delete Permanently"
2186
  msgstr ""
2187
 
2188
+ #: classes/helpers/FrmFormsHelper.php:835 classes/models/FrmFormAction.php:744
2189
+ #: classes/views/frm-form-actions/form_action.php:19
2190
  msgid "Delete"
2191
  msgstr ""
2192
 
2602
  msgstr[0] ""
2603
  msgstr[1] ""
2604
 
2605
+ #: classes/helpers/FrmXMLHelper.php:853 classes/models/FrmFormMigrator.php:388
2606
  #, php-format
2607
  msgid "%1$s Field"
2608
  msgid_plural "%1$s Fields"
2913
  msgid "There are no options for this action."
2914
  msgstr ""
2915
 
2916
+ #: classes/models/FrmFormAction.php:741
2917
  #: classes/views/frm-forms/_publish_box.php:30
2918
  msgid "Save Draft"
2919
  msgstr ""
2920
 
2921
+ #: classes/models/FrmFormAction.php:742
2922
  #: classes/views/frm-forms/add_field_links.php:7
2923
  #: classes/views/frm-forms/form.php:61
2924
  msgid "Create"
2925
  msgstr ""
2926
 
2927
+ #: classes/models/FrmFormAction.php:743
2928
  #: classes/views/frm-forms/_publish_box.php:34
2929
  #: classes/views/frm-forms/_publish_box.php:38
2930
  #: classes/views/frm-forms/add_field_links.php:7
2933
  msgid "Update"
2934
  msgstr ""
2935
 
2936
+ #: classes/models/FrmFormAction.php:745 classes/views/xml/import_form.php:9
2937
  msgid "Import"
2938
  msgstr ""
2939
 
2940
+ #: classes/models/FrmFormMigrator.php:137
2941
+ msgid "No form fields found."
2942
+ msgstr ""
2943
+
2944
+ #: classes/models/FrmFormMigrator.php:229
2945
+ msgid "There was an error while creating a new form."
2946
+ msgstr ""
2947
+
2948
+ #: classes/models/FrmFormMigrator.php:360
2949
+ msgid "Default Form"
2950
+ msgstr ""
2951
+
2952
  #: classes/models/FrmMigrate.php:485
2953
  msgid "Sending"
2954
  msgstr ""
3310
  msgid "Highrise"
3311
  msgstr ""
3312
 
3313
+ #: classes/views/frm-form-actions/form_action.php:17
3314
+ msgid "Duplicate"
3315
+ msgstr ""
3316
+
3317
  #: classes/views/frm-forms/_publish_box.php:44
3318
  msgid "Preview"
3319
  msgstr ""
4435
  msgid "Reset to Default"
4436
  msgstr ""
4437
 
4438
+ #: classes/views/xml/import_form.php:11
4439
  msgid ""
4440
  "Upload your Formidable XML file to import forms into this site. If your "
4441
  "imported form key and creation date match a form on your site, that form "
4442
  "will be updated."
4443
  msgstr ""
4444
 
4445
+ #: classes/views/xml/import_form.php:18
4446
  msgid "Choose a Formidable XML file"
4447
  msgstr ""
4448
 
4449
+ #: classes/views/xml/import_form.php:19
4450
  #, php-format
4451
  msgid "Maximum size: %s"
4452
  msgstr ""
4453
 
4454
+ #: classes/views/xml/import_form.php:27
4455
  msgid "Upload file and import"
4456
  msgstr ""
4457
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: contact form, form builder, custom form, forms, form, form maker, form cre
4
  Requires at least: 4.4
5
  Tested up to: 4.9.5
6
  Requires PHP: 5.3
7
- Stable tag: 3.03.03
8
 
9
  The best WordPress forms plugin for custom forms. Go beyond contact forms with a drag & drop form builder, HTML control & form style generator
10
 
@@ -160,6 +160,11 @@ The field and form names and descriptions are all changed with in-place edit. Ju
160
  [See more FAQs](https://formidableforms.com/formidable-faqs/ "Formidable Form FAQs")
161
 
162
  == Changelog ==
 
 
 
 
 
163
  = 3.03.03 =
164
  * Improve the appearance of the import/export page
165
  * Move the admin menu position below the post comments
4
  Requires at least: 4.4
5
  Tested up to: 4.9.5
6
  Requires PHP: 5.3
7
+ Stable tag: 3.04
8
 
9
  The best WordPress forms plugin for custom forms. Go beyond contact forms with a drag & drop form builder, HTML control & form style generator
10
 
160
  [See more FAQs](https://formidableforms.com/formidable-faqs/ "Formidable Form FAQs")
161
 
162
  == Changelog ==
163
+ = 3.04 =
164
+ * New: Add option to duplicate a form action
165
+ * New: Add option to turn form actions on or off
166
+ * New: Add frm_is_multiple_select hook
167
+
168
  = 3.03.03 =
169
  * Improve the appearance of the import/export page
170
  * Move the admin menu position below the post comments