PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 3.37
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v3.37
3.37 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 All 142 releases
← All changes | Lightboxes/Fancybox2.php +19 -7 2.43 → 3.37 View file →
@@ -1,21 +1,33 @@
1 1 <?php
2 +
2 3 namespace Photonic_Plugin\Lightboxes;
3 4
4 -require_once('Lightbox.php');
5 +use Photonic_Plugin\Lightboxes\Features\Show_Videos_Inline;
6 +use Photonic_Plugin\Platforms\Base;
5 7
8 +require_once 'Lightbox.php';
9 +require_once 'Features/Show_Videos_Inline.php';
10 +
6 11 class Fancybox2 extends Lightbox {
12 + use Show_Videos_Inline;
13 +
7 14 protected function __construct() {
8 15 $this->library = 'fancybox2';
9 16 parent::__construct();
10 - $this->class = ['photonic-launch-gallery', 'launch-gallery-fancybox', 'fancybox'];
17 + $this->class = ['photonic-lb', 'photonic-fancybox', 'fancybox'];
11 18 }
12 19
13 - function get_photo_attributes($photo_data, $module) {
14 - if ($module->provider == 'google') {
20 + public function get_photo_attributes(array $photo_data, Base $module): array {
21 + $out = parent::get_photo_attributes($photo_data, $module);
22 + if ('google' === $module->provider) {
15 23 if (empty($photo_data['video'])) {
16 - return " data-fancybox='{type: \"image\"}' ";
24 + $out['data-fancybox'] = '{type: \"image\"}';
17 25 }
18 26 }
19 - return !empty($photo_data['video']) ? ' data-html5-href="'.$photo_data['video'].'" ': '';
27 +
28 + if (!empty($photo_data['video'])) {
29 + $out['data-html5-href'] = $photo_data['video'];
30 + }
31 + return $out;
20 32 }
21 -}
33 +}