<?php
/**
 * @version		2.6.x
 * @package		K2
 * @author		JoomlaWorks http://www.joomlaworks.net
 * @copyright	Copyright (c) 2006 - 2014 JoomlaWorks Ltd. All rights reserved.
 * @license		GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;
?>
<?php if(count($items)): ?> 
<div id="t-banner_slider-<?php echo $module->id; ?>" class="carousel bx-wrapper slide carousel-fade" data-ride="carousel">    
    <div class="carousel-inner" role="listbox">
        <?php $indicators = ''; ?>
        <?php foreach ($items as $key=>$item): ?>
        <?php $active = ( !$key ? ' active' : '' ); ?>
        <?php $indicators .= "<div class='bx-pager-item'><a href='#t-banner_slider-{$module->id}' data-slide-to='{$key}' class='bx-pager-link {$active}'>{$key}</a></div>"; ?>
        <div class="item<?php echo $active; ?>">
            <?php if($params->get('itemImage') && isset($item->image)): ?>
              <img src="<?php echo $item->imageXLarge; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($item->title); ?>"/>
            <?php endif; ?>                      
            <div class="t-slider-content">
            <?php if($params->get('itemTitle')): ?>
                <h2><?php echo $item->title; ?></h2>
            <?php endif; ?>
            <?php if($params->get('itemIntroText')): ?>
              <h1><?php echo $item->introtext; ?></h1>
            <?php endif; ?>
            </div> 
            <?php if($params->get('itemExtraFields') && count($item->extra_fields)): ?>
            <div class="t-slide-button">
                <?php foreach ($item->extra_fields as $extraField): ?>
                        <?php if($extraField->value != '' and $extraField->type != 'header'): ?>
                        <span class="moduleItemExtraFieldsValue"><?php echo $extraField->value; ?></span>
                        <?php endif; ?>
                <?php endforeach; ?>   
            </div>
            <?php endif; ?> 
        </div>
        <?php endforeach; ?>       
    </div> 
    <?php if( $indicators ) : ?>
    <div class="bx-controls bx-has-pager">
        <div class="bx-pager bx-default-pager carousel-indicators"><?php echo $indicators; ?></div>
    </div>
    <?php endif; ?>
</div> 
<?php endif; ?>