| 1 |
<?php |
| 2 |
namespace Photonic_Plugin\Lightboxes; |
| 3 |
|
| 4 |
use Photonic_Plugin\Modules\Core; |
| 5 |
|
| 6 |
require_once('Lightbox.php'); |
| 7 |
|
| 8 |
class Fancybox3 extends Lightbox { |
| 9 |
protected function __construct() { |
| 10 |
$this->library = 'fancybox3'; |
| 11 |
parent::__construct(); |
| 12 |
} |
| 13 |
|
| 14 |
/** |
| 15 |
* @param $rel_id |
| 16 |
* @param Core $module |
| 17 |
* @return array |
| 18 |
*/ |
| 19 |
function get_gallery_attributes($rel_id, $module) { |
| 20 |
return [ |
| 21 |
'class' => $this->class = ['photonic-launch-gallery', 'launch-gallery-fancybox', 'fancybox'], |
| 22 |
'rel' => ['lightbox-photonic-'.$module->provider.'-stream-'.(empty($rel_id) ? $module->gallery_index : $rel_id)], |
| 23 |
'specific' => [ |
| 24 |
'data-fancybox' => ['lightbox-photonic-'.$module->provider.'-stream-'.(empty($rel_id) ? $module->gallery_index : $rel_id)] |
| 25 |
], |
| 26 |
]; |
| 27 |
} |
| 28 |
|
| 29 |
function get_photo_attributes($photo_data, $module) { |
| 30 |
if (in_array($module->provider, ['google', 'flickr'])) { |
| 31 |
return !empty($photo_data['video']) ? ' data-html5-href="'.$photo_data['video'].'" ': ''; |
| 32 |
} |
| 33 |
return ''; |
| 34 |
} |
| 35 |
} |