<?php
/*
 * @package Joomla 3.0
 * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 *
 * @component XMovie Component
 * @copyright Copyright (C) Dana Harris optikool.com
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 */
defined('_JEXEC') or die('Restricted access');
$singleCviewShowDate = $this->params->get('single_show_date', $this->cparams->get('cview_show_date'));
$singleCviewShowHits = $this->params->get('single_show_hits', $this->cparams->get('cview_show_hits'));
$singleCviewShowSubmiter = $this->params->get('single_show_submitter', $this->cparams->get('cview_show_submitter'));
$singleCviewShowDescription = $this->params->get('single_show_description', $this->cparams->get('cview_show_description'));
$singleCviewShowTags = $this->params->get('single_show_tags', $this->cparams->get('cview_show_tags'));

$videoTemplate = MovieHelper::getVideoTemplate($this->item->type);
$this->size = MovieHelper::getVideoDimensions($this->item->width, $this->item->height);
$this->videoLink = MovieHelper::getResolvedMovieLink($this->item->link);
$this->posterLink = MovieHelper::getResolvedMovieImage($this->item->thumb);
$this->item->description = trim($this->item->introtext) != '' ? $this->item->introtext .  $this->item->fulltext : $this->item->fulltext;
?>

<div class="container-fluid">
	<h4><?php echo $this->escape($this->item->title); ?></h4>
	<?php if ($singleCviewShowDate || $singleCviewShowHits || $singleCviewShowSubmiter || $singleCviewShowTags) { ?>
	<div class="row-fluid">
		<ul class="inline movie-info">
	<?php } ?>
		<?php if ($singleCviewShowDate) { ?>
			<li><strong><?php echo JTEXT::_('DATE_ADDED'); ?>:</strong> <?php echo JHTML::Date($this->item->creation_date, 'm-d-Y'); ?></li>
		<?php } ?>
		<?php if ($singleCviewShowHits) { ?>
			<li><strong><?php echo JTEXT::_('HITS'); ?>:</strong> <?php echo $this->item->hits; ?></li>
		<?php } ?>
		<?php if ($singleCviewShowSubmiter) { ?>
			<li><strong><?php echo JTEXT::_('SUBMITTER'); ?>:</strong> <?php echo $this->item->submitter; ?></li>
		<?php } ?>
		<?php if ($singleCviewShowTags) {
			$this->item->tags = new JHelperTags;
			$this->item->tags->getItemTags('com_xmovie.movie' , $this->item->id);
			$this->item->tagLayout = new JLayoutFile('joomla.content.tags');
        ?>
			<li><strong><?php echo JTEXT::_('TAGS'); ?>:</strong> <?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?></li>
		<?php } ?>
	<?php if ($singleCviewShowDate || $singleCviewShowHits || $singleCviewShowSubmiter || $singleCviewShowTags) { ?>
		</ul>
	</div>
	<?php } ?>
	<div class="row-fluid">
		<?php echo $this->loadTemplate($videoTemplate); ?>
	</div>
	<?php if ($singleCviewShowDescription) { ?>
	<div class="row-fluid">
		<?php echo $this->item->description; ?>
	</div>
	<?php } ?>
</div>


