| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; // Exit if accessed directly |
| 5 |
} |
| 6 |
|
| 7 |
global $aui_bs5; |
| 8 |
|
| 9 |
$files = new UsersWP_Files(); |
| 10 |
$type = isset($_POST['type']) && $_POST['type'] == 'avatar' ? 'avatar' : 'banner'; |
| 11 |
?> |
| 12 |
<div class="uwp-bs-modal uwp_fade uwp_show" id="uwp-popup-modal-wrap"> |
| 13 |
<div class="uwp-bs-modal-dialog"> |
| 14 |
<div class="uwp-bs-modal-content"> |
| 15 |
<div class="uwp-bs-modal-header"> |
| 16 |
<h4 class="uwp-bs-modal-title"> |
| 17 |
<?php |
| 18 |
if ($type == 'avatar') { |
| 19 |
esc_html_e( 'Change your profile photo', 'userswp' ); |
| 20 |
} else { |
| 21 |
esc_html_e( 'Change your cover photo', 'userswp' ); |
| 22 |
} |
| 23 |
?> |
| 24 |
</h4> |
| 25 |
<button type="button" class="close uwp-modal-close" data-type="<?php echo esc_attr( $type ); ?>" data-<?php echo ( $aui_bs5 ? 'bs-' : '' ); ?>dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
| 26 |
</div> |
| 27 |
<div class="uwp-bs-modal-body"> |
| 28 |
<div id="uwp-bs-modal-notice" class="bsui"></div> |
| 29 |
<form id="uwp-upload-<?php echo esc_attr( $type ); ?>-form" method="post" enctype="multipart/form-data"> |
| 30 |
<input type="hidden" name="uwp_upload_nonce" value="<?php echo esc_attr( wp_create_nonce( 'uwp-upload-nonce' ) ); ?>" /> |
| 31 |
<input type="hidden" name="uwp_<?php echo esc_attr( $type ); ?>_submit" value="" /> |
| 32 |
<button type="button" class="uwp_upload_button" onclick="document.getElementById('uwp_upload_<?php echo esc_js( $type ); ?>').click();"><?php echo esc_html__( 'Upload', 'userswp' ); ?> <?php echo esc_html( $type ); ?></button> |
| 33 |
<p style="text-align: center"><?php echo esc_html__('Note: Max upload image size:', 'userswp') . ' ' . esc_html( $files->uwp_formatSizeUnits($files->uwp_get_max_upload_size($type)) ); ?></p> |
| 34 |
<div class="uwp_upload_field" style="display: none"> |
| 35 |
<input name="uwp_<?php echo esc_attr( $type ); ?>_file" id="uwp_upload_<?php echo esc_attr( $type ); ?>" required="required" type="file" value=""> |
| 36 |
</div> |
| 37 |
</form> |
| 38 |
<div id="progressBar" class="tiny-green progressBar" style="display: none;"><div></div></div> |
| 39 |
</div> |
| 40 |
<div class="uwp-bs-modal-footer"> |
| 41 |
<div class="uwp-<?php echo esc_attr( $type ); ?>-crop-p-wrap"> |
| 42 |
<div id="<?php echo esc_attr( $type ); ?>-crop-actions"> |
| 43 |
<form class="uwp-crop-form" method="post"> |
| 44 |
<input type="hidden" name="uwp_reset_nonce" id="uwp_reset_nonce" value="<?php echo esc_attr( wp_create_nonce( 'uwp_reset_nonce_' . $type . '_' . $user_id ) ); ?>"> |
| 45 |
<input type="submit" name="uwp_<?php echo esc_attr( $type ); ?>_reset" value="<?php esc_html_e('Reset to Default', 'userswp'); ?>" class="button button-primary" id="reset_uwp_<?php echo esc_attr( $type ); ?>" /> |
| 46 |
<input type="submit" name="uwp_<?php echo esc_attr( $type ); ?>_crop" disabled="disabled" value="<?php esc_html_e('Apply', 'userswp'); ?>" class="button button-primary" id="save_uwp_<?php echo esc_attr( $type ); ?>" /> |
| 47 |
</form> |
| 48 |
</div> |
| 49 |
</div> |
| 50 |
<button type="button" data-type="<?php echo esc_attr( $type ); ?>" class="button uwp_modal_btn uwp-modal-close" data-<?php echo ( $aui_bs5 ? 'bs-' : '' ); ?>dismiss="modal"><?php esc_html_e( 'Cancel', 'userswp' ); ?></button> |
| 51 |
</div> |
| 52 |
</div> |
| 53 |
</div> |
| 54 |
</div> |