← All changes
|
classes/views/frm-form-actions/_email_settings.php
+80
-42
6.4.2
→
trunk
View file →
| @@ -1,18 +1,50 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | 3 | die( 'You are not allowed to call this page directly.' ); |
| 4 | 4 | } |
| 5 | + | |
| 6 | +$email_styles = FrmEmailStylesController::get_email_styles(); | |
| 7 | +$selected_style = ! empty( $form_action->post_content['email_style'] ) ? $form_action->post_content['email_style'] : 'classic'; | |
| 8 | + | |
| 9 | +if ( ! empty( $form_action->post_content['plain_text'] ) ) { | |
| 10 | + $selected_style = 'plain'; | |
| 11 | +} | |
| 12 | + | |
| 13 | +$default_style = FrmEmailStylesController::get_default_email_style(); | |
| 5 | 14 | ?> |
| 15 | +<p class="frm-email-style-container frm-mt-xs frm-mb-md"> | |
| 16 | + <label for="frm-email-style-value"> | |
| 17 | + <?php esc_html_e( 'Email Style', 'formidable' ); ?> | |
| 18 | + </label> | |
| 19 | + <select name="<?php echo esc_attr( $this->get_field_name( 'email_style' ) ); ?>" id="frm-email-style-value"> | |
| 20 | + <?php | |
| 21 | + foreach ( $email_styles as $style_key => $style ) { | |
| 22 | + $option_attrs = array( 'value' => $style_key ); | |
| 23 | + $option_label = $style['name']; | |
| 6 | 24 | |
| 7 | -<p class="frm_has_shortcodes frm_to_row frm_email_row"> | |
| 8 | - <label for="<?php echo esc_attr( $this->get_field_id( 'email_to' ) ); ?>" <?php FrmAppHelper::maybe_add_tooltip( 'email_to' ); ?>> | |
| 9 | - <?php esc_html_e( 'To', 'formidable' ); ?> | |
| 10 | - </label> | |
| 11 | - <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'email_to' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['email_to'] ); ?>" class="frm_not_email_to frm_email_blur large-text <?php FrmAppHelper::maybe_add_tooltip( 'email_to', 'open' ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'email_to' ) ); ?>" /> | |
| 25 | + if ( empty( $style['selectable'] ) ) { | |
| 26 | + $option_attrs['disabled'] = 'disabled'; | |
| 27 | + $option_label .= ' ' . __( '(Pro)', 'formidable' ); | |
| 28 | + } | |
| 29 | + | |
| 30 | + if ( $style_key === $default_style ) { | |
| 31 | + $option_label .= ' ' . __( '(Default)', 'formidable' ); | |
| 32 | + } | |
| 33 | + | |
| 34 | + printf( | |
| 35 | + '<option %1$s%2$s>%3$s</option>', | |
| 36 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 37 | + FrmAppHelper::array_to_html_params( $option_attrs ), | |
| 38 | + selected( $selected_style, $style_key, false ), | |
| 39 | + esc_html( $option_label ) | |
| 40 | + ); | |
| 41 | + }//end foreach | |
| 42 | + ?> | |
| 43 | + </select> | |
| 12 | 44 | </p> |
| 13 | 45 | |
| 14 | -<p class="frm_bcc_cc_container"> | |
| 46 | +<p class="frm_bcc_cc_container frm-mb-0"> | |
| 15 | 47 | <a href="javascript:void(0)" class="button frm_email_buttons frm_cc_button <?php echo esc_attr( ! empty( $form_action->post_content['cc'] ) ? 'frm_hidden' : '' ); ?>" data-emailrow="cc"> |
| 16 | 48 | <?php esc_html_e( 'CC', 'formidable' ); ?> |
| 17 | 49 | </a> |
| 18 | 50 | <a href="javascript:void(0)" class="button frm_email_buttons frm_bcc_button <?php echo esc_attr( ! empty( $form_action->post_content['bcc'] ) ? 'frm_hidden' : '' ); ?>" data-emailrow="bcc"> |
| @@ -19,61 +51,73 @@ | ||
| 19 | 51 | <?php esc_html_e( 'BCC', 'formidable' ); ?> |
| 20 | 52 | </a> |
| 21 | 53 | </p> |
| 22 | 54 | |
| 23 | -<p class="frm_has_shortcodes frm_cc_row frm_email_row<?php echo empty( $form_action->post_content['cc'] ) ? ' frm_hidden' : ''; ?>" > | |
| 24 | - <label for="<?php echo esc_attr( $this->get_field_id( 'cc' ) ); ?>" <?php FrmAppHelper::maybe_add_tooltip( 'cc' ); ?>> | |
| 25 | - <?php esc_html_e( 'CC', 'formidable' ); ?> | |
| 26 | - <a href="javascript:void(0)" class="frm_icon_font frm_remove_field frm_cancel1_icon" data-emailrow="cc"></a> | |
| 55 | +<p class="frm_has_shortcodes frm_to_row frm_email_row frm-mb-md"> | |
| 56 | + <label class="frm-h-stack-xs" for="<?php echo esc_attr( $this->get_field_id( 'email_to' ) ); ?>"> | |
| 57 | + <span><?php esc_html_e( 'To', 'formidable' ); ?></span> | |
| 58 | + <span <?php FrmAppHelper::maybe_add_tooltip( 'email_to' ); ?>><?php FrmAppHelper::icon_by_class( 'frmfont frm_tooltip_icon frm_svg14' ); ?></span> | |
| 27 | 59 | </label> |
| 60 | + <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'email_to' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['email_to'] ); ?>" class="frm_not_email_to large-text" id="<?php echo esc_attr( $this->get_field_id( 'email_to' ) ); ?>" /> | |
| 61 | +</p> | |
| 28 | 62 | |
| 29 | - <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'cc' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['cc'] ); ?>" class="frm_not_email_to large-text <?php FrmAppHelper::maybe_add_tooltip( 'cc', 'open' ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'cc' ) ); ?>" /> | |
| 63 | +<p class="frm_has_shortcodes frm_cc_row frm_email_row frm-mb-md<?php echo ! empty( $form_action->post_content['cc'] ) ? '' : ' frm_hidden'; ?>"> | |
| 64 | + <label class="frm-h-stack-xs" for="<?php echo esc_attr( $this->get_field_id( 'cc' ) ); ?>"> | |
| 65 | + <span><?php esc_html_e( 'CC', 'formidable' ); ?></span> | |
| 66 | + <span <?php FrmAppHelper::maybe_add_tooltip( 'cc' ); ?>><?php FrmAppHelper::icon_by_class( 'frmfont frm_tooltip_icon frm_svg14' ); ?></span> | |
| 67 | + </label> | |
| 68 | + <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'cc' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['cc'] ); ?>" class="frm_not_email_to large-text" id="<?php echo esc_attr( $this->get_field_id( 'cc' ) ); ?>" /> | |
| 69 | + <a href="javascript:void(0)" class="frm_remove_field" data-emailrow="cc"><?php FrmAppHelper::icon_by_class( 'frmfont frm_close_icon frm_svg14' ); ?></a> | |
| 30 | 70 | </p> |
| 31 | 71 | |
| 32 | -<p class="frm_has_shortcodes frm_bcc_row frm_email_row<?php echo empty( $form_action->post_content['bcc'] ) ? ' frm_hidden' : ''; ?>" > | |
| 33 | - <label for="<?php echo esc_attr( $this->get_field_id( 'bcc' ) ); ?>" <?php FrmAppHelper::maybe_add_tooltip( 'bcc' ); ?>> | |
| 34 | - <?php esc_html_e( 'BCC', 'formidable' ); ?> | |
| 35 | - <a href="javascript:void(0)" class="frm_icon_font frm_remove_field frm_cancel1_icon" data-emailrow="bcc"></a> | |
| 72 | +<p class="frm_has_shortcodes frm_bcc_row frm_email_row frm-mb-md<?php echo ! empty( $form_action->post_content['bcc'] ) ? '' : ' frm_hidden'; ?>"> | |
| 73 | + <label class="frm-h-stack-xs" for="<?php echo esc_attr( $this->get_field_id( 'bcc' ) ); ?>"> | |
| 74 | + <span><?php esc_html_e( 'BCC', 'formidable' ); ?></span> | |
| 75 | + <span <?php FrmAppHelper::maybe_add_tooltip( 'bcc' ); ?>><?php FrmAppHelper::icon_by_class( 'frmfont frm_tooltip_icon frm_svg14' ); ?></span> | |
| 36 | 76 | </label> |
| 37 | 77 | |
| 38 | - <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'bcc' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['bcc'] ); ?>" class="frm_not_email_to large-text <?php FrmAppHelper::maybe_add_tooltip( 'bcc', 'open' ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'bcc' ) ); ?>" /> | |
| 78 | + <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'bcc' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['bcc'] ); ?>" class="frm_not_email_to large-text" id="<?php echo esc_attr( $this->get_field_id( 'bcc' ) ); ?>" /> | |
| 79 | + <a href="javascript:void(0)" class="frm_remove_field" data-emailrow="bcc"><?php FrmAppHelper::icon_by_class( 'frmfont frm_close_icon frm_svg14' ); ?></a> | |
| 39 | 80 | </p> |
| 40 | 81 | |
| 41 | -<p class="frm_has_shortcodes frm_from_row frm_email_row"> | |
| 42 | - <label for="<?php echo esc_attr( $this->get_field_id( 'from' ) ); ?>" <?php FrmAppHelper::maybe_add_tooltip( 'from' ); ?>> | |
| 82 | +<p class="frm_reply_to_container frm-mb-0"> | |
| 83 | + <a href="javascript:void(0)" class="button frm_email_buttons frm_reply_to_button <?php echo ( ! empty( $form_action->post_content['reply_to'] ) ? 'frm_hidden' : '' ); ?>" data-emailrow="reply_to"> | |
| 84 | + <?php esc_html_e( 'Reply To', 'formidable' ); ?> | |
| 85 | + </a> | |
| 86 | +</p> | |
| 87 | + | |
| 88 | +<p class="frm_has_shortcodes frm_from_row frm_email_row frm-mb-md"> | |
| 89 | + <label for="<?php echo esc_attr( $this->get_field_id( 'from' ) ); ?>"> | |
| 43 | 90 | <?php esc_html_e( 'From', 'formidable' ); ?> |
| 91 | + <span <?php FrmAppHelper::maybe_add_tooltip( 'from' ); ?>><?php FrmAppHelper::icon_by_class( 'frmfont frm_tooltip_icon frm_svg14' ); ?></span> | |
| 44 | 92 | </label> |
| 45 | 93 | |
| 46 | - <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'from' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['from'] ); ?>" class="frm_not_email_to frm_email_blur large-text <?php FrmAppHelper::maybe_add_tooltip( 'from', 'open' ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'from' ) ); ?>" /> | |
| 94 | + <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'from' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['from'] ); ?>" class="frm_not_email_to large-text" id="<?php echo esc_attr( $this->get_field_id( 'from' ) ); ?>" /> | |
| 47 | 95 | </p> |
| 48 | 96 | |
| 49 | -<p class="frm_error_style frm_from_to_match_row <?php echo ( ( $form_action->post_content['from'] !== $form_action->post_content['email_to'] ) ? 'frm_hidden' : '' ); ?>" data-emailrow="from_to_warning"> | |
| 97 | +<p class="frm_error_style frm_from_to_match_row frm-my-md <?php echo ( $form_action->post_content['from'] === $form_action->post_content['email_to'] ? '' : 'frm_hidden' ); ?>" data-emailrow="from_to_warning"> | |
| 50 | 98 | <?php esc_html_e( 'Warning: If you are sending an email to the user, the To and From fields should not match.', 'formidable' ); ?> |
| 51 | 99 | </p> |
| 52 | 100 | |
| 53 | -<p class="frm_reply_to_container"> | |
| 54 | - <a href="javascript:void(0)" class="button frm_email_buttons frm_reply_to_button <?php echo ( ! empty( $form_action->post_content['reply_to'] ) ? 'frm_hidden' : '' ); ?>" data-emailrow="reply_to"> | |
| 101 | +<p class="frm_has_shortcodes frm_reply_to_row frm_email_row frm-mb-md<?php echo ! empty( $form_action->post_content['reply_to'] ) ? '' : ' frm_hidden'; ?>"> | |
| 102 | + <label for="<?php echo esc_attr( $this->get_field_id( 'reply_to' ) ); ?>"> | |
| 55 | 103 | <?php esc_html_e( 'Reply To', 'formidable' ); ?> |
| 56 | - </a> | |
| 57 | -</p> | |
| 58 | - | |
| 59 | -<p class="frm_has_shortcodes frm_reply_to_row frm_email_row<?php echo empty( $form_action->post_content['reply_to'] ) ? ' frm_hidden' : ''; ?>"> | |
| 60 | - <label for="<?php echo esc_attr( $this->get_field_id( 'reply_to' ) ); ?>" <?php FrmAppHelper::maybe_add_tooltip( 'reply_to' ); ?>> | |
| 61 | - <?php esc_html_e( 'Reply To', 'formidable' ); ?> | |
| 62 | - <a href="javascript:void(0)" class="frm_icon_font frm_remove_field frm_cancel1_icon" data-emailrow="reply_to"></a> | |
| 104 | + <span <?php FrmAppHelper::maybe_add_tooltip( 'reply_to' ); ?>><?php FrmAppHelper::icon_by_class( 'frmfont frm_tooltip_icon frm_svg14' ); ?></span> | |
| 63 | 105 | </label> |
| 64 | 106 | |
| 65 | - <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'reply_to' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['reply_to'] ); ?>" class="frm_not_email_to large-text <?php FrmAppHelper::maybe_add_tooltip( 'reply_to', 'open' ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'reply_to' ) ); ?>" /> | |
| 107 | + <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'reply_to' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['reply_to'] ); ?>" class="frm_not_email_to large-text" id="<?php echo esc_attr( $this->get_field_id( 'reply_to' ) ); ?>" /> | |
| 108 | + <a href="javascript:void(0)" class="frm_remove_field" data-emailrow="reply_to"><?php FrmAppHelper::icon_by_class( 'frmfont frm_close_icon frm_svg14' ); ?></a> | |
| 66 | 109 | </p> |
| 67 | 110 | |
| 68 | -<p class="frm_has_shortcodes"> | |
| 69 | - <label for="<?php echo esc_attr( $this->get_field_id( 'email_subject' ) ); ?>" <?php FrmAppHelper::maybe_add_tooltip( 'email_subject', '', $form->name ); ?>> | |
| 111 | +<p class="frm_has_shortcodes frm_email_row frm-mb-md"> | |
| 112 | + <label for="<?php echo esc_attr( $this->get_field_id( 'email_subject' ) ); ?>"> | |
| 70 | 113 | <?php esc_html_e( 'Subject', 'formidable' ); ?> |
| 114 | + <span <?php FrmAppHelper::maybe_add_tooltip( 'email_subject', '', $form->name ); ?>><?php FrmAppHelper::icon_by_class( 'frmfont frm_tooltip_icon frm_svg14' ); ?></span> | |
| 71 | 115 | </label> |
| 72 | - <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'email_subject' ) ); ?>" class="frm_not_email_subject large-text <?php FrmAppHelper::maybe_add_tooltip( 'email_subject', 'open', $form->name ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'email_subject' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['email_subject'] ); ?>" /> | |
| 116 | + <input type="text" name="<?php echo esc_attr( $this->get_field_name( 'email_subject' ) ); ?>" class="frm_not_email_subject large-text" id="<?php echo esc_attr( $this->get_field_id( 'email_subject' ) ); ?>" value="<?php echo esc_attr( $form_action->post_content['email_subject'] ); ?>" /> | |
| 73 | 117 | </p> |
| 74 | 118 | |
| 75 | -<p class="frm_has_shortcodes"> | |
| 119 | +<p class="frm_has_shortcodes frm-mb-md"> | |
| 76 | 120 | <label for="<?php echo esc_attr( $this->get_field_id( 'email_message' ) ); ?>"> |
| 77 | 121 | <?php esc_html_e( 'Message', 'formidable' ); ?> |
| 78 | 122 | </label> |
| 79 | 123 | <?php |
| @@ -83,8 +127,9 @@ | ||
| 83 | 127 | * @since 5.5.2 |
| 84 | 128 | * |
| 85 | 129 | * @param bool $rich_text_emails True by default unless plain text is selected. |
| 86 | 130 | * @param array $args { |
| 131 | + * | |
| 87 | 132 | * @type stdClass $form |
| 88 | 133 | * @type WP_Post $form_action |
| 89 | 134 | * } |
| 90 | 135 | */ |
| @@ -108,9 +153,9 @@ | ||
| 108 | 153 | } |
| 109 | 154 | ?> |
| 110 | 155 | </p> |
| 111 | 156 | |
| 112 | -<label for="<?php echo esc_attr( $this->get_field_id( 'inc_user_info' ) ); ?>"> | |
| 157 | +<label class="frm-h-stack-xs frm-my-md" for="<?php echo esc_attr( $this->get_field_id( 'inc_user_info' ) ); ?>"> | |
| 113 | 158 | <input type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'inc_user_info' ) ); ?>" class="frm_not_inc_user_info" id="<?php echo esc_attr( $this->get_field_id( 'inc_user_info' ) ); ?>" value="1" <?php checked( $form_action->post_content['inc_user_info'], 1 ); ?> /> |
| 114 | 159 | <?php if ( FrmAppHelper::ips_saved() ) { ?> |
| 115 | 160 | <?php esc_html_e( 'Append IP Address, Browser, and Referring URL to message', 'formidable' ); ?> |
| 116 | 161 | <?php } else { ?> |
| @@ -116,11 +161,4 @@ | ||
| 116 | 161 | <?php } else { ?> |
| 117 | 162 | <?php esc_html_e( 'Append Browser and Referring URL to message', 'formidable' ); ?> |
| 118 | 163 | <?php } ?> |
| 119 | 164 | </label> |
| 120 | - | |
| 121 | -<p> | |
| 122 | - <label for="<?php echo esc_attr( $this->get_field_id( 'plain_text' ) ); ?>"> | |
| 123 | - <input type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'plain_text' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'plain_text' ) ); ?>" value="1" <?php checked( $form_action->post_content['plain_text'], 1 ); ?> /> | |
| 124 | - <?php esc_html_e( 'Send Emails in Plain Text', 'formidable' ); ?> | |
| 125 | - </label> | |
| 126 | -</p> | |