| @@ -43,35 +43,33 @@ | ||
| 43 | 43 | * @return void |
| 44 | 44 | */ |
| 45 | 45 | public static function register_actions() { |
| 46 | 46 | $action_classes = array( |
| 47 | - 'on_submit' => 'FrmOnSubmitAction', | |
| 48 | - 'email' => 'FrmEmailAction', | |
| 49 | - 'wppost' => 'FrmDefPostAction', | |
| 50 | - 'register' => 'FrmDefRegAction', | |
| 51 | - 'paypal' => 'FrmDefPayPalAction', | |
| 52 | - 'payment' => 'FrmTransLiteAction', | |
| 53 | - 'quiz' => 'FrmDefQuizAction', | |
| 54 | - 'quiz_outcome' => 'FrmDefQuizOutcomeAction', | |
| 55 | - 'mailchimp' => 'FrmDefMlcmpAction', | |
| 56 | - 'api' => 'FrmDefApiAction', | |
| 57 | - 'salesforce' => 'FrmDefSalesforceAction', | |
| 58 | - 'activecampaign' => 'FrmDefActiveCampaignAction', | |
| 59 | - 'constantcontact' => 'FrmDefConstContactAction', | |
| 60 | - 'getresponse' => 'FrmDefGetResponseAction', | |
| 61 | - 'hubspot' => 'FrmDefHubspotAction', | |
| 62 | - 'zapier' => 'FrmDefZapierAction', | |
| 63 | - 'twilio' => 'FrmDefTwilioAction', | |
| 64 | - 'highrise' => 'FrmDefHighriseAction', | |
| 65 | - 'mailpoet' => 'FrmDefMailpoetAction', | |
| 66 | - 'aweber' => 'FrmDefAweberAction', | |
| 67 | - 'googlespreadsheet' => 'FrmDefGoogleSpreadsheetAction', | |
| 47 | + 'email' => 'FrmEmailAction', | |
| 48 | + 'wppost' => 'FrmDefPostAction', | |
| 49 | + 'register' => 'FrmDefRegAction', | |
| 50 | + 'paypal' => 'FrmDefPayPalAction', | |
| 51 | + 'payment' => 'FrmDefHrsAction', | |
| 52 | + 'quiz' => 'FrmDefQuizAction', | |
| 53 | + 'quiz_outcome' => 'FrmDefQuizOutcomeAction', | |
| 54 | + 'mailchimp' => 'FrmDefMlcmpAction', | |
| 55 | + 'api' => 'FrmDefApiAction', | |
| 56 | + 'salesforce' => 'FrmDefSalesforceAction', | |
| 57 | + 'activecampaign' => 'FrmDefActiveCampaignAction', | |
| 58 | + 'constantcontact' => 'FrmDefConstContactAction', | |
| 59 | + 'getresponse' => 'FrmDefGetResponseAction', | |
| 60 | + 'hubspot' => 'FrmDefHubspotAction', | |
| 61 | + 'zapier' => 'FrmDefZapierAction', | |
| 62 | + 'twilio' => 'FrmDefTwilioAction', | |
| 63 | + 'highrise' => 'FrmDefHighriseAction', | |
| 64 | + 'mailpoet' => 'FrmDefMailpoetAction', | |
| 65 | + 'aweber' => 'FrmDefAweberAction', | |
| 68 | 66 | ); |
| 69 | 67 | |
| 70 | 68 | $action_classes = apply_filters( 'frm_registered_form_actions', $action_classes ); |
| 71 | 69 | |
| 72 | - include_once FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/email_action.php'; | |
| 73 | - include_once FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/default_actions.php'; | |
| 70 | + include_once( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/email_action.php' ); | |
| 71 | + include_once( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/default_actions.php' ); | |
| 74 | 72 | |
| 75 | 73 | foreach ( $action_classes as $action_class ) { |
| 76 | 74 | self::$registered_actions->register( $action_class ); |
| 77 | 75 | } |
| @@ -90,9 +88,9 @@ | ||
| 90 | 88 | self::maybe_add_action_to_group( $action_controls, $groups ); |
| 91 | 89 | |
| 92 | 90 | $allowed = self::active_actions( $action_controls ); |
| 93 | 91 | |
| 94 | - include FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/settings.php'; | |
| 92 | + include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/settings.php' ); | |
| 95 | 93 | } |
| 96 | 94 | |
| 97 | 95 | /** |
| 98 | 96 | * Add unknown actions to a group. |
| @@ -132,9 +130,9 @@ | ||
| 132 | 130 | * @return array |
| 133 | 131 | */ |
| 134 | 132 | public static function form_action_groups() { |
| 135 | 133 | $groups = array( |
| 136 | - 'misc' => array( | |
| 134 | + 'misc' => array( | |
| 137 | 135 | 'name' => '', |
| 138 | 136 | 'icon' => 'frm_icon_font frm_shuffle_icon', |
| 139 | 137 | 'actions' => array( |
| 140 | 138 | 'email', |
| @@ -244,11 +242,11 @@ | ||
| 244 | 242 | } |
| 245 | 243 | |
| 246 | 244 | // HTML to include on the icon. |
| 247 | 245 | $icon_atts = array(); |
| 248 | - if ( $action_control->action_options['color'] !== 'var(--primary-700)' ) { | |
| 246 | + if ( $action_control->action_options['color'] !== 'var(--primary-hover)' ) { | |
| 249 | 247 | $icon_atts = array( |
| 250 | - 'style' => '--primary-700:' . $action_control->action_options['color'], | |
| 248 | + 'style' => '--primary-hover:' . $action_control->action_options['color'], | |
| 251 | 249 | ); |
| 252 | 250 | } |
| 253 | 251 | |
| 254 | 252 | include FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/_action_icon.php'; |
| @@ -318,9 +316,9 @@ | ||
| 318 | 316 | $action_control->_set( $action_key ); |
| 319 | 317 | |
| 320 | 318 | $use_logging = self::should_show_log_message( $form_action->post_excerpt ); |
| 321 | 319 | |
| 322 | - include FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/form_action.php'; | |
| 320 | + include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/form_action.php' ); | |
| 323 | 321 | } |
| 324 | 322 | |
| 325 | 323 | public static function add_form_action() { |
| 326 | 324 | FrmAppHelper::permission_check( 'frm_edit_forms' ); |
| @@ -341,9 +339,9 @@ | ||
| 341 | 339 | |
| 342 | 340 | $values = array(); |
| 343 | 341 | $form = self::fields_to_values( $form_id, $values ); |
| 344 | 342 | |
| 345 | - include FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/form_action.php'; | |
| 343 | + include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/form_action.php' ); | |
| 346 | 344 | wp_die(); |
| 347 | 345 | } |
| 348 | 346 | |
| 349 | 347 | public static function fill_action() { |
| @@ -364,9 +362,9 @@ | ||
| 364 | 362 | $form = self::fields_to_values( $form_action->menu_order, $values ); |
| 365 | 363 | |
| 366 | 364 | $use_logging = self::should_show_log_message( $action_type ); |
| 367 | 365 | |
| 368 | - include FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/_action_inside.php'; | |
| 366 | + include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/_action_inside.php' ); | |
| 369 | 367 | wp_die(); |
| 370 | 368 | } |
| 371 | 369 | |
| 372 | 370 | /** |
| @@ -440,10 +438,8 @@ | ||
| 440 | 438 | } |
| 441 | 439 | $old_actions = array_diff( $old_actions, $new_actions ); |
| 442 | 440 | |
| 443 | 441 | self::delete_missing_actions( $old_actions ); |
| 444 | - | |
| 445 | - FrmOnSubmitHelper::save_on_submit_settings( $form_id ); | |
| 446 | 442 | } |
| 447 | 443 | |
| 448 | 444 | public static function delete_missing_actions( $old_actions ) { |
| 449 | 445 | if ( ! empty( $old_actions ) ) { |
| @@ -470,9 +466,9 @@ | ||
| 470 | 466 | public static function trigger_actions( $event, $form, $entry, $type = 'all', $args = array() ) { |
| 471 | 467 | $action_status = array( |
| 472 | 468 | 'post_status' => 'publish', |
| 473 | 469 | ); |
| 474 | - $form_actions = FrmFormAction::get_action_for_form( ( is_object( $form ) ? $form->id : $form ), $type, $action_status ); | |
| 470 | + $form_actions = FrmFormAction::get_action_for_form( ( is_object( $form ) ? $form->id : $form ), $type, $action_status ); | |
| 475 | 471 | |
| 476 | 472 | if ( empty( $form_actions ) ) { |
| 477 | 473 | return; |
| 478 | 474 | } |
| @@ -486,9 +482,9 @@ | ||
| 486 | 482 | |
| 487 | 483 | $stored_actions = array(); |
| 488 | 484 | $action_priority = array(); |
| 489 | 485 | |
| 490 | - if ( in_array( $event, array( 'create', 'update' ), true ) && defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { | |
| 486 | + if ( in_array( $event, array( 'create', 'update' ) ) && defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { | |
| 491 | 487 | $this_event = 'import'; |
| 492 | 488 | } else { |
| 493 | 489 | $this_event = $event; |
| 494 | 490 | } |
| @@ -494,9 +490,9 @@ | ||
| 494 | 490 | } |
| 495 | 491 | |
| 496 | 492 | foreach ( $form_actions as $action ) { |
| 497 | 493 | |
| 498 | - $skip_this_action = ! in_array( $this_event, $action->post_content['event'], true ) || FrmOnSubmitAction::$slug === $action->post_excerpt; | |
| 494 | + $skip_this_action = ( ! in_array( $this_event, $action->post_content['event'] ) ); | |
| 499 | 495 | $skip_this_action = apply_filters( 'frm_skip_form_action', $skip_this_action, compact( 'action', 'entry', 'form', 'event' ) ); |
| 500 | 496 | if ( $skip_this_action ) { |
| 501 | 497 | continue; |
| 502 | 498 | } |
| @@ -504,9 +500,9 @@ | ||
| 504 | 500 | if ( ! is_object( $entry ) ) { |
| 505 | 501 | $entry = FrmEntry::getOne( $entry, true ); |
| 506 | 502 | } |
| 507 | 503 | |
| 508 | - if ( empty( $entry ) || ( FrmEntriesHelper::DRAFT_ENTRY_STATUS === (int) $entry->is_draft && 'draft' !== $event ) ) { | |
| 504 | + if ( empty( $entry ) || ( $entry->is_draft && $event != 'draft' ) ) { | |
| 509 | 505 | continue; |
| 510 | 506 | } |
| 511 | 507 | |
| 512 | 508 | $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'] ) ); |
| @@ -543,9 +539,9 @@ | ||
| 543 | 539 | do_action( 'frm_trigger_' . $action->post_excerpt . '_action', $action, $entry, $form, $event ); |
| 544 | 540 | do_action( 'frm_trigger_' . $action->post_excerpt . '_' . $event . '_action', $action, $entry, $form ); |
| 545 | 541 | |
| 546 | 542 | // If post is created, get updated $entry object. |
| 547 | - if ( $action->post_excerpt === 'wppost' && $event === 'create' ) { | |
| 543 | + if ( $action->post_excerpt == 'wppost' && $event == 'create' ) { | |
| 548 | 544 | $entry = FrmEntry::getOne( $entry->id, true ); |
| 549 | 545 | } |
| 550 | 546 | } |
| 551 | 547 | } |
| @@ -551,9 +547,9 @@ | ||
| 551 | 547 | } |
| 552 | 548 | } |
| 553 | 549 | |
| 554 | 550 | public static function duplicate_form_actions( $form_id, $values, $args = array() ) { |
| 555 | - if ( empty( $args['old_id'] ) ) { | |
| 551 | + if ( ! isset( $args['old_id'] ) || empty( $args['old_id'] ) ) { | |
| 556 | 552 | // Continue if we know which actions to copy. |
| 557 | 553 | return; |
| 558 | 554 | } |
| 559 | 555 | |