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