/media/widgetkit/widgets/gallery/styles/showcase_box/template.php
PHP | 84 lines | 58 code | 17 blank | 9 comment | 7 complexity | 23188906d5dfb35c5fdbcf0c7e2ed82c MD5 | raw file
Possible License(s): LGPL-3.0, GPL-2.0, MIT, BSD-3-Clause, LGPL-2.1
- <?php
- /**
- * @package Widgetkit
- * @author YOOtheme http://www.yootheme.com
- * @copyright Copyright (C) YOOtheme GmbH
- * @license http://www.gnu.org/licenses/gpl.html GNU/GPL
- */
- $widget_id = $widget->id.'-'.uniqid();
- $settings = $widget->settings;
- $captions = array();
- $images = $this['gallery']->images($widget);
- $thumbs = $this['gallery']->images($widget, array('width' => $settings['thumb_width'], 'height' => $settings['thumb_height']));
- $sets = array_chunk($thumbs, $settings['items_per_set']);
- foreach (array_keys($sets) as $s) {
- $nav[] = '<li><span></span></li>';
- }
- $i = 0;
- ?>
- <?php if (count($images)) : ?>
- <div id="gallery-<?php echo $widget_id; ?>" class="wk-gallery-showcasebox" data-widgetkit="showcase" data-options='<?php echo json_encode($settings); ?>'>
- <div id="slideshow-<?php echo $widget_id; ?>" class="wk-slideshow">
- <div class="slides-container">
- <ul class="slides">
- <?php foreach ($images as $image) : ?>
-
- <?php
- $captions[] = '<li>'.(strlen($image['caption']) ? $image['caption']:"").'</li>';
-
- /* Prepare Image */
- $content = '<img src="'.$image['cache_url'].'" width="'.$image['width'].'" height="'.$image['height'].'" alt="'.$image['filename'].'" />';
- /* Lazy Loading */
- $content = ($i==$settings['index']) ? $content : $this['image']->prepareLazyload($content);
- ?>
- <?php if ($image['link']) : ?>
- <li><a class="" href="<?php echo $image['link'] ? $image['link'] : $image['url']; ?>"><?php echo $content; ?></a></li>
- <?php else : ?>
- <li><?php echo $content; ?></li>
- <?php endif; ?>
-
- <?php $i=$i+1;?>
- <?php endforeach; ?>
- </ul>
- <?php if ($settings['buttons']): ?><div class="next"></div><div class="prev"></div><?php endif; ?>
- <div class="caption"></div><ul class="captions"><?php echo implode('', $captions);?></ul>
- </div>
- </div>
- <div id="slideset-<?php echo $widget_id;?>" class="wk-slideset <?php if (!$settings['slideset_buttons']) echo 'no-buttons'; ?>">
- <div>
- <div class="sets">
- <?php foreach ($sets as $set => $items) : ?>
- <ul class="set">
- <?php foreach ($items as $thumb) : ?>
-
- <?php
- /* Prepare Image */
- $content = '<img src="'.$thumb['cache_url'].'" width="'.$thumb['width'].'" height="'.$thumb['height'].'" alt="'.$thumb['filename'].'" />';
- ?>
-
- <li>
- <div><div><?php echo $content; ?></div></div>
- </li>
- <?php endforeach; ?>
- </ul>
- <?php endforeach; ?>
- </div>
- <?php if ($settings['slideset_buttons']): ?><div class="next"></div><div class="prev"></div><?php endif; ?>
- </div>
- </div>
-
- </div>
- <?php else : ?>
- <?php echo "No images found."; ?>
- <?php endif;