<?php
/**
 * @package    VP Advanced User
 * @author     Abhishek Das <info@virtueplanet.com>
 * @copyright  Copyright (C) 2012-2019 VirtuePlanet Services LLP. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 * @link       https://www.virtueplanet.com
 */

defined('_JEXEC') or die;

JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
JHtml::_('vpadvanceduser.loadjs');

JHtml::_('vpadvanceduser.stylesheet', 'com_vpadvanceduser/general.css', array(), true);
?>
<div class="vp-wrapper vp-login-page<?php echo $this->pageclass_sfx ?>">
	<?php if ($this->myparams->get('show_page_heading')) : ?>
	<div class="page-header">
		<h1><?php echo $this->escape($this->myparams->get('page_heading')) ?></h1>
	</div>
	<?php endif; ?>
	<?php if (($this->myparams->get('logindescription_show') == 1 && str_replace(' ', '', $this->myparams->get('login_description')) != '') || $this->myparams->get('login_image') != '') : ?>
		<div class="login-description">
	<?php endif; ?>
	<?php if ($this->myparams->get('logindescription_show') == 1) : ?>
		<?php echo $this->myparams->get('login_description') ?>
	<?php endif; ?>
	<?php if (($this->myparams->get('login_image') != '')) : ?>
		<img src="<?php echo $this->escape($this->myparams->get('login_image')); ?>" class="login-image" alt="<?php echo JText::_('COM_USERS_LOGIN_IMAGE_ALT')?>" />
	<?php endif; ?>
	<?php if (($this->myparams->get('logindescription_show') == 1 && str_replace(' ', '', $this->myparams->get('login_description')) != '') || $this->myparams->get('login_image') != '') : ?>
		</div>
	<?php endif; ?>
	<?php if($this->show_tabs) : ?>
		<div class="vp-tabs vp-clearfix">
			<ul>
				<li class="vp-active">
					<a href="#vp-login-content" data-tabfor="login"><?php echo JText::_('JLOGIN') ?></a>
				</li>
				<li>
					<a href="#vp-registration-content" data-tabfor="registration"><?php echo JText::_('JREGISTER') ?></a>
				</li>
			</ul>
		</div>
		<div class="vp-clearfix"></div>
	<?php endif ?>
	<?php if($this->user->get('guest') || !empty($this->cookieLogin)) : ?>
		<div class="vp-tab-contents">
			<?php if(!$this->reg_inprocess) : ?>
				<?php echo $this->loadTemplate('login') ?>
			<?php endif ?>
			<?php if($this->params->get('allowUserRegistration')) : ?>
				<?php echo $this->loadTemplate('registration') ?>
			<?php endif ?>
		</div>
		<?php if(!$this->reg_inprocess && $this->myparams->get('show_resend', 1) && $this->params->get('useractivation')) : ?>
			<div class="vp-empty-box">
				<a href="<?php echo JRoute::_(VPAdvancedUserHelperRoute::getURL('resend')) ?>">
					<?php echo JText::_('COM_VPADVANCEDUSER_RESEND_ACTIVATION') ?>
				</a>
			</div>
		<?php endif ?>
	<?php else : ?>
		<?php echo $this->loadTemplate('logout') ?>
	<?php endif ?>
</div>