<?php include('category_breadcrumb.tpl.php'); ?>

<?php if (!empty($tpl['items'])) : ?>

<?php if (!Utility::isEmpty($description = $tpl['format_description']($tpl['category']['description']))) : ?>
<div class="object_desc" id="cat_desc"><?php echo $description; ?></div>
<?php endif; ?>

<?php if ($tpl['pages']['count'] > 1) : ?>
<div id="pages_top">
<?php include('pagination.tpl.php'); ?>
</div>
<?php endif; ?>

<div id="page_thumbs" class="thumbs_items <?php echo $thumbs_items_layout; ?><?php if ($tpl['selection_params']['start']) : ?> selectable<?php endif; ?>">
<?php foreach ($tpl['items'] as &$i) : ?>
	<dl class="<?php if ($i['is_video']) : ?> video<?php endif; ?><?php if ($i['in_selection']) : ?> selected<?php endif; ?>" data-id="<?php echo $i['id']; ?>">
		<dt>
			<a <?php if ($i['description'] && $tpl['config']('thumbs_item_info_description')) : ?>title="<?php echo $tpl['strip_tags']($i['description'], $tpl['config']('thumbs_item_info_description_limit')); ?>"<?php endif; ?> href="<?php echo $i['link']; ?>#content">
<?php if ($i['is_recent']) : ?>
				<span class="new"><?php echo __('Nouveau'); ?></span>
<?php endif; ?>
<?php if ($i['is_video']) : ?>
				<span class="duration" id="videoduration_<?php echo $i['id']; ?>"><?php echo $i['duration_text']; ?></span>
<?php endif; ?>
				<img alt="<?php echo $i['title']; ?>" src="<?php echo $i['thumb_src']($thumbs_items_size); ?>"<?php if ($i['is_video']) : ?> data-video-id="<?php echo $i['id']; ?>"<?php endif; ?>>
<?php if ($i['stats']['views'] || $i['stats']['comments'] || $i['stats']['votes'] || $i['stats']['favorites']) : ?>
				<ul class="stats_icon">
<?php if ($i['stats']['views']) : ?>
					<li class="views"><span><?php echo $i['stats']['views']['short']; ?></span><span>&#xe907;</span></li>
<?php endif; ?>
<?php if ($i['stats']['comments']) : ?>
					<li class="comments"><span><?php echo $i['stats']['comments']['short']; ?></span><span>&#xe932;</span></li>
<?php endif; ?>
<?php if ($i['stats']['votes']) : ?>
					<li class="votes"><span><?php echo $i['stats']['votes']['short']; ?></span><span>&#xe9d9;</span></li>
<?php endif; ?>
<?php if ($i['stats']['favorites']) : ?>
					<li class="favorites"><span><?php echo $i['stats']['favorites']['short']; ?></span><span>&#xe910;</span></li>
<?php endif; ?>
				</ul>
<?php endif; ?>
			</a>
		</dt>
<?php if (($stats = $i['stats']['rating'] || $i['stats']['filter'] || $i['date_created'] || $i['date_published'] || ($i['width'] && $i['height']) || $i['stats']['filesize']) || $i['title'] !== '') : ?>
		<dd>
<?php if ($i['title'] !== '') : ?>
			<span class="title"><a tabindex="-1" href="<?php echo $i['link']; ?>"><?php echo $i['title']; ?></a></span>
<?php endif; ?>
<?php if ($stats) : ?>
			<ul class="stats">
<?php if ($i['stats']['rating']) : ?>
				<li class="rating"><span title="<?php echo $i['stats']['rating']['formated']; ?>"><?php foreach ($i['stats']['rating']['array'] as $k => $v) : ?><span><?php if ($v == 1) : ?>&#xe9d9;<?php elseif ($v == 0) : ?>&#xe9d7;<?php else : ?>&#xe9d8;<?php endif; ?></span><?php endforeach; ?></span></li>
<?php endif; ?>
<?php if ($i['stats']['filter']) : ?>
				<li class="filter"><span><?php echo $i['stats']['filter']['text']; ?></span></li>
<?php endif; ?>
<?php if ($i['date_created']) : ?>
				<li class="date"><span><?php echo $i['date_created_short']; ?></span></li>
<?php endif; ?>
<?php if ($i['date_published']) : ?>
				<li class="date"><span><?php echo $i['date_published_short']; ?></span></li>
<?php endif; ?>
<?php if ($i['width'] && $i['height']) : ?>
				<li class="size"><span><?php echo $i['width']; ?> x <?php echo $i['height']; ?></span></li>
<?php endif; ?>
<?php if ($i['stats']['filesize']) : ?>
				<li class="filesize"><span><?php echo $i['stats']['filesize']['text']; ?></span></li>
<?php endif; ?>
			</ul>
<?php endif; ?>
		</dd>
<?php endif; ?>
	</dl>
<?php endforeach; ?>
</div>

<?php if ($tpl['pages']['count'] > 1) : ?>
<div id="pages_bottom">
<?php include('pagination.tpl.php'); ?>
</div>
<?php endif; ?>

<?php if (!empty($tpl['rss'])) : ?>
<ul id="rss">
	<li><a title="<?php echo $tpl['rss']['items']['title']; ?>" href="<?php echo $tpl['rss']['items']['link']; ?>"><span>&#xe901;</span> <span><?php echo $tpl['rss']['items']['link_text']; ?></span></a></li>
<?php if (!empty($tpl['rss']['comments'])) : ?>
	<li><a title="<?php echo $tpl['rss']['comments']['title']; ?>" href="<?php echo $tpl['rss']['comments']['link']; ?>"><span>&#xe901;</span> <span><?php echo $tpl['rss']['comments']['link_text']; ?></span></a></li>
<?php endif; ?>
</ul>
<?php endif; ?>

<?php elseif (isset($tpl['filter']) && !isset($tpl['search']['invalid'])) : ?>
<br>
<p class="message_info"><?php echo __('Aucun fichier trouvé.'); ?></p>
<br>
<?php endif; ?>
