@@ -172,6 +172,9 @@ discard block |
||
| 172 | 172 | return $response; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | + /** |
|
| 176 | + * @param string $source_form_name |
|
| 177 | + */ |
|
| 175 | 178 | protected function prepare_new_form( $source_id, $source_form_name ) { |
| 176 | 179 | return array( |
| 177 | 180 | 'import_form_id' => $source_id, |
@@ -299,6 +302,7 @@ discard block |
||
| 299 | 302 | /** |
| 300 | 303 | * Replace the original combo field with a group. |
| 301 | 304 | * This switches the name field to individual fields. |
| 305 | + * @param integer $remove |
|
| 302 | 306 | */ |
| 303 | 307 | protected function insert_fields_in_array( $subs, $start, $remove, &$fields ) { |
| 304 | 308 | array_splice( $fields, $start, $remove, $subs ); |
@@ -467,6 +471,9 @@ discard block |
||
| 467 | 471 | return array(); |
| 468 | 472 | } |
| 469 | 473 | |
| 474 | + /** |
|
| 475 | + * @param string $type |
|
| 476 | + */ |
|
| 470 | 477 | private function is_unsupported_field( $type ) { |
| 471 | 478 | $fields = $this->unsupported_field_types(); |
| 472 | 479 | |
@@ -482,6 +489,9 @@ discard block |
||
| 482 | 489 | return array(); |
| 483 | 490 | } |
| 484 | 491 | |
| 492 | + /** |
|
| 493 | + * @param string $type |
|
| 494 | + */ |
|
| 485 | 495 | protected function should_skip_field( $type ) { |
| 486 | 496 | $skip_pro_fields = $this->skip_pro_fields(); |
| 487 | 497 | |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | |
| 340 | 340 | foreach ( $form['fields'] as $key => $new_field ) { |
| 341 | 341 | $new_field['form_id'] = $form_id; |
| 342 | - $form['fields'][ $key ]['id'] = FrmField::create( $new_field ); |
|
| 342 | + $form['fields'][$key]['id'] = FrmField::create( $new_field ); |
|
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | // create emails |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | if ( $key === 'post_title' ) { |
| 352 | 352 | $new_action->post_title = $value; |
| 353 | 353 | } else { |
| 354 | - $new_action->post_content[ $key ] = $this->replace_smart_tags( $value, $form['fields'] ); |
|
| 354 | + $new_action->post_content[$key] = $this->replace_smart_tags( $value, $form['fields'] ); |
|
| 355 | 355 | } |
| 356 | 356 | } |
| 357 | 357 | |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | |
| 404 | 404 | $imported = $this->get_tracked_import(); |
| 405 | 405 | |
| 406 | - $imported[ $this->slug ][ $new_form_id ] = $source_id; |
|
| 406 | + $imported[$this->slug][$new_form_id] = $source_id; |
|
| 407 | 407 | |
| 408 | 408 | update_option( $this->tracking, $imported, false ); |
| 409 | 409 | } |
@@ -423,11 +423,11 @@ discard block |
||
| 423 | 423 | private function is_imported( $source_id ) { |
| 424 | 424 | $imported = $this->get_tracked_import(); |
| 425 | 425 | $new_form_id = 0; |
| 426 | - if ( ! isset( $imported[ $this->slug ] ) || ! in_array( $source_id, $imported[ $this->slug ] ) ) { |
|
| 426 | + if ( ! isset( $imported[$this->slug] ) || ! in_array( $source_id, $imported[$this->slug] ) ) { |
|
| 427 | 427 | return $new_form_id; |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | - $new_form_id = array_search( $source_id, array_reverse( $imported[ $this->slug ], true ) ); |
|
| 430 | + $new_form_id = array_search( $source_id, array_reverse( $imported[$this->slug], true ) ); |
|
| 431 | 431 | if ( ! empty( $new_form_id ) && empty( FrmForm::get_key_by_id( $new_form_id ) ) ) { |
| 432 | 432 | // Allow reimport if the form was deleted. |
| 433 | 433 | $new_form_id = 0; |