<?php

/**
 *
 * offline view
 *
 * @version             1.0.0
 * @package             Gavern Framework
 * @copyright			Copyright (C) 2010 - 2011 GavickPro. All rights reserved.
 *               
 */
 
// No direct access.
defined('_JEXEC') or die;

$app = JFactory::getApplication();

$uri = JURI::getInstance();
jimport('joomla.factory');

// get necessary template parameters
$templateParams = JFactory::getApplication()->getTemplate(true)->params;
$pageName = JFactory::getDocument()->getTitle();
$template_style = $templateParams->get('template_color');

// get logo configuration
$logo_image = $templateParams->get('logo_image');
$logo_text = $templateParams->get('logo_text', '');
$logo_gravatar = $templateParams->get('logo_gravatar', '');

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
	<jdoc:include type="head" />
	<link href="//fonts.googleapis.com/css?family=PT+Serif:400,700" rel="stylesheet" type="text/css" />
	<link href="//fonts.googleapis.com/css?family=Roboto+Condensed:400,700,300'" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="<?php echo JURI::base(); ?>templates/<?php echo $this->template; ?>/css/system/offline.style<?php echo $template_style; ?>.css" type="text/css" />
</head>
<body>
	<div id="gkPage">
	    <div id="gkPageWrap">
		     <div id="gk-header">
			     <div>
			     <?php if (!$app->getCfg('offline_image')): ?>
					<?php if($logo_image != '') : ?>
					<a href="<?php echo JURI::root(); ?>" id="gk-logo"><img src="<?php echo JURI::root() . $logo_image; ?>" alt="" /></a>
					<?php endif; ?>
					
					<?php if($logo_image == '' && $logo_gravatar != '') : ?>
					<a href="<?php echo JURI::root(); ?>" id="gk-logo"><img src="//www.gravatar.com/avatar/<?php echo md5(strtolower(trim($logo_gravatar))); ?>.jpg?s=120" alt="" /></a>
					<?php endif; ?>
						
					<?php if($logo_text != '') : ?>
					<strong id="gk-logo-text"><?php echo str_replace('[br]', ' ', $templateParams->get('logo_text', '')); ?></strong>
					<?php endif; ?>
	             <?php else : ?>
					<?php if($app->getCfg('offline_image')) : ?>
					<a href="./" id="gk-logo">
					    <img src="<?php echo $app->getCfg('offline_image'); ?>" alt="<?php echo $app->getCfg('sitename'); ?>" />
					</a>
					<?php endif; ?>
	             <?php endif; ?>
	             </div>
             </div>
        </div>
		<div id="gkPageWrap">      
		     <div id="frame">
		            <h2><?php echo $app->getCfg('offline_message'); ?></h2>
		           
		           	<jdoc:include type="message" />
		           
		            <form action="index.php" method="post" name="login" id="form-login">
		                  
		                  <fieldset class="input">
		                        <p id="username">
		                              <label for="username"><?php echo JText::_('JGLOBAL_USERNAME') ?></label>
		                              <input name="username" id="username" type="text" class="inputbox" alt="<?php echo JText::_('JGLOBAL_USERNAME') ?>" size="50" />
		                        </p>
		                        <p id="password">
		                              <label for="passwd"><?php echo JText::_('JGLOBAL_PASSWORD') ?></label>
		                              <input type="password" name="password" class="inputbox" size="50" alt="<?php echo JText::_('JGLOBAL_PASSWORD') ?>" id="passwd" />
		                        </p>
		                       
		                       
		                        <div class="buttons">
		                              <input type="submit" name="Submit" class="button" value="<?php echo JText::_('JLOGIN') ?>" />
		                        </div>
		                        <input type="hidden" name="option" value="com_users" />
		                        <input type="hidden" name="task" value="user.login" />
		                        <input type="hidden" name="return" value="<?php echo base64_encode(JURI::base()) ?>" />
		                        <?php echo JHtml::_('form.token'); ?>
		                  </fieldset>
		            </form>
		      </div>
	      </div>
	</div>
</body>
</html>
