<?php
/**
 * Adodis Blog package
 * @author J-Extension <contact@jextn.com>
 * @link http://www.jextn.com
 * @copyright (C) 2012 - 2013 J-Extension
 * @license GNU/GPL, see LICENSE.php for full license.
**/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
$user	= JFactory::getUser();
?>
<body onload="nonRegistered()">
<div id="adodis-blog">
	<?php
	if( $this->total > 0 ) {

		if ($this->params->get('show_page_heading', 1)) {
		?>
			<h1>
				<?php
				if ($this->escape($this->params->get('page_heading'))) {
					 echo $this->escape($this->params->get('page_heading'));
				} else {
					echo $this->escape($this->params->get('page_title'));
				}
				?>
			</h1>
		<?php
		}
		?>

		<form action="<?php echo JRoute::_('index.php?option=com_adodisblog&id='.(int) $this->items[0]->blogid); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data" onsubmit="return validateAU()">

			<?php
				echo $this->loadTemplate('blog');
				if($this->params->get('show_comments', 1)){
			?>
				<div>
				<?php
					echo $this->loadTemplate('comments');
				?>
				</div>
				<?php
					if ($user->get('guest')) {
					 	if($this->allowed == 1){
							echo $this->loadTemplate('fields');
					 	}
					} else {
					 	echo $this->loadTemplate('fields');
					}
				}
				?>
			<input type="hidden" name="task" value="comment.save" />
			<input type="hidden" name="blogid" value="<?php echo $this->items[0]->blogid;?>" />
			<input type="hidden" name="frontend" value="1" />
			<input type="hidden" name="userval"  id="userval" value="<?php echo $user->id;?>" />
			<input type="hidden" name="return" value="<?php echo $this->return_page; ?>" />
			<input type="hidden" name="adodis-errorwarning-message" id="adodis-errorwarning-message" value="<?php echo JText::_('COM_ADODISBLOG_VALIDATION_FORM_FAILED'); ?>"/>

			<?php echo JHTML::_( 'form.token' ); ?>
		</form>
	<?php
	}
	if($this->params->get('show_footertext', 1)) {
	?>
		<p class="copyright" style="text-align : right; font-size : 10px;">
			<?php /*require_once( JPATH_COMPONENT . DS . 'copyright' . DS . 'copyright.php' );*/ ?>
		</p>
	<?php
	}
	?>
</div>
</body>