PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.32.1
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.32.1
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 / _action_inside.php

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

161 lines 6.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( 'You are not allowed to call this page directly.' );
4 }
5 ?>
6
7 <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'post_excerpt', '' ) ); ?>" class="frm_action_name" value="<?php echo esc_attr( $form_action->post_excerpt ); ?>" />
8 <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'ID', '' ) ); ?>" value="<?php echo esc_attr( $form_action->ID ); ?>" />
9
10 <?php
11 /**
12 * @since 6.25
13 *
14 * @param WP_Post $form_action
15 */
16 do_action( 'frm_action_settings_before_action_name', $form_action );
17 ?>
18
19 <div class="frm_grid_container">
20 <p class="frm6 frm_form_field">
21 <label for="<?php echo esc_attr( $action_control->get_field_id( 'action_post_title' ) ); ?>">
22 <?php esc_html_e( 'Action Name', 'formidable' ); ?>
23 <span <?php FrmAppHelper::maybe_add_tooltip( 'action_title' ); ?>><?php FrmAppHelper::icon_by_class( 'frmfont frm_tooltip_icon frm_svg14' ); ?></span>
24 </label>
25 <input type="text" name="<?php echo esc_attr( $action_control->get_field_name( 'post_title', '' ) ); ?>" value="<?php echo esc_attr( $form_action->post_title ); ?>" class="large-text" id="<?php echo esc_attr( $action_control->get_field_id( 'action_post_title' ) ); ?>" />
26 </p>
27 <?php
28
29 if ( ! isset( $action_control->action_options['event'] ) ) {
30 $action_control->action_options['event'] = 'create';
31 }
32
33 if ( ! is_array( $action_control->action_options['event'] ) ) {
34 $action_control->action_options['event'] = explode( ',', $action_control->action_options['event'] );
35 }
36
37 if ( count( $action_control->action_options['event'] ) === 1 || $action_control->action_options['force_event'] ) {
38 foreach ( $action_control->action_options['event'] as $e ) {
39 ?>
40 <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'event' ) ); ?>[]" value="<?php echo esc_attr( $e ); ?>" />
41 <?php
42 }
43 } else {
44 ?>
45 <p class="frm6 frm_form_field">
46 <label for="<?php echo esc_attr( $action_control->get_field_id( 'event' ) ); ?>">
47 <?php esc_html_e( 'Trigger this action when', 'formidable' ); ?>
48 </label>
49 <select name="<?php echo esc_attr( $action_control->get_field_name( 'event' ) ); ?>[]" multiple="multiple" class="frm_multiselect" id="<?php echo esc_attr( $action_control->get_field_id( 'event' ) ); ?>">
50 <?php
51
52 $event_labels = FrmFormAction::trigger_labels();
53
54 foreach ( $action_control->action_options['event'] as $event ) {
55 ?>
56 <option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'], true ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( $event_labels[ $event ] ?? $event ); ?></option>
57 <?php } ?>
58 </select>
59 </p>
60 <?php
61 }//end if
62
63 ?>
64 </div>
65 <?php
66 $pass_args = array(
67 'form' => $form,
68 'action_control' => $action_control,
69 'action_key' => $action_key,
70 'values' => $values,
71 );
72
73 /**
74 * Fires before form action settings.
75 *
76 * @since 6.10
77 *
78 * @param object $form_action Form action object.
79 * @param array $pass_args Pass args.
80 */
81 do_action( 'frm_before_action_settings', $form_action, $pass_args );
82
83 $action_control->form( $form_action, compact( 'form', 'action_key', 'values' ) );
84
85 do_action( 'frm_additional_action_settings', $form_action, $pass_args );
86
87 // Show Conditional logic indicator.
88 if ( ! FrmAppHelper::pro_is_installed() ) {
89 if ( 'email' === $form_action->post_excerpt ) {
90 ?>
91 <h3>
92 <a href="javascript:void(0)" class="frm_show_upgrade frm_noallow" data-upgrade="<?php esc_attr_e( 'Email attachments', 'formidable' ); ?>" data-message="<?php esc_attr_e( 'Email a CSV or a PDF of each new entry, or attach a file of your choice.', 'formidable' ); ?>" data-medium="email-attachment">
93 <?php esc_html_e( 'Attachment', 'formidable' ); ?>
94 </a>
95 </h3>
96 <?php
97 }
98
99 $action_control->render_conditional_logic_call_to_action( $action_key );
100 }
101
102 // Show Form Action Automation indicator.
103 if ( ! function_exists( 'load_frm_autoresponder' ) && in_array( $form_action->post_excerpt, apply_filters( 'frm_autoresponder_allowed_actions', array( 'email', 'twilio', 'api', 'register' ) ), true ) ) {
104 $upgrading = FrmAddonsController::install_link( 'autoresponder' );
105 $params = array(
106 'class' => 'frm-h-stack-xs frm-bt-200 frm-py-md frm-mb-xs frm_show_upgrade',
107 'data-upgrade' => __( 'Form action automations', 'formidable' ),
108 'data-medium' => 'action-automation',
109 );
110
111 if ( isset( $upgrading['url'] ) ) {
112 $params['data-oneclick'] = json_encode( $upgrading );
113 } else {
114 $params['data-requires'] = FrmFormsHelper::get_plan_required( $upgrading );
115 }
116 ?>
117 <div <?php FrmAppHelper::array_to_html_params( $params, true ); ?>>
118 <?php
119 FrmHtmlHelper::toggle(
120 'frm_autoresponder_cta_' . $action_key,
121 'frm_autoresponder_cta_' . $action_key,
122 array(
123 'div_class' => 'with_frm_style frm_toggle',
124 'checked' => false,
125 'echo' => true,
126 'disabled' => true,
127 )
128 );
129 ?>
130 <label for="frm_autoresponder_cta_<?php echo esc_attr( $action_key ); ?>" class="frm_noallow">
131 <?php esc_html_e( 'Setup Automation', 'formidable' ); ?>
132 </label>
133 </div>
134 <?php
135 unset( $params );
136 }//end if
137
138 // Show link to install logs.
139 if ( $use_logging ) {
140 $upgrading = FrmAddonsController::install_link( 'logs' );
141
142 if ( isset( $upgrading['url'] ) ) {
143 ?>
144 <p>
145 <a href="javascript:void(0)" class="frm_show_upgrade frm-h-stack-xs" data-upgrade="<?php esc_attr_e( 'Form action logs', 'formidable' ); ?>" data-medium="action-logs" data-oneclick="<?php echo esc_attr( json_encode( $upgrading ) ); ?>">
146 <?php FrmAppHelper::icon_by_class( 'frmfont frm_tooltip_solid_icon', array( 'aria-hidden' => 'true' ) ); ?>
147 <?php esc_html_e( 'Install logging to get more information on API requests.', 'formidable' ); ?>
148 </a>
149 </p>
150 <?php
151 }
152 }
153 ?>
154 <span class="alignright frm_action_id frm-sub-label <?php echo esc_attr( ! empty( $form_action->ID ) ? '' : 'frm_hidden' ); ?>">
155 <?php
156 /* translators: %1$s: The ID of the form action. */
157 printf( esc_html__( 'Action ID: %1$s', 'formidable' ), esc_attr( $form_action->ID ) );
158 ?>
159 </span>
160 <div style="clear:both;"></div>
161