| 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 |
<div class="frm_grid_container frm_no_p_margin"> |
| 11 |
<p class="frm6 frm_form_field"> |
| 12 |
<label for="<?php echo esc_attr( $action_control->get_field_id( 'action_post_title' ) ); ?>" <?php FrmAppHelper::maybe_add_tooltip( 'action_title' ); ?>> |
| 13 |
<?php esc_html_e( 'Action Name', 'formidable' ); ?> |
| 14 |
</label> |
| 15 |
<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 <?php FrmAppHelper::maybe_add_tooltip( 'action_title', 'open' ); ?>" id="<?php echo esc_attr( $action_control->get_field_id( 'action_post_title' ) ); ?>" /> |
| 16 |
</p> |
| 17 |
<?php |
| 18 |
|
| 19 |
if ( ! isset( $action_control->action_options['event'] ) ) { |
| 20 |
$events = 'create'; |
| 21 |
} |
| 22 |
|
| 23 |
if ( ! is_array( $action_control->action_options['event'] ) ) { |
| 24 |
$action_control->action_options['event'] = explode( ',', $action_control->action_options['event'] ); |
| 25 |
} |
| 26 |
|
| 27 |
if ( count( $action_control->action_options['event'] ) == 1 || $action_control->action_options['force_event'] ) { |
| 28 |
foreach ( $action_control->action_options['event'] as $e ) { |
| 29 |
?> |
| 30 |
<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'event' ) ); ?>[]" value="<?php echo esc_attr( $e ); ?>" /> |
| 31 |
<?php |
| 32 |
} |
| 33 |
} else { |
| 34 |
?> |
| 35 |
<p class="frm6 frm_form_field"> |
| 36 |
<label for="<?php echo esc_attr( $action_control->get_field_id( 'event' ) ); ?>"> |
| 37 |
<?php esc_html_e( 'Trigger this action when', 'formidable' ); ?> |
| 38 |
</label> |
| 39 |
<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' ) ); ?>"> |
| 40 |
<?php |
| 41 |
|
| 42 |
$event_labels = FrmFormAction::trigger_labels(); |
| 43 |
foreach ( $action_control->action_options['event'] as $event ) { |
| 44 |
?> |
| 45 |
<option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( isset( $event_labels[ $event ] ) ? $event_labels[ $event ] : $event ); ?></option> |
| 46 |
<?php } ?> |
| 47 |
</select> |
| 48 |
</p> |
| 49 |
<?php |
| 50 |
} |
| 51 |
|
| 52 |
?> |
| 53 |
</div> |
| 54 |
<?php |
| 55 |
|
| 56 |
$action_control->form( $form_action, compact( 'form', 'action_key', 'values' ) ); |
| 57 |
|
| 58 |
$pass_args = array( |
| 59 |
'form' => $form, |
| 60 |
'action_control' => $action_control, |
| 61 |
'action_key' => $action_key, |
| 62 |
'values' => $values, |
| 63 |
); |
| 64 |
do_action( 'frm_additional_action_settings', $form_action, $pass_args ); |
| 65 |
|
| 66 |
// Show Conditional logic indicator. |
| 67 |
if ( ! FrmAppHelper::pro_is_installed() ) { |
| 68 |
if ( 'email' === $form_action->post_excerpt ) { |
| 69 |
?> |
| 70 |
<h3> |
| 71 |
<a href="javascript:void(0)" class="frm_show_upgrade frm_noallow" data-upgrade="<?php esc_attr_e( 'Email attachments', 'formidable' ); ?>" data-medium="email-attachment"> |
| 72 |
<?php esc_html_e( 'Attachment', 'formidable' ); ?> |
| 73 |
</a> |
| 74 |
</h3> |
| 75 |
<?php |
| 76 |
} |
| 77 |
|
| 78 |
$action_control->render_conditional_logic_call_to_action(); |
| 79 |
} |
| 80 |
|
| 81 |
// Show Form Action Automation indicator. |
| 82 |
if ( ! function_exists( 'load_frm_autoresponder' ) ) { |
| 83 |
$upgrading = FrmAddonsController::install_link( 'autoresponder' ); |
| 84 |
$params = array( |
| 85 |
'href' => 'javascript:void(0)', |
| 86 |
'class' => 'frm_show_upgrade', |
| 87 |
'data-upgrade' => __( 'Form action automations', 'formidable' ), |
| 88 |
'data-medium' => 'action-automation', |
| 89 |
); |
| 90 |
|
| 91 |
if ( isset( $upgrading['url'] ) ) { |
| 92 |
$params['data-oneclick'] = json_encode( $upgrading ); |
| 93 |
} else { |
| 94 |
$params['class'] .= ' frm_noallow'; |
| 95 |
$params['data-requires'] = FrmFormsHelper::get_plan_required( $upgrading ); |
| 96 |
} |
| 97 |
?> |
| 98 |
<h3> |
| 99 |
<a <?php FrmAppHelper::array_to_html_params( $params, true ); ?>> |
| 100 |
<?php esc_html_e( 'Setup Automation', 'formidable' ); ?> |
| 101 |
</a> |
| 102 |
</h3> |
| 103 |
<?php |
| 104 |
unset( $params ); |
| 105 |
} |
| 106 |
|
| 107 |
// Show link to install logs. |
| 108 |
if ( $use_logging ) { |
| 109 |
$upgrading = FrmAddonsController::install_link( 'logs' ); |
| 110 |
if ( isset( $upgrading['url'] ) ) { |
| 111 |
?> |
| 112 |
<p> |
| 113 |
<a href="javascript:void(0)" class="frm_show_upgrade" data-upgrade="<?php esc_attr_e( 'Form action logs', 'formidable' ); ?>" data-medium="action-logs" data-oneclick="<?php echo esc_attr( json_encode( $upgrading ) ); ?>"> |
| 114 |
<?php FrmAppHelper::icon_by_class( 'frmfont frm_tooltip_solid_icon frm_svg15', array( 'aria-hidden' => 'true' ) ); ?> |
| 115 |
<?php esc_html_e( 'Install logging to get more information on API requests.', 'formidable' ); ?> |
| 116 |
</a> |
| 117 |
</p> |
| 118 |
<?php |
| 119 |
} |
| 120 |
} |
| 121 |
?> |
| 122 |
<span class="alignright frm_action_id frm-sub-label <?php echo esc_attr( empty( $form_action->ID ) ? 'frm_hidden' : '' ); ?>"> |
| 123 |
<?php |
| 124 |
/* translators: %1$s: The ID of the form action. */ |
| 125 |
printf( esc_html__( 'Action ID: %1$s', 'formidable' ), esc_attr( $form_action->ID ) ); |
| 126 |
?> |
| 127 |
</span> |
| 128 |
<div style="clear:both;"></div> |
| 129 |
|