<?php
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::_('behavior.core');
JHtml::_('formbehavior.chosen', 'select');
// Get the user object.
$user = JFactory::getUser();
// Check if user is allowed to add/edit based on tags permissions.
// Do we really have to make it so people can see unpublished tags???
$canEdit = $user->authorise('core.edit', 'com_tags');
$canCreate = $user->authorise('core.create', 'com_tags');
$canEditState = $user->authorise('core.edit.state', 'com_tags');
$items = $this->items;
$n = count($this->items);
?>
<form method="post" name="adminForm" id="adminForm" class="form-inline">
<?php if ($this->params->get('show_headings') || $this->params->get('filter_field') || $this->params->get('show_pagination_limit')) : ?>
<?php endif; ?>
<?php if ($this->items == false || $n == 0) : ?>
<p> <?php echo JText::_('COM_TAGS_NO_ITEMS'); ?></p>
<?php else : ?>
<ul class="category">
<?php $colCount = 2; ?>
<?php foreach ($items as $i => $item) : ?>
<?php if ($i % $colCount == 0) : ?>
<div class="row-block cat_row_tags">
<?php endif; ?>
<?php if ($item->core_state == 0) : ?>
<div class="list-item system-unpublished">
<?php else: ?>
<div class="cat_list_tags">
<div class="create"> <!-- вывод даты -->
<?php echo JHtml::_('date', $item->core_created_time, JText::_('DATE_FORMAT_LC2')); ?>
</div>
<div class="pull-left item-image"> <!-- вывод изображения из полного текста-->
<?php $images = json_decode($item->core_images);?>
<?php if ($this->params->get('tag_list_show_item_image', 1) == 1 && !empty($images->image_fulltext)) :?>
<a href="<?php echo JRoute::_(TagsHelperRoute::getItemRoute($item->content_item_id, $item->core_alias, $item->core_catid, $item->core_language, $item->type_alias, $item->router)); ?>">
<img src="<?php echo htmlspecialchars($images->image_fulltext);?>" alt="<?php echo htmlspecialchars($images->image_fulltext_alt); ?>">
</a>
<?php endif; ?>
</div>
<div class="page-header">
<h3 class="article_title">
<a href="<?php echo JRoute::_(TagsHelperRoute::getItemRoute($item->content_item_id, $item->core_alias, $item->core_catid, $item->core_language, $item->type_alias, $item->router)); ?>">
<?php echo $this->escape($item->core_title); ?>
</a>
</h3>
</div>
<?php endif; ?>
<?php echo $item->event->afterDisplayTitle; ?>
<?php ?>
<?php if ($this->params->get('tag_list_show_item_description', 1)) : ?>
<?php echo $item->event->beforeDisplayContent; ?>
<?php echo JHtml::_('string.truncate', (strip_tags($item->core_body)), $this->params->get('tag_list_item_maximum_characters')); ?>
<?php echo $item->event->afterDisplayContent; ?>
<?php endif; ?>
</div>
<?php if (($i % $colCount == ($colCount -1)) || ($i == count($this->items)-1)) : ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</form>