← All changes
|
includes/admin/views/html-admin-matching-properties-email.php
+55
-23
1.4.55
→
2.3.0
View file →
| @@ -1,54 +1,86 @@ | ||
| 1 | 1 | <?php |
| 2 | -$current_user = wp_get_current_user(); | |
| 2 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 3 | + exit; | |
| 4 | +} | |
| 5 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing -- Read-only email composition count; the matching controller verifies propertyhive-matching-properties before including this view. | |
| 6 | +$propertyhive_email_property_ids = isset( $_POST['email_property_id'] ) && is_array( $_POST['email_property_id'] ) ? array_filter( array_map( 'sanitize_text_field', wp_unslash( $_POST['email_property_id'] ) ), 'ctype_digit' ) : array(); | |
| 3 | 7 | ?> |
| 4 | -<h1>Emailing <?php echo count($_POST['email_property_id']); ?> Suitable Properties To <?php echo get_the_title($contact_id); ?></h1> | |
| 5 | 8 | |
| 9 | +<h1>Emailing <?php echo count( $propertyhive_email_property_ids ); ?> Suitable Properties To <?php echo esc_html(get_the_title($contact_id)); ?></h1> | |
| 10 | + | |
| 6 | 11 | <table class="form-table"> |
| 7 | 12 | |
| 8 | 13 | <tr valign="top"> |
| 9 | - <th scope="row" class="titledesc"><?php echo __( 'To', 'propertyhive' ); ?></th> | |
| 14 | + <th scope="row" class="titledesc"><?php echo esc_html(__( 'To', 'propertyhive' )); ?></th> | |
| 10 | 15 | <td class="forminp"> |
| 11 | - <input type="text" name="to_email_address" value="<?php echo get_post_meta( $contact_id, '_email_address', TRUE ); ?>" style="width:100%;"> | |
| 16 | + <input type="text" name="to_email_address" value="<?php echo esc_attr( get_post_meta( $contact_id, '_email_address', TRUE ) ); ?>" style="width:100%; margin-bottom:5px;"> | |
| 17 | + <a href="" class="show-cc">Show Cc</a> | <a href="" class="show-bcc">Show Bcc</a> | |
| 12 | 18 | </td> |
| 13 | 19 | </tr> |
| 14 | 20 | |
| 15 | - <tr valign="top"> | |
| 16 | - <th scope="row" class="titledesc"><?php echo __( 'From Name', 'propertyhive' ); ?></th> | |
| 21 | + <tr valign="top" style="display:none" id="cc_email_address_row"> | |
| 22 | + <th scope="row" class="titledesc"><?php echo esc_html(__( 'Cc', 'propertyhive' )); ?></th> | |
| 17 | 23 | <td class="forminp"> |
| 18 | - <input type="text" name="from_name" value="<?php | |
| 24 | + <input type="text" name="cc_email_address" value="" style="width:100%;"> | |
| 25 | + </td> | |
| 26 | + </tr> | |
| 19 | 27 | |
| 20 | - echo get_bloginfo('name'); | |
| 28 | + <tr valign="top" style="display:none" id="bcc_email_address_row"> | |
| 29 | + <th scope="row" class="titledesc"><?php echo esc_html(__( 'Bcc', 'propertyhive' )); ?></th> | |
| 30 | + <td class="forminp"> | |
| 31 | + <input type="text" name="bcc_email_address" value="" style="width:100%;"> | |
| 32 | + </td> | |
| 33 | + </tr> | |
| 21 | 34 | |
| 22 | - ?>" style="width:100%;"> | |
| 35 | + <tr valign="top"> | |
| 36 | + <th scope="row" class="titledesc"><?php echo esc_html(__( 'From Name', 'propertyhive' )); ?></th> | |
| 37 | + <td class="forminp"> | |
| 38 | + <input type="text" name="from_name" value="<?php echo esc_attr(get_bloginfo('name')); ?>" style="width:100%;"> | |
| 23 | 39 | </td> |
| 24 | 40 | </tr> |
| 25 | 41 | |
| 26 | 42 | <tr valign="top"> |
| 27 | - <th scope="row" class="titledesc"><?php echo __( 'From Email Address', 'propertyhive' ); ?></th> | |
| 43 | + <th scope="row" class="titledesc"><?php echo esc_html(__( 'From Email Address', 'propertyhive' )); ?></th> | |
| 28 | 44 | <td class="forminp"> |
| 29 | - <input type="text" name="from_email_address" value="<?php | |
| 30 | - | |
| 31 | - if ( trim($current_user->user_email) != '' ) | |
| 32 | - { | |
| 33 | - echo $current_user->user_email; | |
| 34 | - } | |
| 35 | - | |
| 36 | - ?>" style="width:100%;"> | |
| 45 | + <input type="text" name="from_email_address" value="<?php echo esc_attr(trim($from_email_address)); ?>" style="width:100%;"> | |
| 37 | 46 | </td> |
| 38 | 47 | </tr> |
| 39 | 48 | |
| 40 | 49 | <tr valign="top"> |
| 41 | - <th scope="row" class="titledesc"><?php echo __( 'Subject', 'propertyhive' ); ?></th> | |
| 50 | + <th scope="row" class="titledesc"><?php echo esc_html(__( 'Subject', 'propertyhive' )); ?></th> | |
| 42 | 51 | <td class="forminp"> |
| 43 | - <input type="text" name="subject" value="<?php echo $subject; ?>" style="width:100%;"> | |
| 52 | + <input type="text" name="subject" value="<?php echo esc_attr($subject); ?>" style="width:100%;"> | |
| 44 | 53 | </td> |
| 45 | 54 | </tr> |
| 46 | 55 | |
| 47 | 56 | <tr valign="top"> |
| 48 | - <th scope="row" class="titledesc"><?php echo __( 'Email Body', 'propertyhive' ); ?></th> | |
| 57 | + <th scope="row" class="titledesc"><?php echo esc_html(__( 'Email Body', 'propertyhive' )); ?></th> | |
| 49 | 58 | <td class="forminp"> |
| 50 | - <textarea name="body" style="width:100%; height:300px;"><?php echo $body; ?></textarea> | |
| 59 | + <textarea name="body" style="width:100%; height:300px;"><?php echo esc_textarea( $body ); ?></textarea> | |
| 51 | 60 | </td> |
| 52 | 61 | </tr> |
| 53 | 62 | |
| 54 | -</table> | |
| 63 | +</table> | |
| 64 | + | |
| 65 | +<script> | |
| 66 | + | |
| 67 | +jQuery(document).ready(function() | |
| 68 | +{ | |
| 69 | + jQuery('a.show-cc').click(function(e) | |
| 70 | + { | |
| 71 | + e.preventDefault(); | |
| 72 | + | |
| 73 | + jQuery('#cc_email_address_row').fadeIn('fast'); | |
| 74 | + jQuery('#cc_email_address_row input').focus(); | |
| 75 | + }); | |
| 76 | + | |
| 77 | + jQuery('a.show-bcc').click(function(e) | |
| 78 | + { | |
| 79 | + e.preventDefault(); | |
| 80 | + | |
| 81 | + jQuery('#bcc_email_address_row').fadeIn('fast'); | |
| 82 | + jQuery('#bcc_email_address_row input').focus(); | |
| 83 | + }); | |
| 84 | +}); | |
| 85 | + | |
| 86 | +</script> | |