| 1 |
<?php |
| 2 |
|
| 3 |
namespace Photonic_Plugin\Lightboxes; |
| 4 |
|
| 5 |
use Photonic_Plugin\Lightboxes\Features\Show_Videos_Inline; |
| 6 |
use Photonic_Plugin\Platforms\Base; |
| 7 |
|
| 8 |
require_once 'Lightbox.php'; |
| 9 |
require_once 'Features/Show_Videos_Inline.php'; |
| 10 |
|
| 11 |
class Fancybox extends Lightbox { |
| 12 |
use Show_Videos_Inline; |
| 13 |
|
| 14 |
protected function __construct() { |
| 15 |
$this->library = 'fancybox'; |
| 16 |
parent::__construct(); |
| 17 |
} |
| 18 |
|
| 19 |
public function get_photo_attributes(array $photo_data, Base $module): array { |
| 20 |
$out = parent::get_photo_attributes($photo_data, $module); |
| 21 |
if ('google' === $module->provider) { |
| 22 |
if (empty($photo_data['video'])) { |
| 23 |
$out['data-fancybox'] = '{type: \"image\"}'; |
| 24 |
} |
| 25 |
} |
| 26 |
|
| 27 |
if (!empty($photo_data['video'])) { |
| 28 |
$out['data-html5-href'] = $photo_data['video']; |
| 29 |
} |
| 30 |
return $out; |
| 31 |
} |
| 32 |
} |
| 33 |
|