Commit c7cb0518 authored by Kevin Stover's avatar Kevin Stover

Merge branch 'develop'

parents d7afc5c3 1bcc4071
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration, Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration,
Requires at least: 4.5 Requires at least: 4.5
Tested up to: 4.7 Tested up to: 4.7
Stable tag: 3.0.20 Stable tag: 3.0.21
License: GPLv2 or later License: GPLv2 or later
With a simple drag and drop interface you can create contact forms, email subscription forms, order forms, payment forms, and any other type of form for your WordPress site. With a simple drag and drop interface you can create contact forms, email subscription forms, order forms, payment forms, and any other type of form for your WordPress site.
......
...@@ -758,6 +758,12 @@ All styles used within the drawer ...@@ -758,6 +758,12 @@ All styles used within the drawer
content: "\f147"; content: "\f147";
font: 400 30px/1 dashicons; } font: 400 30px/1 dashicons; }
.ninja-forms-app .jBox-wrapper.import-options {
padding: 12px 20px 0px !important; }
.ninja-forms-app .jBox-wrapper.import-options.jBox-pointerPosition-top.jBox-closeButton-box:before {
right: 10px; }
.ninja-forms-app .nf-list-options { .ninja-forms-app .nf-list-options {
padding-bottom: 20px; } padding-bottom: 20px; }
.ninja-forms-app .nf-list-options .nf-add-new { .ninja-forms-app .nf-list-options .nf-add-new {
...@@ -802,6 +808,18 @@ All styles used within the drawer ...@@ -802,6 +808,18 @@ All styles used within the drawer
color: #999; color: #999;
margin-top: 10px; } margin-top: 10px; }
.ninja-forms-app .options {
position: relative; }
.ninja-forms-app .options legend .nf-open-import-tooltip {
background: #EBEDEE;
color: #1EA9EA;
font-size: 16px;
padding: 6px 15px;
text-decoration: none;
position: absolute;
right: 15px;
top: 0; }
.nf-drawer-buttons { .nf-drawer-buttons {
display: none; display: none;
margin: 0 -20px; margin: 0 -20px;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -111,6 +111,9 @@ define( [], function() { ...@@ -111,6 +111,9 @@ define( [], function() {
var name = model.get( 'name' ); var name = model.get( 'name' );
var value = dataModel.get( name ); var value = dataModel.get( name );
if( ! value ) return;
var rubble = value.split( ':' ); var rubble = value.split( ':' );
if( 'addField' != rubble[0] ) return; if( 'addField' != rubble[0] ) return;
......
...@@ -136,7 +136,7 @@ define( [], function() { ...@@ -136,7 +136,7 @@ define( [], function() {
} }
for( var setting in settings ){ for( var setting in settings ){
if( null === settings[ setting ] || '' == settings[ setting ] ) { if( null === settings[ setting ] || '' === settings[ setting ] ) {
delete settings[setting]; delete settings[setting];
} }
} }
......
...@@ -11,7 +11,7 @@ define( [ 'models/app/optionRepeaterCollection' ], function( ListOptionCollectio ...@@ -11,7 +11,7 @@ define( [ 'models/app/optionRepeaterCollection' ], function( ListOptionCollectio
initialize: function() { initialize: function() {
this.listenTo( nfRadio.channel( 'option-repeater-option-label' ), 'update:option', this.updateOptionLabel ); this.listenTo( nfRadio.channel( 'option-repeater-option-label' ), 'update:option', this.updateOptionLabel );
this.listenTo( nfRadio.channel( 'option-repeater-option-value' ), 'update:option', this.updateOptionValue ); this.listenTo( nfRadio.channel( 'option-repeater-option-value' ), 'update:option', this.updateOptionValue );
/* /*
* When we init our model, convert our options from an array of objects to a collection of models. * When we init our model, convert our options from an array of objects to a collection of models.
*/ */
......
define( ['views/app/drawer/optionRepeaterOption', 'views/app/drawer/optionRepeaterEmpty', 'models/app/optionRepeaterCollection'], function( listOptionView, listEmptyView, listOptionCollection ) { define( ['views/app/drawer/optionRepeaterOption', 'views/app/drawer/optionRepeaterEmpty', 'models/app/optionRepeaterCollection'], function( listOptionView, listEmptyView, listOptionCollection ) {
var view = Marionette.CompositeView.extend( { var view = Marionette.CompositeView.extend( {
template: '#tmpl-nf-edit-setting-wrap', template: '#tmpl-nf-edit-setting-option-repeater-wrap',
childView: listOptionView, childView: listOptionView,
emptyView: listEmptyView, emptyView: listEmptyView,
reorderOnSort: false, reorderOnSort: false,
...@@ -79,6 +79,34 @@ define( ['views/app/drawer/optionRepeaterOption', 'views/app/drawer/optionRepeat ...@@ -79,6 +79,34 @@ define( ['views/app/drawer/optionRepeaterOption', 'views/app/drawer/optionRepeat
* Send out a radio message. * Send out a radio message.
*/ */
nfRadio.channel( 'setting-' + this.model.get( 'name' ) ).trigger( 'render:setting', this.model, this.dataModel, this ); nfRadio.channel( 'setting-' + this.model.get( 'name' ) ).trigger( 'render:setting', this.model, this.dataModel, this );
},
onAttach: function() {
var importLink = jQuery( this.el ).find( '.nf-open-import-tooltip' );
var jBox = jQuery( importLink ).jBox( 'Tooltip', {
title: '<h3>Please enter your options below:</h3>',
content: jQuery( this.el ).find( '.nf-import-options' ),
trigger: 'click',
closeOnClick: 'body',
closeButton: 'box',
offset: { x: 20, y: 0 },
addClass: 'import-options',
onOpen: function() {
var that = this;
setTimeout( function() { jQuery( that.content ).find( 'textarea' ).focus(); }, 200 );
}
} );
jQuery( this.el ).find( '.nf-import' ).on( 'click', { view: this, jBox: jBox }, this.clickImport );
/*
* Send out a radio message.
*/
nfRadio.channel( 'setting-' + this.model.get( 'name' ) ).trigger( 'attach:setting', this.model, this.dataModel, this );
nfRadio.channel( 'setting-type-' + this.model.get( 'type' ) ).trigger( 'attach:setting', this.model, this.dataModel, this );
}, },
templateHelpers: function () { templateHelpers: function () {
...@@ -149,13 +177,76 @@ define( ['views/app/drawer/optionRepeaterOption', 'views/app/drawer/optionRepeat ...@@ -149,13 +177,76 @@ define( ['views/app/drawer/optionRepeaterOption', 'views/app/drawer/optionRepeat
}, },
events: { events: {
'click .nf-add-new': 'clickAddOption' 'click .nf-add-new': 'clickAddOption',
'click .extra': 'clickExtra'
}, },
clickAddOption: function( e ) { clickAddOption: function( e ) {
nfRadio.channel( 'option-repeater' ).trigger( 'click:addOption', this.collection, this.dataModel ); nfRadio.channel( 'option-repeater' ).trigger( 'click:addOption', this.collection, this.dataModel );
jQuery( this.children.findByIndex(this.children.length - 1).el ).find( '[data-id="label"]' ).focus(); jQuery( this.children.findByIndex(this.children.length - 1).el ).find( '[data-id="label"]' ).focus();
} },
clickExtra: function( e ) {
nfRadio.channel( 'option-repeater' ).trigger( 'click:extra', e, this.collection, this.dataModel );
nfRadio.channel( 'option-repeater-' + this.model.get( 'name' ) ).trigger( 'click:extra', e, this.model, this.collection, this.dataModel );
},
clickImport: function( e ) {
var textarea = jQuery( e.data.jBox.content ).find( 'textarea' );
var value = textarea.val().trimLeft().trimRight();
/*
* Return early if we have no strings.
*/
if ( 0 == value.length ) {
e.data.jBox.close();
return false;
}
/*
* Split our value based on new lines.
*/
var lines = value.split(/\n/);
if ( _.isArray( lines ) ) {
/*
* Loop over
*/
_.each( lines, function( line ) {
var row = line.split( ',' );
var label = row[0];
var value = row[1] || jQuery.slugify( label, { separator: '-' } );
var calc = row[2] || '';
label = label.trimLeft().trimRight();
value = value.trimLeft().trimRight();
calc = calc.trimLeft().trimRight();
/*
* Add our row to the collection
*/
var model = e.data.view.collection.add( { label: row[0], value: value, calc: calc } );
// Add our field addition to our change log.
var label = {
object: 'field',
label: row[0],
change: 'Option Added',
dashicon: 'plus-alt'
};
nfRadio.channel( 'changes' ).request( 'register:change', 'addListOption', model, null, label );
nfRadio.channel( 'option-repeater-' + e.data.view.model.get( 'name' ) ).trigger( 'add:option', model );
nfRadio.channel( 'option-repeater' ).trigger( 'add:option', model );
nfRadio.channel( 'app' ).trigger( 'update:setting', model );
}, this );
/*
* Set our state to unclean so that the user can publish.
*/
} else {
/*
* TODO: Error Handling Here
*/
}
textarea.val( '' );
e.data.jBox.close();
},
} ); } );
return view; return view;
......
define( [], function() {
var view = Marionette.ItemView.extend({
tagName: 'div',
template: '#tmpl-nf-import-options',
initialize: function() {
this.listenTo( nfRadio.channel( 'setting-type-options' ), 'click:extra', this.maybeOpenImport );
},
onAttach: function() {
console.log( jQuery( this.el ).parent().parent() );
},
renderImportButton: function() {
},
onBeforeDestroy: function() {
// this.model.off( 'change:addSavedLoading', this.render );
},
events: {
'click .nf-button': 'clickImportOptions'
},
clickImportOptions: function( e ) {
nfRadio.channel( 'drawer' ).trigger( 'click:ImportOptions', e, this.model );
},
maybeOpenImport: function( e, settingModel, DataModel, settingView ) {
console.log( e );
}
});
return view;
} );
...@@ -55,7 +55,7 @@ define( [], function() { ...@@ -55,7 +55,7 @@ define( [], function() {
opacity: 0.95, opacity: 0.95,
grid: [ 5, 5 ], grid: [ 5, 5 ],
// scroll: false, // scroll: false,
appendTo: '#nf-builder', appendTo: '#nf-main',
scrollSensitivity: 10, scrollSensitivity: 10,
receive: function( e, ui ) { receive: function( e, ui ) {
......
...@@ -332,6 +332,7 @@ define(['models/calcCollection'], function( CalcCollection ) { ...@@ -332,6 +332,7 @@ define(['models/calcCollection'], function( CalcCollection ) {
changeCalc: function( calcModel, targetCalcModel ) { changeCalc: function( calcModel, targetCalcModel ) {
var eqValues = this.replaceAllKeys( calcModel ); var eqValues = this.replaceAllKeys( calcModel );
eqValues = eqValues.replace( '[', '' ).replace( ']', '' );
calcModel.set( 'value', math.eval( eqValues ) ); calcModel.set( 'value', math.eval( eqValues ) );
} }
}); });
......
define([], function() { define([], function() {
var controller = Marionette.Object.extend( { var controller = Marionette.Object.extend( {
initialize: function() { initialize: function() {
this.listenTo( nfRadio.channel( 'listselect' ), 'init:model', this.register );
this.listenTo( nfRadio.channel( 'liststate' ), 'init:model', this.register ); this.listenTo( nfRadio.channel( 'fields' ), 'init:model', function( model ){
this.listenTo( nfRadio.channel( 'listcountry' ), 'init:model', this.register ); if( 'list' == model.get( 'parentType' ) ) this.register( model );
this.listenTo( nfRadio.channel( 'listmultiselect' ), 'init:model', this.register ); }, this );
nfRadio.channel( 'listselect' ).reply( 'get:calcValue', this.getCalcValue, this ); nfRadio.channel( 'listselect' ).reply( 'get:calcValue', this.getCalcValue, this );
nfRadio.channel( 'listmultiselect' ).reply( 'get:calcValue', this.getCalcValue, this ); nfRadio.channel( 'listmultiselect' ).reply( 'get:calcValue', this.getCalcValue, this );
}, },
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -106,6 +106,12 @@ ...@@ -106,6 +106,12 @@
} }
} }
.ninja-forms-app { .ninja-forms-app {
.jBox-wrapper.import-options {
padding: 12px 20px 0px !important;
}
.jBox-wrapper.import-options.jBox-pointerPosition-top.jBox-closeButton-box:before {
right: 10px;
}
.nf-list-options { .nf-list-options {
padding-bottom: 20px; padding-bottom: 20px;
.nf-add-new { .nf-add-new {
...@@ -178,6 +184,21 @@ ...@@ -178,6 +184,21 @@
} }
} }
} }
.options {
position: relative;
legend {
.nf-open-import-tooltip {
background: #EBEDEE;
color: $cta_color;
font-size: 16px;
padding: 6px 15px;
text-decoration: none;
position: absolute;
right: 15px;
top: 0;
}
}
}
} }
.nf-drawer-buttons { .nf-drawer-buttons {
display: none; display: none;
......
...@@ -17,7 +17,6 @@ function ninja_forms_register_field_recaptcha() { ...@@ -17,7 +17,6 @@ function ninja_forms_register_field_recaptcha() {
'edit_custom_class' => false, 'edit_custom_class' => false,
'edit_help' => false, 'edit_help' => false,
'edit_meta' => false, 'edit_meta' => false,
'sidebar' => 'template_fields',
'edit_conditional' => true, 'edit_conditional' => true,
'conditional' => array( 'conditional' => array(
'action' => array( 'action' => array(
...@@ -51,15 +50,22 @@ function ninja_forms_field_recaptcha_display( $field_id, $data, $form_id = '' ) ...@@ -51,15 +50,22 @@ function ninja_forms_field_recaptcha_display( $field_id, $data, $form_id = '' )
$lang = $settings['recaptcha_lang']; $lang = $settings['recaptcha_lang'];
$siteKey = $settings['recaptcha_site_key']; $siteKey = $settings['recaptcha_site_key'];
$field_class = ninja_forms_get_field_class( $field_id, $form_id ); $field_class = ninja_forms_get_field_class( $field_id, $form_id );
$rand = wp_rand(0, 99999);
wp_enqueue_script(
'g-recaptcha',
'https://www.google.com/recaptcha/api.js?onload=ninja_forms_grecaptcha_explicit_render&render=explicit&hl='.$lang,
['ninja-forms-display'] );
if ( !empty( $siteKey ) ) { ?> if ( !empty( $siteKey ) ) { ?>
<input id="ninja_forms_field_<?php echo $field_id;?>" name="ninja_forms_field_<?php echo $field_id;?>" type="hidden" class="<?php echo $field_class;?>" value="" rel="<?php echo $field_id;?>" /> <input id="ninja_forms_field_<?php echo $rand;?>" name="ninja_forms_field_<?php echo
<div class="g-recaptcha" data-callback="nf_recaptcha_set_field_value" data-sitekey="<?php echo $siteKey; ?>"></div> $field_id;?>" type="hidden" class="<?php echo $field_class;?>" value="" rel="<?php echo $field_id;?>"
<script type="text/javascript" src="https://www.google.com/recaptcha/api.js?hl=<?php echo $lang; ?>"> </script> />
<div class="g-recaptcha" data-callback="nf_recaptcha_set_field_value"
data-sitekey="<?php echo $siteKey; ?>"></div>
<script type="text/javascript"> <script type="text/javascript">
function nf_recaptcha_set_field_value(inpval){ function nf_recaptcha_set_field_value(inpval){
jQuery("#ninja_forms_field_<?php echo $field_id;?>").val(inpval) jQuery("#ninja_forms_field_<?php echo $rand;?>").val(inpval);
} }
</script> </script>
<?php <?php
} }
} }
......
...@@ -999,3 +999,11 @@ function ninja_forms_var_operator(op) { ...@@ -999,3 +999,11 @@ function ninja_forms_var_operator(op) {
} }
} }
} }
function ninja_forms_grecaptcha_explicit_render(){
jQuery('.g-recaptcha').each(function(){
grecaptcha.render(this, {
'sitekey':jQuery(this).data('sitekey')
});
});
}
\ No newline at end of file
...@@ -265,7 +265,7 @@ class Ninja_Forms { ...@@ -265,7 +265,7 @@ class Ninja_Forms {
// Plugin version // Plugin version
if ( ! defined( 'NF_PLUGIN_VERSION' ) ) if ( ! defined( 'NF_PLUGIN_VERSION' ) )
define( 'NF_PLUGIN_VERSION', '3.0.20' ); define( 'NF_PLUGIN_VERSION', '3.0.21' );
// Plugin Folder Path // Plugin Folder Path
if ( ! defined( 'NF_PLUGIN_DIR' ) ) if ( ! defined( 'NF_PLUGIN_DIR' ) )
......
...@@ -270,7 +270,7 @@ class NF_AJAX_Controllers_Submission extends NF_Abstracts_Controller ...@@ -270,7 +270,7 @@ class NF_AJAX_Controllers_Submission extends NF_Abstracts_Controller
if( ! method_exists( $action_class, 'process' ) ) continue; if( ! method_exists( $action_class, 'process' ) ) continue;
if( $data = $action_class->process($action[ 'settings' ], $this->_form_id, $this->_data ) ){ if( $data = $action_class->process($action[ 'settings' ], $this->_form_id, $this->_data ) ){
$this->_data = $data; $this->_data = apply_filters( 'ninja_forms_post_run_action_type_' . $action[ 'settings' ][ 'type' ], $data );
} }
// $this->_data[ 'actions' ][ $type ][] = $action; // $this->_data[ 'actions' ][ $type ][] = $action;
......
...@@ -47,6 +47,8 @@ abstract class NF_Abstracts_MergeTags ...@@ -47,6 +47,8 @@ abstract class NF_Abstracts_MergeTags
foreach( $this->merge_tags as $merge_tag ){ foreach( $this->merge_tags as $merge_tag ){
if( ! in_array( $merge_tag[ 'tag' ], $matches[0] ) ) continue; if( ! in_array( $merge_tag[ 'tag' ], $matches[0] ) ) continue;
if( ! isset($merge_tag[ 'callback' ])) continue;
$replace = ( is_callable( array( $this, $merge_tag[ 'callback' ] ) ) ) ? $this->{$merge_tag[ 'callback' ]}() : ''; $replace = ( is_callable( array( $this, $merge_tag[ 'callback' ] ) ) ) ? $this->{$merge_tag[ 'callback' ]}() : '';
$subject = str_replace( $merge_tag[ 'tag' ], $replace, $subject ); $subject = str_replace( $merge_tag[ 'tag' ], $replace, $subject );
......
...@@ -220,18 +220,38 @@ class NF_Abstracts_Model ...@@ -220,18 +220,38 @@ class NF_Abstracts_Model
// If the ID is not set, then we cannot pull settings from the Database. // If the ID is not set, then we cannot pull settings from the Database.
if( ! $this->_id ) return $this->_settings; if( ! $this->_id ) return $this->_settings;
$form_cache = get_option( 'nf_form_' . $this->_parent_id ); if( ! $this->_settings && 'field' == $this->_type ) {
if( $form_cache ){ global $wpdb;
$results = $wpdb->get_results(
"
SELECT Meta.key, Meta.value
FROM $this->_table_name as Object
JOIN $this->_meta_table_name as Meta
ON Object.id = Meta.parent_id
WHERE Object.id = '$this->_id'
"
, ARRAY_A );
foreach( $results as $result ) {
$key = $result[ 'key' ];
$this->_settings[ $key ] = $result[ 'value' ];
}
}
if( ! $this->_settings ) {
$form_cache = get_option('nf_form_' . $this->_parent_id);
if ($form_cache) {
if( 'field'== $this->_type ) { if ('field' == $this->_type) {
if (isset($form_cache[ 'fields' ])) { if (isset($form_cache['fields'])) {
foreach ($form_cache[ 'fields' ] as $object) { foreach ($form_cache['fields'] as $object) {
if ($this->_id != $object[ 'id' ]) continue; if ($this->_id != $object['id']) continue;
$this->update_settings($object['settings']); $this->update_settings($object['settings']);
break; break;
}
} }
} }
} }
......
...@@ -273,6 +273,7 @@ class NF_Abstracts_ModelFactory ...@@ -273,6 +273,7 @@ class NF_Abstracts_ModelFactory
$actions = $model_shell->find($form_id, $where); $actions = $model_shell->find($form_id, $where);
foreach ($actions as $action) { foreach ($actions as $action) {
$action->get_setting( 'type' ); // Pre-load the type of action for usort()
$this->_actions[$action->get_id()] = $action; $this->_actions[$action->get_id()] = $action;
} }
} }
......
...@@ -47,6 +47,8 @@ final class NF_Actions_Email extends NF_Abstracts_Action ...@@ -47,6 +47,8 @@ final class NF_Actions_Email extends NF_Abstracts_Action
public function process( $action_settings, $form_id, $data ) public function process( $action_settings, $form_id, $data )
{ {
$errors = $this->check_for_errors( $action_settings );
$headers = $this->_get_headers( $action_settings ); $headers = $this->_get_headers( $action_settings );
$attachments = $this->_get_attachments( $action_settings, $data ); $attachments = $this->_get_attachments( $action_settings, $data );
...@@ -59,22 +61,48 @@ final class NF_Actions_Email extends NF_Abstracts_Action ...@@ -59,22 +61,48 @@ final class NF_Actions_Email extends NF_Abstracts_Action
$message = apply_filters( 'ninja_forms_action_email_message', $message, $data, $action_settings ); $message = apply_filters( 'ninja_forms_action_email_message', $message, $data, $action_settings );
$sent = wp_mail( try {
$action_settings['to'], $sent = wp_mail($action_settings['to'], $action_settings['email_subject'], $message, $headers, $attachments);
$action_settings['email_subject'], } catch ( Exception $e ){
$message, $sent = false;
$headers, $errors[ 'email_sent' ] = $e->getMessage();
$attachments }
);
$data[ 'actions' ][ 'email' ][ 'to' ] = $action_settings['to']; $data[ 'actions' ][ 'email' ][ 'to' ] = $action_settings['to'];
$data[ 'actions' ][ 'email' ][ 'sent' ] = $sent; $data[ 'actions' ][ 'email' ][ 'sent' ] = $sent;
$data[ 'actions' ][ 'email' ][ 'headers' ] = $headers; $data[ 'actions' ][ 'email' ][ 'headers' ] = $headers;
$data[ 'actions' ][ 'email' ][ 'attachments' ] = $attachments; $data[ 'actions' ][ 'email' ][ 'attachments' ] = $attachments;
if( $errors ){
$data[ 'errors' ][ 'form' ] = $errors;
}
return $data; return $data;
} }
protected function check_for_errors( $action_settings )
{
$errors = array();
$email_address_settings = array( 'to', 'from_address', 'reply_to', 'cc', 'bcc' );
foreach( $email_address_settings as $setting ){
if( ! isset( $action_settings[ $setting ] ) ) continue;
if( ! $action_settings[ $setting ] ) continue;
$email_addresses = is_array( $action_settings[ $setting ] ) ? $action_settings[ $setting ] : explode( ',', $action_settings[ $setting ] );
foreach( (array) $email_addresses as $email ){
$email = trim( $email );
if( ! is_email( $email ) ) {
$errors[ 'email_' . $email ] = sprintf( __( 'Your email action "%s" has an invalid value for the "TO" setting. Please check this setting and try again.', 'ninja-forms'), $action_settings[ 'label' ] );
}
}
}
return $errors;
}
private function _get_headers( $settings ) private function _get_headers( $settings )
{ {
$headers = array(); $headers = array();
......
...@@ -79,17 +79,13 @@ class NF_Admin_CPT_DownloadAllSubmissions extends NF_Step_Processing { ...@@ -79,17 +79,13 @@ class NF_Admin_CPT_DownloadAllSubmissions extends NF_Step_Processing {
$myfile = fopen( $file_path, 'a' ) or die( 'Unable to open file!' ); $myfile = fopen( $file_path, 'a' ) or die( 'Unable to open file!' );
$x = 0; $x = 0;
$export = ''; $export = '';
foreach ( $subs_results as $sub ) {
$sub_export = NF_Database_Models_Submission::export( $this->args['form_id'], array( $sub->ID ), TRUE ); $sub_ids = array();
if ( $x > 0 || $this->step > 1 ) { foreach( $subs_results as $result ){
$sub_export = substr( $sub_export, strpos( $sub_export, "\n" ) + 1 ); $sub_ids[] = $result->ID;
}
if ( ! in_array( $sub->ID, $exported_subs ) ) {
$export .= $sub_export;
$exported_subs[] = $sub->ID;
}
$x++;
} }
$export .= NF_Database_Models_Submission::export( $this->args['form_id'], $sub_ids, TRUE );
fwrite( $myfile, $export ); fwrite( $myfile, $export );
fclose( $myfile ); fclose( $myfile );
} }
......
...@@ -115,14 +115,13 @@ class NF_Admin_CPT_Submission ...@@ -115,14 +115,13 @@ class NF_Admin_CPT_Submission
public function post_row_actions( $actions, $sub ) public function post_row_actions( $actions, $sub )
{ {