| @@ -1,49 +1,49 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Template for displaying user avatar editor for changing avatar in user profile. | |
| 4 | - * | |
| 5 | - * This template can be overridden by copying it to yourtheme/learnpress/settings/tabs/avatar.php. | |
| 6 | - * | |
| 7 | - * @author ThimPress | |
| 8 | - * @package Learnpress/Templates | |
| 9 | - * @version 4.0.0 | |
| 10 | - */ | |
| 11 | - | |
| 12 | -defined( 'ABSPATH' ) || exit(); | |
| 13 | -$profile = LP_Profile::instance(); | |
| 14 | -if ( ! $profile ) { | |
| 15 | - return; | |
| 16 | -} | |
| 17 | -$image_url = $profile->get_upload_profile_src(); | |
| 18 | -?> | |
| 19 | - | |
| 20 | -<div id="learnpress-avatar-upload"> | |
| 21 | - <div class="learnpress_avatar"> | |
| 22 | - <div class="learnpress_avatar__cropper <?php echo esc_attr( $image_url ? '' : 'lp-hidden' ); ?>"> | |
| 23 | - <img class="learnpress-avatar-image" src="<?php echo esc_attr( $image_url ); ?>" alt=""> | |
| 24 | - <div> | |
| 25 | - <button class="learnpress_avatar__button lp-button learnpress_avatar__button--replace"><?php esc_html_e( 'Replace', 'learnpress' ); ?></button> | |
| 26 | - <button class="learnpress_avatar__button lp-button learnpress_avatar__button--remove "><?php esc_html_e( 'Remove', 'learnpress' ); ?></button> | |
| 27 | - <button class="learnpress_avatar__button lp-button learnpress_avatar__button--save <?php echo esc_attr( $image_url ? 'lp-hidden' : '' ); ?>"><?php esc_html_e( 'Save', 'learnpress' ); ?></button> | |
| 28 | - <button class="learnpress_avatar__button lp-button learnpress_avatar__button--cancel <?php echo esc_attr( $image_url ? 'lp-hidden' : '' ); ?>"><?php esc_html_e( 'Cancel', 'learnpress' ); ?></button> | |
| 29 | - </div> | |
| 30 | - </div> | |
| 31 | - <form class="learnpress-avatar-form <?php echo esc_attr( $image_url ? 'lp-hidden' : '' ); ?>"> | |
| 32 | - <div class="learnpress_avatar__form"> | |
| 33 | - <div class="learnpress_avatar__form-group"> | |
| 34 | - <label for="avatar-file"> | |
| 35 | - <div class="learnpress_avatar__form__upload"> | |
| 36 | - <div><span><svg viewBox="64 64 896 896" focusable="false" data-icon="plus" width="1em" height="1em" fill="currentColor" aria-hidden="true"> | |
| 37 | - <path d="M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"></path> | |
| 38 | - <path d="M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"></path> | |
| 39 | - </svg></span> | |
| 40 | - <div><?php esc_html_e( 'Upload', 'learnpress' ); ?></div> | |
| 41 | - </div> | |
| 42 | - </div> | |
| 43 | - <input type="file" id="avatar-file" accept="image/*"> | |
| 44 | - </label> | |
| 45 | - </div> | |
| 46 | - </div> | |
| 47 | - </form> | |
| 48 | - </div> | |
| 49 | -</div> | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Template for displaying user avatar editor for changing avatar in user profile. | |
| 4 | + * | |
| 5 | + * This template can be overridden by copying it to yourtheme/learnpress/settings/tabs/avatar.php. | |
| 6 | + * | |
| 7 | + * @author ThimPress | |
| 8 | + * @package Learnpress/Templates | |
| 9 | + * @version 4.0.0 | |
| 10 | + */ | |
| 11 | + | |
| 12 | +defined( 'ABSPATH' ) || exit(); | |
| 13 | +$profile = LP_Profile::instance(); | |
| 14 | +if ( ! $profile ) { | |
| 15 | + return; | |
| 16 | +} | |
| 17 | +$image_url = $profile->get_upload_profile_src(); | |
| 18 | +?> | |
| 19 | + | |
| 20 | +<div id="learnpress-avatar-upload"> | |
| 21 | + <div class="learnpress_avatar"> | |
| 22 | + <div class="learnpress_avatar__cropper <?php echo esc_attr( $image_url ? '' : 'lp-hidden' ); ?>"> | |
| 23 | + <img class="learnpress-avatar-image" src="<?php echo esc_attr( $image_url ); ?>" alt=""> | |
| 24 | + <div> | |
| 25 | + <button class="learnpress_avatar__button lp-button learnpress_avatar__button--replace"><?php esc_html_e( 'Replace', 'learnpress' ); ?></button> | |
| 26 | + <button class="learnpress_avatar__button lp-button learnpress_avatar__button--remove "><?php esc_html_e( 'Remove', 'learnpress' ); ?></button> | |
| 27 | + <button class="learnpress_avatar__button lp-button learnpress_avatar__button--save <?php echo esc_attr( $image_url ? 'lp-hidden' : '' ); ?>"><?php esc_html_e( 'Save', 'learnpress' ); ?></button> | |
| 28 | + <button class="learnpress_avatar__button lp-button learnpress_avatar__button--cancel <?php echo esc_attr( $image_url ? 'lp-hidden' : '' ); ?>"><?php esc_html_e( 'Cancel', 'learnpress' ); ?></button> | |
| 29 | + </div> | |
| 30 | + </div> | |
| 31 | + <form class="learnpress-avatar-form <?php echo esc_attr( $image_url ? 'lp-hidden' : '' ); ?>"> | |
| 32 | + <div class="learnpress_avatar__form"> | |
| 33 | + <div class="learnpress_avatar__form-group"> | |
| 34 | + <label for="avatar-file"> | |
| 35 | + <div class="learnpress_avatar__form__upload"> | |
| 36 | + <div><span><svg viewBox="64 64 896 896" focusable="false" data-icon="plus" width="1em" height="1em" fill="currentColor" aria-hidden="true"> | |
| 37 | + <path d="M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"></path> | |
| 38 | + <path d="M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"></path> | |
| 39 | + </svg></span> | |
| 40 | + <div><?php esc_html_e( 'Upload', 'learnpress' ); ?></div> | |
| 41 | + </div> | |
| 42 | + </div> | |
| 43 | + <input type="file" id="avatar-file" accept="image/*"> | |
| 44 | + </label> | |
| 45 | + </div> | |
| 46 | + </div> | |
| 47 | + </form> | |
| 48 | + </div> | |
| 49 | +</div> | |