<?php
/** 
 * @package JCHAT::components::com_jchat
 * @subpackage views
 * @subpackage avatar
 * @subpackage tmpl
 * @author Joomla! Extensions Store
 * @Copyright (C) 2015 - Joomla! Extensions Store
 * @license GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html
 */
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
?>

<script type="text/javascript"<?php echo $this->nonce;?> src="<?php echo $this->liveSite;?>components/com_jchat/js/jquery.js"></script>
<script type="text/javascript"<?php echo $this->nonce;?>> 
	jQuery(function() {
		jQuery('div.closemsgbtn').on('click', function(){
			jQuery(this).parent().css('display', 'none')
		});
		setTimeout(function(){
			jQuery('div.upload_usermessage').fadeOut();
		}, 1000);
	})
</script>
<?php if($this->baseTemplate == 'custom.css'): ?>
	<link type="text/css"<?php echo $this->nonce;?> rel="stylesheet" href="<?php echo $this->liveSite;?>templates/<?php echo $this->joomlaTemplate;?>/css/com_jchat/css/templates/default.css"/>
<?php else: ?>
	<link type="text/css"<?php echo $this->nonce;?> rel="stylesheet" href="<?php echo $this->liveSite;?>components/com_jchat/css/templates/<?php echo $this->baseTemplate;?>"/>
<?php endif;?>
<?php if($this->chatTemplate):?>
	<link type="text/css"<?php echo $this->nonce;?> rel="stylesheet" href="<?php echo $this->liveSite;?>components/com_jchat/css/templates/<?php echo $this->chatTemplate;?>"/>
<?php endif;?>

<form name="deleteform" enctype="multipart/form-data" id="deleteform" method="post" action="index.php">
	    <img class="avatar_img" src="<?php echo $this->liveSite;?>components/com_jchat/images/avatars/<?php echo $this->userAvatar;?>" alt="avatar" />
		<div class="formbutton up">
			<?php if($this->avatarDeleteButton):?>
				<div class="avatar_button_container"><?php echo $this->avatarDeleteButton;?></div>
			<?php endif;?>
			<input type="hidden" name="option" value="com_jchat" />
			<input type="hidden" name="task" value="avatar.deleteEntity" />
			<input type="hidden" name="format" value="raw" />
		</div>
</form>
		
<form name="uploadform" enctype="multipart/form-data" id="uploadform" method="post" action="index.php">
		<input type="file" name="newavatar" />
		<div class="formbutton">
			<div class="avatar_button_container"><input id="avatar_upload" type="submit" value="" /><label for="avatar_upload" class="buttonlabel"><?php echo Text::_('COM_JCHAT_UPLOAD');?></label></div>
			<input type="hidden" name="option" value="com_jchat" />
			<input type="hidden" name="task" value="avatar.saveEntity" />
			<input type="hidden" name="format" value="raw" />
		</div>
</form> 
<?php 		
if(isset($this->gdMissingAlert)) {
	echo $this->gdMissingAlert;
}
?>
<div class="upload_usermessage <?php echo $this->visibleClass . $this->success;?>"><?php echo $this->modelMessage;?><div class="closemsgbtn"></div></div>