PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
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 trunk, at classes/views/frm-form-actions/on_submit_settings.php

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