1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
Oinktube/view/userPhotoUploadInclude.php
2022-02-17 14:46:17 -03:00

45 lines
No EOL
1.3 KiB
PHP

<?php
$finalWidth = 150;
$finalHeight = 150;
$screenWidth = 150;
$caUid = 'Photo_' . uniqid();
?>
<div class="form-group" id="<?php echo $caUid; ?>">
<?php
$croppie = getCroppie(__('Profile Photo'), 'userPhotoUpload', $finalWidth, $finalHeight, $screenWidth);
echo $croppie['html'];
?>
</div>
<button class="btn btn-success btn-block" type="button" onclick="<?php echo $croppie['getCroppieFunction']; ?>"><i class="fas fa-save"></i> <?php echo __('Save Profile Photo'); ?></button>
<?php
if ($vloObj = AVideoPlugin::getDataObjectIfEnabled('VideoLogoOverlay')) {
if ($vloObj->useUserChannelImageAsLogo) {
?>
<div class="alert alert-info"><?php echo __("This image will appear in your livestream"); ?></div>
<?php
}
}
?>
<script>
$(document).ready(function () {
<?php
echo $croppie['restartCroppie'] . "('" . User::getPhoto() . "');";
?>
});
function userPhotoUpload(image) {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL'] . "objects/uploadUserPhoto.json.php"; ?>',
data: {
image: image
},
type: 'post',
success: function (response) {
avideoResponse(response);
modal.hidePleaseWait();
}
});
}
</script>