<?php
// Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl.'/js/unitegallery/js/unitegallery.min.js', CClientScript::POS_END);
// Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl . '/js/unitegallery/css/unite-gallery.css');
// //Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl.'/js/unitegallery/themes/tiles/ug-theme-tiles.js', CClientScript::POS_END);
// Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl.'/js/unitegallery/themes/tilesgrid/ug-theme-tilesgrid.js', CClientScript::POS_END);
// //Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl . '/js/unitegallery/themes/default/ug-theme-default.css');
// Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . '/js/slick/slick.min.js', CClientScript::POS_BEGIN);
// Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl . '/js/slick/slick.css');
// Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl . '/js/slick/slick-theme.css');

Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . '/js/owl2/owl.carousel.min.js', CClientScript::POS_BEGIN);
Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl . '/js/owl2/assets/owl.carousel.min.css');
Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl . '/js/owl2/assets/owl.theme.default.css');


$count = 1;

if ($this->images) {

    ?>
    <div class="slinky-gallery<?php echo $this->objectId; ?> owl-carousel owl-theme">
        <?php
        foreach ($this->images as $image) {
            ?>

            <a href="<?php echo Images::getFullSizeUrl($image); ?>" data-lightbox="set<?php echo $this->objectId; ?>">
                <img src="<?php echo Images::getThumbUrl($image, 420, 230); ?>"
                     alt="<?php echo Images::getAlt($image); ?>"
                     data-image="<?php echo Images::getFullSizeUrl($image); ?>">
            </a>

            <?php // $count++; if($count>5) break;  ?>
        <?php } ?>

    </div>
    <script type="text/javascript">
        var api;
        jQuery(document).ready(function () {

            $('.owl-carousel<?php echo $this->objectId; ?>').owlCarousel({
                loop: true,
                margin: 10,
                responsiveClass: true,
                dots: false,
                navText: ['<i class="fa fa-angle-left" aria-hidden="true"></i>', '<i class="fa fa-angle-right" aria-hidden="true"></i>'],
                responsive: {
                    0: {
                        items: 1,
                        nav: true
                    },
                    600: {
                        items: 1,
                        nav: false
                    },
                    1000: {
                        items: 1,
                        nav: true,
                        loop: false
                    }
                }
            })

        });
    </script>
<?php } ?>

