| @@ -1,13 +1,14 @@ | ||
| 1 | 1 | <?php |
| 2 | + | |
| 2 | 3 | namespace Photonic_Plugin\Lightboxes; |
| 3 | 4 | |
| 4 | -use Photonic_Plugin\Modules\Core; | |
| 5 | +use Photonic_Plugin\Platforms\Base; | |
| 5 | 6 | |
| 6 | -require_once('Lightbox.php'); | |
| 7 | +require_once 'Lightbox.php'; | |
| 7 | 8 | |
| 8 | 9 | class Strip extends Lightbox { |
| 9 | - function __construct() { | |
| 10 | + protected function __construct() { | |
| 10 | 11 | $this->library = 'strip'; |
| 11 | 12 | parent::__construct(); |
| 12 | 13 | } |
| 13 | 14 | |
| @@ -12,27 +13,29 @@ | ||
| 12 | 13 | } |
| 13 | 14 | |
| 14 | 15 | /** |
| 15 | 16 | * @param $rel_id |
| 16 | - * @param Core $module | |
| 17 | + * @param Base $module | |
| 17 | 18 | * @return array |
| 18 | 19 | */ |
| 19 | - function get_gallery_attributes($rel_id, $module) { | |
| 20 | + public function get_gallery_attributes($rel_id, Base $module): array { | |
| 20 | 21 | global $photonic_lightbox_no_loop; |
| 21 | 22 | $specific = [ |
| 22 | - 'data-strip-group' => ['lightbox-photonic-'.$module->provider.'-stream-'.(empty($rel_id) ? $module->gallery_index : $rel_id)] | |
| 23 | + 'data-strip-group' => 'lightbox-photonic-' . $module->provider . '-stream-' . (empty($rel_id) ? $module->gallery_index : $rel_id) | |
| 23 | 24 | ]; |
| 24 | 25 | if (!empty($photonic_lightbox_no_loop)) { |
| 25 | - $specific['data-strip-group-options'] = ["loop: false"]; | |
| 26 | + $specific['data-strip-group-options'] = "loop: false"; | |
| 26 | 27 | } |
| 27 | 28 | |
| 28 | 29 | return [ |
| 29 | - 'class' => $this->class, | |
| 30 | - 'rel' => ['lightbox-photonic-'.$module->provider.'-stream-'.(empty($rel_id) ? $module->gallery_index : $rel_id)], | |
| 30 | + 'class' => $this->class, | |
| 31 | + 'rel' => ['lightbox-photonic-' . $module->provider . '-stream-' . (empty($rel_id) ? $module->gallery_index : $rel_id)], | |
| 31 | 32 | 'specific' => $specific, |
| 32 | 33 | ]; |
| 33 | 34 | } |
| 34 | 35 | |
| 35 | - function get_photo_attributes($photo_data, $module) { | |
| 36 | - return ' data-strip-caption="'.$photo_data['title'].'" data-strip-options="onShow: function(a) { photonicStripSetHash('."'{$photo_data['deep']}'".'); }, afterHide: function() { photonicStripUnsetHash(); } " '; | |
| 36 | + public function get_photo_attributes(array $photo_data, Base $module): array { | |
| 37 | + $out = parent::get_photo_attributes($photo_data, $module); | |
| 38 | + $out['data-strip-caption'] = esc_attr($photo_data['title']); | |
| 39 | + return $out; | |
| 37 | 40 | } |
| 38 | -} | |
| 41 | +} | |