| 1 |
<?php |
| 2 |
namespace Photonic_Plugin\Lightboxes; |
| 3 |
|
| 4 |
require_once('Lightbox.php'); |
| 5 |
|
| 6 |
class Fancybox2 extends Lightbox { |
| 7 |
protected function __construct() { |
| 8 |
$this->library = 'fancybox2'; |
| 9 |
parent::__construct(); |
| 10 |
$this->class = ['photonic-launch-gallery', 'launch-gallery-fancybox', 'fancybox']; |
| 11 |
} |
| 12 |
|
| 13 |
function get_photo_attributes($photo_data, $module) { |
| 14 |
if ($module->provider == 'google') { |
| 15 |
if (empty($photo_data['video'])) { |
| 16 |
return " data-fancybox='{type: \"image\"}' "; |
| 17 |
} |
| 18 |
} |
| 19 |
return !empty($photo_data['video']) ? ' data-html5-href="'.$photo_data['video'].'" ': ''; |
| 20 |
} |
| 21 |
} |