| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
|
| 6 |
$a = FrmAppHelper::simple_get( 't', 'sanitize_title', 'advanced_settings' ); |
| 7 |
$form_action = apply_filters( 'frm_form_action_settings', $form_action, $form_action->post_excerpt ); |
| 8 |
$form_action = apply_filters( 'frm_form_' . $form_action->post_excerpt . '_action_settings', $form_action ); |
| 9 |
|
| 10 |
$data_attrs = array( |
| 11 |
'data-actionkey' => $action_key, |
| 12 |
); |
| 13 |
|
| 14 |
if ( FrmOnSubmitAction::$slug === $form_action->post_excerpt ) { |
| 15 |
$data_attrs['data-on-submit-type'] = FrmOnSubmitHelper::get_action_type( $form_action ); |
| 16 |
} |
| 17 |
?> |
| 18 |
<div |
| 19 |
id="frm_form_action_<?php echo esc_attr( $action_key ); ?>" |
| 20 |
class="widget frm_form_action_settings frm_single_<?php echo esc_attr( $form_action->post_excerpt ); ?>_settings <?php echo esc_attr( $form_action->post_status === 'publish' ? '' : 'frm_disabled_action' ); ?>" |
| 21 |
<?php FrmAppHelper::array_to_html_params( $data_attrs, true ); ?> |
| 22 |
> |
| 23 |
<div class="widget-top frm-h-stack-xs frm-cursor-pointer" tabindex="0"> |
| 24 |
<div class="widget-title frm-flex-full"> |
| 25 |
<h4 class="frm-h-stack-xs frm-text-md"> |
| 26 |
<span class="frm-border-icon frm-border-icon--small"><?php FrmAppHelper::icon_by_class( $action_control->action_options['classes'], FrmFormActionsController::get_action_icon_atts( $action_control ) ); ?></span> |
| 27 |
<span><?php echo esc_html( $form_action->post_title ); ?></span> |
| 28 |
</h4> |
| 29 |
</div> |
| 30 |
|
| 31 |
<div class="frm-ml-auto frm-h-stack-sm frm-p-sm"> |
| 32 |
<span class="frm_email_icons frm-flex frm-items-center frm-gap-sm frm-fadein-down-short"> |
| 33 |
<?php if ( $action_control->action_options['limit'] > 2 ) { ?> |
| 34 |
<a href="javascript:void(0)" class="frm_duplicate_form_action" title="<?php esc_attr_e( 'Duplicate', 'formidable' ); ?>"> |
| 35 |
<?php FrmAppHelper::icon_by_class( 'frmfont frm-copy-icon frm_svg24 frm-text-grey-800' ); ?> |
| 36 |
</a> |
| 37 |
<?php } ?> |
| 38 |
|
| 39 |
<a href="javascript:void(0)" data-removeid="frm_form_action_<?php echo esc_attr( $action_key ); ?>" class="frm_remove_form_action" data-frmverify="<?php esc_attr_e( 'Delete this form action?', 'formidable' ); ?>" data-frmverify-btn="frm-button-red" title="<?php esc_attr_e( 'Delete', 'formidable' ); ?>"> |
| 40 |
<?php FrmAppHelper::icon_by_class( 'frmfont frm_trash_icon frm_svg24 frm-text-grey-800' ); ?> |
| 41 |
</a> |
| 42 |
</span> |
| 43 |
|
| 44 |
<?php |
| 45 |
FrmHtmlHelper::toggle( |
| 46 |
$action_control->get_field_id( 'post_status', '' ), |
| 47 |
$action_control->get_field_name( 'post_status', '' ), |
| 48 |
array( |
| 49 |
'checked' => $form_action->post_status === 'publish', |
| 50 |
'on_label' => 'publish', |
| 51 |
'off_label' => 'OFF', |
| 52 |
'show_labels' => false, |
| 53 |
'echo' => true, |
| 54 |
'div_class' => 'frm-ml-xs', |
| 55 |
) |
| 56 |
); |
| 57 |
?> |
| 58 |
|
| 59 |
<div class="widget-title-action"> |
| 60 |
<button type="button" class="widget-action frm-flex frm-p-2xs-force hide-if-no-js" aria-expanded="false"> |
| 61 |
<?php FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown8_icon frm_svg14' ); ?> |
| 62 |
</button> |
| 63 |
</div> |
| 64 |
</div> |
| 65 |
</div> |
| 66 |
|
| 67 |
<div class="widget-inside"> |
| 68 |
<?php |
| 69 |
// Load settings only if just added or open, otherwise include hidden settings to prevent losing the action on update. |
| 70 |
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { |
| 71 |
include __DIR__ . '/_action_inside.php'; |
| 72 |
} else { |
| 73 |
?> |
| 74 |
<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 ); ?>" /> |
| 75 |
<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'ID', '' ) ); ?>" value="<?php echo esc_attr( $form_action->ID ); ?>" /> |
| 76 |
<?php } ?> |
| 77 |
</div> |
| 78 |
</div> |
| 79 |
|