| @@ -1,15 +1,26 @@ | ||
| 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 Colorbox extends Lightbox { |
| 12 | + use Show_Videos_Inline; | |
| 13 | + | |
| 7 | 14 | protected function __construct() { |
| 8 | 15 | $this->library = 'colorbox'; |
| 9 | 16 | parent::__construct(); |
| 10 | 17 | } |
| 11 | 18 | |
| 12 | - function get_photo_attributes($photo_data, $module) { | |
| 13 | - return !empty($photo_data['video']) ? ' data-html5-href="'.$photo_data['video'].'" ': ''; | |
| 19 | + public function get_photo_attributes(array $photo_data, Base $module): array { | |
| 20 | + $out = parent::get_photo_attributes($photo_data, $module); | |
| 21 | + if (!empty($photo_data['video'])) { | |
| 22 | + $out['data-html5-href'] = $photo_data['video']; | |
| 23 | + } | |
| 24 | + return $out; | |
| 14 | 25 | } |
| 15 | -} | |
| 26 | +} | |