PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 2.24
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v2.24
3.36 3.35 3.34 3.33 2.19 2.20 2.21 2.22 2.23 2.24 2.25 2.26 2.27 2.28 2.29 2.30 2.31 2.32 2.33 2.34 2.40 2.41 2.42 2.43 2.44 All 141 releases
photonic / layouts / Layout_Slideshow.php

Layout_Slideshow.php in Photonic Gallery & Lightbox for Flickr, SmugMug & Others 2.24, at layouts/Layout_Slideshow.php

63 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Generates the slideshow layout for level 1 objects. Level 2 cannot be displayed as slideshows.
5 */
6 class Photonic_Layout_Slideshow extends Photonic_Layout {
7 function generate_level_1_gallery($photos, $options, $short_code, $processor) {
8 global $photonic_wp_slide_adjustment, $photonic_wp_slide_align;
9 if (!is_array($photos) || empty($photos)) {
10 return '';
11 }
12
13 $data_attr = '';
14 foreach ($short_code as $key => $value) {
15 if (in_array($key, array('speed', 'timeout', 'fx', 'pause', 'layout', 'strip-style', 'controls', 'columns'))) {
16 $data_attr .= 'data-photonic-'.$key.'="'.esc_attr($value).'" ';
17 }
18 }
19
20 $style = empty($short_code['style']) ? (empty($short_code['layout']) ? '' : $short_code['layout']) : $short_code['style'];
21 $title_position = empty($short_code['title_position']) ? $options['title_position'] : $short_code['title_position'];
22 $ret = "<div class='photonic-slideshow {$style} title-display-{$title_position} fix'>\n";
23 $ret .= "\t<ul id='photonic-slideshow-{$processor->gallery_index}' class='photonic-slideshow-content fix photonic-slideshow-$photonic_wp_slide_adjustment ".(!empty($photonic_wp_slide_align) ? 'photonic-slide-center' : '')."' $data_attr>\n";
24
25 foreach ( $photos as $photo ) {
26 $ret .= "\t\t<li class='photonic-slideshow-img' data-thumb='{$photo['thumbnail']}'>\n";
27 $title = esc_attr($photo['title']);
28 $description = esc_attr($photo['description']);
29 if ($short_code['caption'] == 'desc' || ($short_code['caption'] == 'title-desc' && empty($title)) || ($short_code['caption'] == 'desc-title' && !empty($description))) {
30 $title = $description;
31 }
32 else if (($short_code['caption'] == 'desc-title' && empty($title)) || $short_code['caption'] == 'none') {
33 $title = '';
34 }
35
36 if (!isset($photo['video'])) {
37 if ($title_position == 'tooltip') {
38 $tooltip = 'data-photonic-tooltip="'.esc_attr($title).'" ';
39 }
40 else {
41 $tooltip = '';
42 }
43 $ret .= "\t\t\t<img src='".$photo['main_image']."' alt='{$title}' title='".(($title_position == 'regular' || $title_position == 'tooltip') ? $title : '')."' $tooltip id='photonic-slideshow-{$processor->gallery_index}-{$photo['id']}' />\n";
44 }
45 else {
46 $ret .="\t\t<video controls loop><source src='{$photo['video']}' type='video/mp4'><img src='{$photo['main_image']}' alt=''></video>";
47 }
48
49 $shown_title = '';
50 if (in_array($title_position, array('below', 'hover-slideup-show', 'hover-slidedown-show', 'slideup-stick')) && !empty($title)) {
51 $shown_title = "\t\t\t".'<div class="photonic-title-info">'."\n\t\t\t\t".'<div class="photonic-photo-title photonic-title">'.wp_specialchars_decode($title, ENT_QUOTES).'</div>'."\n\t\t\t".'</div>'."\n";
52 }
53
54 if (!empty($title)) {
55 $ret .= $shown_title;
56 }
57 $ret .= "\t\t</li>\n";
58 }
59 $ret .= "\t</ul>\n</div><!-- .photonic-slideshow-->\n";
60 return $ret;
61 }
62 }
63