| 1 |
<?php |
| 2 |
/** |
| 3 |
* This template contains the send message form on /friends/. |
| 4 |
* |
| 5 |
* @package Friends |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! isset( $args['subject'] ) ) { |
| 9 |
?> |
| 10 |
<div class="card mt-2 p-2" id="friends-send-new-message" style="display: none"> |
| 11 |
<?php |
| 12 |
} |
| 13 |
?> |
| 14 |
<form method="post" class="form-horizontal"> |
| 15 |
<input type="hidden" name="friends_message_recipient" value="<?php echo esc_attr( $args['friend_user']->ID ); ?>"> |
| 16 |
<?php wp_nonce_field( 'friends_send_message' ); ?> |
| 17 |
<?php if ( isset( $args['subject'] ) ) : ?> |
| 18 |
<input type="hidden" name="friends_message_subject" value="<?php echo esc_attr( $args['subject'] ); ?>"> |
| 19 |
<?php else : ?> |
| 20 |
<div class="form-group"> |
| 21 |
<div class="col-2 col-sm-12"> |
| 22 |
<label class="form-label" for="subject"><?php esc_html_e( 'Subject', 'friends' ); ?></label> |
| 23 |
</div> |
| 24 |
<div class="col-8 col-sm-12"> |
| 25 |
<?php if ( isset( $args['subject'] ) && $args['subject'] ) : ?> |
| 26 |
<input type="hidden" name="friends_message_subject" value="<?php echo esc_attr( $args['subject'] ); ?>" /> |
| 27 |
<?php else : ?> |
| 28 |
<input class="form-input" type="text" name="friends_message_subject" value="" placeholder="<?php esc_attr_e( 'Subject (optional)', 'friends' ); ?>" /> |
| 29 |
<?php endif; ?> |
| 30 |
</div> |
| 31 |
</div> |
| 32 |
<?php endif; ?> |
| 33 |
|
| 34 |
<div class="form-group"> |
| 35 |
<div class="col-2 col-sm-12"> |
| 36 |
<label class="form-label" for="friends_message_message"><?php esc_html_e( 'Message', 'friends' ); ?></label> |
| 37 |
</div> |
| 38 |
<div class="col-8 col-sm-12<?php echo esc_attr( $args['blocks-everywhere'] ? ' blocks-everywhere iso-editor__loading' : '' ); ?>"> |
| 39 |
<textarea class="form-input friends-message-message<?php echo esc_attr( $args['blocks-everywhere'] ? ' blocks-everywhere-enabled' : '' ); ?>" name="friends_message_message" placeholder="" rows="3"></textarea> |
| 40 |
<?php |
| 41 |
do_action( 'friends_message_form' ); |
| 42 |
?> |
| 43 |
</div> |
| 44 |
</div> |
| 45 |
<div class="form-group"> |
| 46 |
<div class="col-2 col-sm-12"> |
| 47 |
</div> |
| 48 |
<div class="col-6 col-sm-12"> |
| 49 |
<button class="btn"><?php esc_html_e( 'Send', 'friends' ); ?></button> |
| 50 |
</div> |
| 51 |
<?php |
| 52 |
if ( ! empty( $args['subject'] ) ) { |
| 53 |
?> |
| 54 |
<div class="col-2 col-sm-12" style="text-align: right"> |
| 55 |
<button class="btn btn-link btn-sm delete-conversation text-error" name="friends_message_delete_conversation"><?php esc_html_e( 'Delete conversation', 'friends' ); ?></button> |
| 56 |
</div> |
| 57 |
<?php |
| 58 |
} |
| 59 |
?> |
| 60 |
</div> |
| 61 |
</form> |
| 62 |
<?php |
| 63 |
if ( ! isset( $args['subject'] ) ) { |
| 64 |
?> |
| 65 |
</div> |
| 66 |
<?php |
| 67 |
} |
| 68 |
|