<?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');
    
$currRow = 0;
$showCatSingleCatShowThumb = $this->params->get('single_cat_show_thumb', $this->cparams->get('cview_cat_show_thumb'));
$showResizeThumbs = $this->cparams->get('resize_thumbs');
$showCatSingleCatShowName = $this->params->get('single_cat_show_name', $this->cparams->get('cview_cat_show_name'));
$showCatSingleCatShowDate = $this->params->get('single_cat_show_date', $this->cparams->get('cview_cat_show_date'));
$showCatSingleCatShowHits = $this->params->get('single_cat_show_hits', $this->cparams->get('cview_show_hits'));
$showCatSingleCatShowTags = $this->params->get('single_cat_show_tags', $this->cparams->get('cview_cat_show_tags'));
$showCatSingleCatShowDesc = $this->params->get('single_cat_show_quicktake', $this->cparams->get('cview_cat_show_quicktake'));
$showSingleCatDisplayView = $this->params->get('single_cat_display_view', $this->cparams->get('cview_display_view'));
?>
<div id="xmovie-cat-container-list">
	<?php foreach ($this->subcat as $subCategory) { 
        $link = JRoute::_($subCategory['link']);
        $categoryParams = json_decode($subCategory['params']);
        $thumbnail = $categoryParams->image;
    ?>
	<div class="movie-item row-fluid">
		<?php if ($thumbnail != '' && $showCatSingleCatShowThumb == 1) {?>
		<div class="span3">
			<a href="<?php echo $link; ?>">
				<img class="thumbnail img-fluid" src="<?php echo $thumbnail; ?>" alt="<?php echo htmlspecialchars($subCategory['title']); ?>" />
			</a>
		</div>
		<?php 
} ?>
		<div class="span9 text-left">
			<?php if ($showCatSingleCatShowName == 1) {?>
			<div class="movie-name row-fluid">
				<h4>
					<?php if ($thumbnail == '' || $showCatSingleCatShowThumb != 1) { ?>
					<a href="<?php echo $link; ?>">
						<?php echo $subCategory['title']; ?>
						</a>
					<?php 
} else { 
                        echo $subCategory['title']; 
} ?>
				</h4>
			</div>
			<?php 
} ?>
			<?php if ($showCatSingleCatShowDate || $showCatSingleCatShowTags) {
			?>
			<div class="row-fluid">
			<ul class="inline movie-info-list">
			<?php
} ?>
			<?php if ($showCatSingleCatShowDate) {?>
			<li>
				<strong><?php echo JTEXT::_('DATE_ADDED'); ?>:</strong> <?php echo JHTML::Date($subCategory['created_time'], 'm-d-Y'); ?>
			</li>
			<?php 
} ?>
			<?php if ($showCatSingleCatShowTags) {?>
			<li>
				<?php
				$subCategory['tags'] = new JHelperTags;
				$subCategory['tags']->getItemTags('com_xmovie.category' , $subCategory['id']);
				$subCategory['tagLayout'] = new JLayoutFile('joomla.content.tags');
        ?>
				<strong><?php echo JTEXT::_('TAGS'); ?>:</strong> <?php echo $subCategory['tagLayout']->render($subCategory['tags']->itemTags); ?>
			</li>
			<?php 
} ?>
			<?php if ($showCatSingleCatShowDate || $showCatSingleCatShowTags) {
			?>
			</ul>
			</div>
			<?php
} ?>
		</div>
		<?php if ($showCatSingleCatShowDesc) { ?>
		<div class="row-fluid span9">
		<?php 
            echo $subCategory['description'];    
        ?>	
		</div>
		<?php 
} ?>
	</div>	
	<?php 
} ?>		
</div>
