<?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;
$image_directory = JComponentHelper::getParams('com_media') -> get('image_path', 'images') . '/';
$mainCatShowThumb = $this -> params -> get('cat_show_thumb');
$mainResizeThumbs = $this -> cparams -> get('resize_thumbs');
$mainCatShowName = $this -> params -> get('cat_show_name');
$mainCatShowDate = $this -> params -> get('cat_show_date');
$mainCatShowHits = $this -> params -> get('cat_show_hits');
$mainCatShowTags =  $this -> params -> get('cat_show_tags');
$mainCatShowDescription = $this -> params -> get('cat_show_description');
$mainDisplayViewCat = $this -> params -> get('display_view_cat');
?>
<div id="xmovie-cat-container-list">
	<?php foreach($this->subcat as $subCategory) {
$link = JRoute::_($subCategory['link']);
$categoryParams = json_decode($subCategory['params']);
    ?>
	<div class="movie-item row-fluid">
		<?php if ($categoryParams->image != '' && $mainCatShowThumb == 1) { ?>
		<div class="span3">
			<a href="<?php echo $link; ?>"> <?php
            ?><img class="thumbnail img-fluid" src="<?php echo $categoryParams->image; ?>" alt="<?php echo htmlspecialchars($subCategory['title']); ?>" /> </a>
		</div>
		<?php } ?>
		<div class="span9 text-left">
			<?php if ($mainCatShowName == 1) {
            ?>
			<div class="movie-name row-fluid">
				<h4><?php if($categoryParams->image == '' || $mainCatShowThumb != 1) {
                ?>
				<a href="<?php echo $link; ?>"> <?php echo $subCategory['title']; ?></a><?php 
} else {
                    echo $subCategory['title']; 
}
                ?></h4>
			</div>
			<?php 
} ?>
			<?php if ($mainCatShowDate || $mainCatShowTags) {
			?>
			<div class="row-fluid">
			<ul class="inline movie-info-list">
			<?php
} ?>
			<?php if ($mainCatShowDate) {
            ?>
			<li>
				<strong><?php echo JTEXT::_('DATE_ADDED'); ?>:</strong> <?php echo JHTML::Date($subCategory['created_time'], 'm-d-Y'); ?>
			</li>
			<?php 
} ?>
			<?php if ($mainCatShowTags) {
            ?>
			<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 ($mainCatShowDate || $mainCatShowTags) {
			?>
			</ul>
			</div>
			<?php
} ?>
		</div>
		<?php if ($mainCatShowDescription) {
        ?>
		<div class="row-fluid span9">
			<?php
            if ($subCategory['description'] != '') {
                echo $subCategory['description'];
            }
            ?>
		</div>
		<?php 
} ?>
	</div>
	<?php 
} ?>
</div>
