<?php
/**
 * @package DJ-Events
 * @copyright Copyright (C) DJ-Extensions.com, All rights reserved.
 * @license http://www.gnu.org/licenses GNU/GPL
 * @author url: http://dj-extensions.com
 * @author email contact@dj-extensions.com
 * @developer Szymon Woronowski - szymon.woronowski@design-joomla.eu
 *
 */

defined('_JEXEC') or die('Restricted access');

$item = $displayData['item'];
$params = $displayData['params'];

$location = array();
if(!empty($item->location)) $location[] = $item->location;
if(!empty($item->address)) $location[] = $item->address;
if(!empty($item->post_code)) $location[] = $item->post_code;
if(!empty($item->city_name)) $location[] = $item->city_name;
$location = implode(', ', $location);


?>

<div class="djev_map_items">
    <h3 class="djev_location">
        <span class="fa fa-map-marker"></span>
        <span class="djev_location_val"><?php echo $location ?></span>
    </h3>
    <div class="djev_item djev_clearfix ">
        <div class="djev_item djev_clearfix <?php echo $item->featured == 1 ? 'djev_featured':'' ?><?php echo ((!$params->get('image', 1) || empty($item->thumb)) ? 'noimage':'') ?>">


            <?php if($params->get('category', 1)) { ?>
                <a href="<?php echo JRoute::_(DJEventsHelperRoute::getEventsListRoute($item->cat_id, 0))?>" class="djev_category" style="<?php echo $item->category_style ?>">
                    <?php if($item->icon_type == 'fa') { ?> <span
                            class="<?php echo $item->fa_icon ?>" aria-hidden="true"></span> <?php } else if($item->icon_type == 'image') { ?>
                        <img src="<?php echo JURI::root(true).'/'.$item->image_icon ?>"
                             alt="" /> <?php } ?> <span><?php echo $item->category_name ?> </span>
                </a>
            <?php } ?>

            <?php if($params->get('title', 1)) { ?>
                <h4 class="djev_item_title">
                    <a href="<?php echo $item->link ?>"> <?php echo JHtml::_('string.truncate', $item->title, $params->get('title_limit', 50), true, false); ?>
                    </a>
                </h4>
            <?php } ?>

            <?php if($params->get('time', 1)) { ?>
                <h5 class="djev_time">
                    <?php
                    $displayData = array('item' => $item, 'params' => $params);
                    $layout = new JLayoutFile('com_djevents.event_time', null, array('component'=> 'com_djevents'));
                    echo $layout->render($displayData); ?>
                </h5>
            <?php } ?>

            <?php if($params->get('intro', 1) && !empty($item->intro)) { ?>
                <div class="djev_intro">
                    <?php echo JHtml::_('string.truncate', $item->intro, $params->get('intro_limit', 100), true, false); ?>
                </div>
            <?php } ?>

        </div>
    </div>
</div>