| @@ -2,9 +2,8 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * On Submit form action |
| 4 | 4 | * |
| 5 | 5 | * @package Formidable |
| 6 | - * | |
| 7 | 6 | * @since 6.0 |
| 8 | 7 | */ |
| 9 | 8 | |
| 10 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
| @@ -12,22 +11,19 @@ | ||
| 12 | 11 | } |
| 13 | 12 | |
| 14 | 13 | class FrmOnSubmitAction extends FrmFormAction { |
| 15 | 14 | |
| 16 | - /** | |
| 17 | - * @var string | |
| 18 | - */ | |
| 19 | 15 | public static $slug = 'on_submit'; |
| 20 | 16 | |
| 21 | 17 | public function __construct() { |
| 22 | 18 | $action_ops = array( |
| 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' ), | |
| 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' ), | |
| 30 | 26 | ); |
| 31 | 27 | $action_ops = apply_filters( 'frm_' . self::$slug . '_control_settings', $action_ops ); |
| 32 | 28 | |
| 33 | 29 | $this->maybe_save_edit_trigger( $action_ops ); |
| @@ -34,59 +30,24 @@ | ||
| 34 | 30 | |
| 35 | 31 | parent::__construct( self::$slug, self::get_name(), $action_ops ); |
| 36 | 32 | } |
| 37 | 33 | |
| 38 | - /** | |
| 39 | - * @return string | |
| 40 | - */ | |
| 41 | 34 | public static function get_name() { |
| 42 | 35 | return __( 'Confirmation', 'formidable' ); |
| 43 | 36 | } |
| 44 | 37 | |
| 45 | - /** | |
| 46 | - * @param object $instance | |
| 47 | - * @param array $args | |
| 48 | - */ | |
| 49 | 38 | public function form( $instance, $args = array() ) { |
| 50 | 39 | include FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/on_submit_settings.php'; |
| 51 | 40 | } |
| 52 | 41 | |
| 53 | - /** | |
| 54 | - * @return array | |
| 55 | - */ | |
| 56 | 42 | public function get_defaults() { |
| 57 | 43 | return array( |
| 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(), | |
| 44 | + 'success_action' => FrmOnSubmitHelper::get_default_action_type(), | |
| 45 | + 'success_msg' => FrmOnSubmitHelper::get_default_msg(), | |
| 46 | + 'show_form' => '', | |
| 47 | + 'success_url' => '', | |
| 48 | + 'success_page_id' => '', | |
| 68 | 49 | ); |
| 69 | - } | |
| 70 | - | |
| 71 | - /** | |
| 72 | - * This function should check that $new_instance is set correctly. | |
| 73 | - * The newly calculated value of $instance should be returned. | |
| 74 | - * If "false" is returned, the instance won't be saved/updated. | |
| 75 | - * | |
| 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. | |
| 78 | - * | |
| 79 | - * @return array Settings to save or bool false to cancel saving | |
| 80 | - */ | |
| 81 | - public function update( $new_instance, $old_instance ) { | |
| 82 | - if ( 'redirect' === $new_instance['post_content']['success_action'] && ! empty( $new_instance['post_content']['success_url'] ) ) { | |
| 83 | - $new_instance['post_content']['success_url'] = FrmFormsHelper::maybe_add_sanitize_url_attr( | |
| 84 | - $new_instance['post_content']['success_url'], | |
| 85 | - (int) $new_instance['menu_order'] | |
| 86 | - ); | |
| 87 | - } | |
| 88 | - return $new_instance; | |
| 89 | 50 | } |
| 90 | 51 | |
| 91 | 52 | /** |
| 92 | 53 | * Add a workaround in case Pro hasn't been updated. We don't want to |