PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.5.2
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.5.2
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / views / frm-form-actions / on_submit_settings.php

on_submit_settings.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.5.2, at classes/views/frm-form-actions/on_submit_settings.php

88 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * On Submit form action settings
4 *
5 * @package Formidable
6 * @since 6.0
7 *
8 * @var object $instance Form action post object.
9 * @var array $args Contains `form`, `action_key`, `values`.
10 * @var FrmFormAction $this FrmFormAction instance.
11 */
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 die( 'You are not allowed to call this page directly.' );
15 }
16
17 $success_action = $instance->post_content['success_action'];
18
19 $types = array(
20 'message' => array(
21 'label' => __( 'Show Message', 'formidable' ),
22 'icon' => 'frm_icon_font frm_chat_forms_icon frm_svg20',
23 'sub_settings' => array( 'FrmOnSubmitHelper', 'show_message_settings' ),
24 ),
25 'redirect' => array(
26 'label' => __( 'Redirect to URL', 'formidable' ),
27 'icon' => 'frm_icon_font frm_globe_icon frm_svg20',
28 'sub_settings' => array( 'FrmOnSubmitHelper', 'show_redirect_settings' ),
29 ),
30 'page' => array(
31 'label' => __( 'Show Page Content', 'formidable' ),
32 'icon' => 'frm_icon_font frm_file_text_icon frm_svg20',
33 'sub_settings' => array( 'FrmOnSubmitHelper', 'show_page_settings' ),
34 ),
35 );
36
37 $col_count = count( $types );
38 if ( $col_count <= 4 ) {
39 $col_class = 'frm' . ( 12 / $col_count );
40 } else {
41 $col_count = 'frm2';
42 }
43 ?>
44 <div class="frm_on_submit_type_setting">
45 <div class="frm_grid_container">
46 <?php
47 foreach ( $types as $type => $type_data ) :
48 $input_id = $this->get_field_id( 'success_action_' . $type );
49 ?>
50 <div class="frm_on_submit_type frm_form_field <?php echo esc_attr( $col_class ); ?>">
51 <input
52 type="radio"
53 id="<?php echo esc_attr( $input_id ); ?>"
54 name="<?php echo esc_attr( $this->get_field_name( 'success_action' ) ); ?>"
55 value="<?php echo esc_attr( $type ); ?>"
56 <?php checked( $type, $success_action ); ?>
57 />
58 <label for="<?php echo esc_attr( $input_id ); ?>">
59 <?php FrmAppHelper::icon_by_class( $type_data['icon'], array( 'echo' => true ) ); ?>
60 <?php echo esc_html( $type_data['label'] ); ?>
61 </label>
62 </div>
63 <?php endforeach; ?>
64 </div>
65 </div><!-- End .frm_on_submit_type_setting -->
66
67 <?php
68 $type_args = $args;
69 $type_args['form_action'] = $instance;
70 $type_args['action_control'] = $this;
71 foreach ( $types as $type_name => $type ) {
72 $css_class = 'frm_on_submit_' . esc_attr( $type_name ) . '_settings frm_on_submit_dependent_setting';
73 if ( $success_action !== $type_name ) {
74 $css_class .= ' frm_hidden';
75 }
76 ?>
77 <div class="<?php echo esc_attr( $css_class ); ?>" data-show-if-<?php echo esc_attr( $type_name ); ?>>
78 <?php
79 if ( is_callable( $type['sub_settings'] ) ) {
80 call_user_func( $type['sub_settings'], $type_args );
81 }
82 ?>
83 </div><!-- End .frm_on_submit_<?php echo esc_attr( $type_name ); ?>_settings -->
84 <?php
85 }
86
87 unset( $css_class, $type_args, $type_name, $type, $success_action );
88