PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 2.44
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v2.44
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 2.45 All 140 releases
photonic / Lightboxes / Lightbox.php

Lightbox.php in Photonic Gallery & Lightbox for Flickr, SmugMug & Others 2.44, at Lightboxes/Lightbox.php

57 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Photonic_Plugin\Lightboxes;
3
4 use Photonic_Plugin\Modules\Core;
5
6 abstract class Lightbox {
7 /** @var array */
8 var $class;
9
10 var $supports_video;
11
12 var $library;
13
14 /**
15 * Lightbox constructor.
16 */
17 protected function __construct() {
18 require_once(PHOTONIC_PATH.'/Modules/Core.php');
19 $this->class = ['photonic-launch-gallery', 'launch-gallery-'.$this->library, $this->library];
20 }
21
22 final public static function get_instance() {
23 static $instances = array();
24 $called_class = get_called_class();
25
26 if (!isset($instances[$called_class])) {
27 $instances[$called_class] = new $called_class();
28 }
29 return $instances[$called_class];
30 }
31
32 /**
33 * @param $rel_id
34 * @param Core $module
35 * @return array
36 */
37 function get_gallery_attributes($rel_id, $module) {
38 return [
39 'class' => $this->class,
40 'rel' => ['lightbox-photonic-'.$module->provider.'-stream-'.(empty($rel_id) ? $module->gallery_index : $rel_id)],
41 'specific' => [],
42 ];
43 }
44
45 /**
46 * Some lightboxes require some additional attributes for individual photos. E.g. Lightgallery requires something to show the title etc.
47 * This method returns such additional information. Not to be confused with <code>get_lightbox_attributes</code>, which
48 * returns information for the gallery as a whole.
49 *
50 * @param $photo_data
51 * @param Core $module
52 * @return string
53 */
54 function get_photo_attributes($photo_data, $module) {
55 return '';
56 }
57 }