| @@ -2,8 +2,9 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * On Submit form action |
| 4 | 4 | * |
| 5 | 5 | * @package Formidable |
| 6 | + * | |
| 6 | 7 | * @since 6.0 |
| 7 | 8 | */ |
| 8 | 9 | |
| 9 | 10 | if ( ! defined( 'ABSPATH' ) ) { |
| @@ -11,19 +12,22 @@ | ||
| 11 | 12 | } |
| 12 | 13 | |
| 13 | 14 | class FrmOnSubmitAction extends FrmFormAction { |
| 14 | 15 | |
| 16 | + /** | |
| 17 | + * @var string | |
| 18 | + */ | |
| 15 | 19 | public static $slug = 'on_submit'; |
| 16 | 20 | |
| 17 | 21 | public function __construct() { |
| 18 | 22 | $action_ops = array( |
| 19 | - 'classes' => 'frm_icon_font frm_checkmark_icon', | |
| 20 | - 'active' => true, | |
| 21 | - 'event' => array( 'create' ), | |
| 22 | - 'limit' => 99, | |
| 23 | - 'priority' => 9, | |
| 24 | - 'color' => 'rgb(66, 193, 178)', | |
| 25 | - 'keywords' => __( 'redirect, success, confirmation, submit', 'formidable' ), | |
| 23 | + 'classes' => 'frmfont frm_checkmark_circle_icon', | |
| 24 | + 'active' => true, | |
| 25 | + 'event' => array( 'create' ), | |
| 26 | + 'limit' => 99, | |
| 27 | + 'priority' => 9, | |
| 28 | + 'color' => '#42C1B2', | |
| 29 | + 'keywords' => __( 'redirect, success, confirmation, submit', 'formidable' ), | |
| 26 | 30 | ); |
| 27 | 31 | $action_ops = apply_filters( 'frm_' . self::$slug . '_control_settings', $action_ops ); |
| 28 | 32 | |
| 29 | 33 | $this->maybe_save_edit_trigger( $action_ops ); |
| @@ -38,22 +42,30 @@ | ||
| 38 | 42 | return __( 'Confirmation', 'formidable' ); |
| 39 | 43 | } |
| 40 | 44 | |
| 41 | 45 | /** |
| 42 | - * @return void | |
| 46 | + * @param object $instance | |
| 47 | + * @param array $args | |
| 43 | 48 | */ |
| 44 | 49 | public function form( $instance, $args = array() ) { |
| 45 | 50 | include FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/on_submit_settings.php'; |
| 46 | 51 | } |
| 47 | 52 | |
| 53 | + /** | |
| 54 | + * @return array | |
| 55 | + */ | |
| 48 | 56 | public function get_defaults() { |
| 49 | 57 | return array( |
| 50 | - 'success_action' => FrmOnSubmitHelper::get_default_action_type(), | |
| 51 | - 'success_msg' => FrmOnSubmitHelper::get_default_msg(), | |
| 52 | - 'show_form' => '', | |
| 53 | - 'success_url' => '', | |
| 54 | - 'success_page_id' => '', | |
| 55 | - 'open_in_new_tab' => '', | |
| 58 | + 'success_action' => FrmOnSubmitHelper::get_default_action_type(), | |
| 59 | + 'success_msg' => FrmOnSubmitHelper::get_default_msg(), | |
| 60 | + 'show_form' => '', | |
| 61 | + 'success_url' => '', | |
| 62 | + 'success_page_id' => '', | |
| 63 | + 'open_in_new_tab' => '', | |
| 64 | + 'redirect_delay' => '', | |
| 65 | + // Value in second. | |
| 66 | + 'redirect_delay_time' => 8, | |
| 67 | + 'redirect_delay_msg' => FrmOnSubmitHelper::get_default_redirect_msg(), | |
| 56 | 68 | ); |
| 57 | 69 | } |
| 58 | 70 | |
| 59 | 71 | /** |
| @@ -60,10 +72,10 @@ | ||
| 60 | 72 | * This function should check that $new_instance is set correctly. |
| 61 | 73 | * The newly calculated value of $instance should be returned. |
| 62 | 74 | * If "false" is returned, the instance won't be saved/updated. |
| 63 | 75 | * |
| 64 | - * @param array $new_instance New settings for this instance as input by the user via form() | |
| 65 | - * @param array $old_instance Old settings for this instance | |
| 76 | + * @param array $new_instance New settings for this instance as input by the user via form(). | |
| 77 | + * @param array $old_instance Old settings for this instance. | |
| 66 | 78 | * |
| 67 | 79 | * @return array Settings to save or bool false to cancel saving |
| 68 | 80 | */ |
| 69 | 81 | public function update( $new_instance, $old_instance ) { |