| @@ -6,19 +6,29 @@ | ||
| 6 | 6 | |
| 7 | 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 | 8 | <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'ID', '' ) ); ?>" value="<?php echo esc_attr( $form_action->ID ); ?>" /> |
| 9 | 9 | |
| 10 | -<div class="frm_grid_container frm_no_p_margin"> | |
| 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"> | |
| 11 | 20 | <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' ); ?>> | |
| 21 | + <label for="<?php echo esc_attr( $action_control->get_field_id( 'action_post_title' ) ); ?>"> | |
| 13 | 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> | |
| 14 | 24 | </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' ) ); ?>" /> | |
| 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' ) ); ?>" /> | |
| 16 | 26 | </p> |
| 17 | 27 | <?php |
| 18 | 28 | |
| 19 | 29 | if ( ! isset( $action_control->action_options['event'] ) ) { |
| 20 | - $events = 'create'; | |
| 30 | + $action_control->action_options['event'] = 'create'; | |
| 21 | 31 | } |
| 22 | 32 | |
| 23 | 33 | if ( ! is_array( $action_control->action_options['event'] ) ) { |
| 24 | 34 | $action_control->action_options['event'] = explode( ',', $action_control->action_options['event'] ); |
| @@ -23,9 +33,9 @@ | ||
| 23 | 33 | if ( ! is_array( $action_control->action_options['event'] ) ) { |
| 24 | 34 | $action_control->action_options['event'] = explode( ',', $action_control->action_options['event'] ); |
| 25 | 35 | } |
| 26 | 36 | |
| 27 | -if ( count( $action_control->action_options['event'] ) == 1 || $action_control->action_options['force_event'] ) { | |
| 37 | +if ( count( $action_control->action_options['event'] ) === 1 || $action_control->action_options['force_event'] ) { | |
| 28 | 38 | foreach ( $action_control->action_options['event'] as $e ) { |
| 29 | 39 | ?> |
| 30 | 40 | <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'event' ) ); ?>[]" value="<?php echo esc_attr( $e ); ?>" /> |
| 31 | 41 | <?php |
| @@ -39,44 +49,49 @@ | ||
| 39 | 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' ) ); ?>"> |
| 40 | 50 | <?php |
| 41 | 51 | |
| 42 | 52 | $event_labels = FrmFormAction::trigger_labels(); |
| 53 | + | |
| 43 | 54 | foreach ( $action_control->action_options['event'] as $event ) { |
| 44 | 55 | ?> |
| 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> | |
| 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> | |
| 46 | 57 | <?php } ?> |
| 47 | 58 | </select> |
| 48 | 59 | </p> |
| 49 | 60 | <?php |
| 50 | -} | |
| 61 | +}//end if | |
| 51 | 62 | |
| 52 | 63 | ?> |
| 53 | 64 | </div> |
| 54 | 65 | <?php |
| 66 | +$pass_args = array( | |
| 67 | + 'form' => $form, | |
| 68 | + 'action_control' => $action_control, | |
| 69 | + 'action_key' => $action_key, | |
| 70 | + 'values' => $values, | |
| 71 | +); | |
| 55 | 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 | + | |
| 56 | 83 | $action_control->form( $form_action, compact( 'form', 'action_key', 'values' ) ); |
| 57 | 84 | |
| 58 | -$pass_args = array( | |
| 59 | - 'form' => $form, | |
| 60 | - 'action_control' => $action_control, | |
| 61 | - 'action_key' => $action_key, | |
| 62 | - 'values' => $values, | |
| 63 | -); | |
| 64 | 85 | do_action( 'frm_additional_action_settings', $form_action, $pass_args ); |
| 65 | 86 | |
| 66 | 87 | // Show Conditional logic indicator. |
| 67 | 88 | if ( ! FrmAppHelper::pro_is_installed() ) { |
| 68 | 89 | 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-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"> | |
| 72 | - <?php esc_html_e( 'Attachment', 'formidable' ); ?> | |
| 73 | - </a> | |
| 74 | - </h3> | |
| 75 | - <?php | |
| 90 | + include FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/_email_attachment_upsell.php'; | |
| 76 | 91 | } |
| 77 | 92 | |
| 78 | - $action_control->render_conditional_logic_call_to_action(); | |
| 93 | + $action_control->render_conditional_logic_call_to_action( $action_key ); | |
| 79 | 94 | } |
| 80 | 95 | |
| 81 | 96 | // Show Form Action Automation indicator. |
| 82 | 97 | if ( ! function_exists( 'load_frm_autoresponder' ) && in_array( $form_action->post_excerpt, apply_filters( 'frm_autoresponder_allowed_actions', array( 'email', 'twilio', 'api', 'register' ) ), true ) ) { |
| @@ -81,38 +96,50 @@ | ||
| 81 | 96 | // Show Form Action Automation indicator. |
| 82 | 97 | if ( ! function_exists( 'load_frm_autoresponder' ) && in_array( $form_action->post_excerpt, apply_filters( 'frm_autoresponder_allowed_actions', array( 'email', 'twilio', 'api', 'register' ) ), true ) ) { |
| 83 | 98 | $upgrading = FrmAddonsController::install_link( 'autoresponder' ); |
| 84 | 99 | $params = array( |
| 85 | - 'href' => 'javascript:void(0)', | |
| 86 | - 'class' => 'frm_show_upgrade', | |
| 100 | + 'class' => 'frm-h-stack-xs frm-bt-200 frm-py-md frm-mb-xs frm_show_upgrade', | |
| 87 | 101 | 'data-upgrade' => __( 'Form action automations', 'formidable' ), |
| 88 | 102 | 'data-medium' => 'action-automation', |
| 103 | + 'data-content' => 'automation', | |
| 89 | 104 | ); |
| 90 | 105 | |
| 91 | 106 | if ( isset( $upgrading['url'] ) ) { |
| 92 | 107 | $params['data-oneclick'] = json_encode( $upgrading ); |
| 93 | 108 | } else { |
| 94 | - $params['class'] .= ' frm_noallow'; | |
| 95 | 109 | $params['data-requires'] = FrmFormsHelper::get_plan_required( $upgrading ); |
| 96 | 110 | } |
| 97 | 111 | ?> |
| 98 | - <h3> | |
| 99 | - <a <?php FrmAppHelper::array_to_html_params( $params, true ); ?>> | |
| 112 | + <div <?php FrmAppHelper::array_to_html_params( $params, true ); ?>> | |
| 113 | + <?php | |
| 114 | + FrmHtmlHelper::toggle( | |
| 115 | + 'frm_autoresponder_cta_' . $action_key, | |
| 116 | + 'frm_autoresponder_cta_' . $action_key, | |
| 117 | + array( | |
| 118 | + 'div_class' => 'with_frm_style frm_toggle', | |
| 119 | + 'checked' => false, | |
| 120 | + 'echo' => true, | |
| 121 | + 'disabled' => true, | |
| 122 | + ) | |
| 123 | + ); | |
| 124 | + ?> | |
| 125 | + <label for="frm_autoresponder_cta_<?php echo esc_attr( $action_key ); ?>" class="frm_noallow"> | |
| 100 | 126 | <?php esc_html_e( 'Setup Automation', 'formidable' ); ?> |
| 101 | - </a> | |
| 102 | - </h3> | |
| 127 | + </label> | |
| 128 | + </div> | |
| 103 | 129 | <?php |
| 104 | 130 | unset( $params ); |
| 105 | -} | |
| 131 | +}//end if | |
| 106 | 132 | |
| 107 | 133 | // Show link to install logs. |
| 108 | 134 | if ( $use_logging ) { |
| 109 | 135 | $upgrading = FrmAddonsController::install_link( 'logs' ); |
| 136 | + | |
| 110 | 137 | if ( isset( $upgrading['url'] ) ) { |
| 111 | 138 | ?> |
| 112 | 139 | <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' ) ); ?> | |
| 140 | + <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-content="logs" data-oneclick="<?php echo esc_attr( json_encode( $upgrading ) ); ?>"> | |
| 141 | + <?php FrmAppHelper::icon_by_class( 'frmfont frm_tooltip_solid_icon', array( 'aria-hidden' => 'true' ) ); ?> | |
| 115 | 142 | <?php esc_html_e( 'Install logging to get more information on API requests.', 'formidable' ); ?> |
| 116 | 143 | </a> |
| 117 | 144 | </p> |
| 118 | 145 | <?php |
| @@ -118,9 +145,9 @@ | ||
| 118 | 145 | <?php |
| 119 | 146 | } |
| 120 | 147 | } |
| 121 | 148 | ?> |
| 122 | -<span class="alignright frm_action_id frm-sub-label <?php echo esc_attr( empty( $form_action->ID ) ? 'frm_hidden' : '' ); ?>"> | |
| 149 | +<span class="alignright frm_action_id frm-sub-label <?php echo esc_attr( ! empty( $form_action->ID ) ? '' : 'frm_hidden' ); ?>"> | |
| 123 | 150 | <?php |
| 124 | 151 | /* translators: %1$s: The ID of the form action. */ |
| 125 | 152 | printf( esc_html__( 'Action ID: %1$s', 'formidable' ), esc_attr( $form_action->ID ) ); |
| 126 | 153 | ?> |