| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; // Exit if accessed directly |
| 5 |
} |
| 6 |
|
| 7 |
global $aui_bs5; |
| 8 |
|
| 9 |
$type = isset( $_POST['uwp_popup_type'] ) && $_POST['uwp_popup_type'] == 'avatar' ? 'avatar' : 'banner'; |
| 10 |
$image_url = !empty($args['image_url']) ? esc_url( $args['image_url'] ) : ''; |
| 11 |
?> |
| 12 |
<div class="modal-header" xmlns="http://www.w3.org/1999/html"> |
| 13 |
<h5 class="modal-title" id="uwp-profile-modal-title"> |
| 14 |
<?php |
| 15 |
if ($type == 'avatar') { |
| 16 |
esc_html_e( 'Change your profile photo', 'userswp' ); |
| 17 |
} else { |
| 18 |
esc_html_e( 'Change your cover photo', 'userswp' ); |
| 19 |
} |
| 20 |
?> |
| 21 |
</h5> |
| 22 |
</div> |
| 23 |
<div class="modal-body text-center"> |
| 24 |
<div id="uwp-bs-modal-notice"></div> |
| 25 |
<div align="center"> |
| 26 |
<img src="<?php echo esc_url( $image_url ); ?>" id="uwp-<?php echo esc_attr( $type ); ?>-to-crop" /> |
| 27 |
</div> |
| 28 |
</div> |
| 29 |
|
| 30 |
<div class="modal-footer"> |
| 31 |
<button type="button" data-type="<?php echo esc_attr( $type ); ?>" class="btn btn-outline-primary uwp_modal_btn uwp-modal-close" data-<?php echo ( $aui_bs5 ? 'bs-' : '' ); ?>dismiss="modal"><?php esc_html_e( 'Cancel', 'userswp' ); ?></button> |
| 32 |
<div class="uwp-<?php echo esc_attr( $type ); ?>-crop-p-wrap"> |
| 33 |
<div id="<?php echo esc_attr( $type ); ?>-crop-actions"> |
| 34 |
<form class="uwp-crop-form" method="post"> |
| 35 |
<?php |
| 36 |
echo aui()->input(array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 37 |
'type' => 'hidden', |
| 38 |
'id' => esc_html( $type.'-x' ), |
| 39 |
'name' => 'uwpx', |
| 40 |
'value' => '', |
| 41 |
'no_wrap' => true, |
| 42 |
)); |
| 43 |
echo aui()->input(array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 44 |
'type' => 'hidden', |
| 45 |
'id' => esc_html( $type.'-y' ), |
| 46 |
'name' => 'uwpy', |
| 47 |
'value' => '', |
| 48 |
'no_wrap' => true, |
| 49 |
)); |
| 50 |
echo aui()->input(array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 51 |
'type' => 'hidden', |
| 52 |
'id' => esc_html( $type.'-w' ), |
| 53 |
'name' => 'uwpw', |
| 54 |
'value' => '', |
| 55 |
'no_wrap' => true, |
| 56 |
)); |
| 57 |
echo aui()->input(array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 58 |
'type' => 'hidden', |
| 59 |
'id' => esc_html( $type.'-h' ), |
| 60 |
'name' => 'uwph', |
| 61 |
'value' => '', |
| 62 |
'no_wrap' => true, |
| 63 |
)); |
| 64 |
echo aui()->input(array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 65 |
'type' => 'hidden', |
| 66 |
'id' => esc_html( 'uwp-'.$type.'-crop-image' ), |
| 67 |
'name' => 'uwp_crop', |
| 68 |
'value' => esc_attr( $image_url ), |
| 69 |
'no_wrap' => true, |
| 70 |
)); |
| 71 |
echo aui()->input(array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 72 |
'type' => 'hidden', |
| 73 |
'name' => 'uwp_crop_nonce', |
| 74 |
'value' => esc_html( wp_create_nonce( 'uwp_crop_nonce_'.$type ) ), |
| 75 |
'no_wrap' => true, |
| 76 |
)); |
| 77 |
echo aui()->button(array( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 78 |
'type' => 'submit', |
| 79 |
'id' => esc_html( 'save_uwp_'.$type ), |
| 80 |
'content' => esc_html__( 'Apply', 'userswp' ), |
| 81 |
'name' => esc_html( 'uwp_'.$type.'_crop' ), |
| 82 |
)); |
| 83 |
?> |
| 84 |
</form> |
| 85 |
</div> |
| 86 |
</div> |
| 87 |
</div> |
| 88 |
|