| 1 |
<?php |
| 2 |
namespace Photonic_Plugin\Lightboxes; |
| 3 |
|
| 4 |
use Photonic_Plugin\Modules\Core; |
| 5 |
|
| 6 |
require_once('Lightbox.php'); |
| 7 |
|
| 8 |
class Strip extends Lightbox { |
| 9 |
function __construct() { |
| 10 |
$this->library = 'strip'; |
| 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 |
global $photonic_lightbox_no_loop; |
| 21 |
$specific = [ |
| 22 |
'data-strip-group' => ['lightbox-photonic-'.$module->provider.'-stream-'.(empty($rel_id) ? $module->gallery_index : $rel_id)] |
| 23 |
]; |
| 24 |
if (!empty($photonic_lightbox_no_loop)) { |
| 25 |
$specific['data-strip-group-options'] = ["loop: false"]; |
| 26 |
} |
| 27 |
|
| 28 |
return [ |
| 29 |
'class' => $this->class, |
| 30 |
'rel' => ['lightbox-photonic-'.$module->provider.'-stream-'.(empty($rel_id) ? $module->gallery_index : $rel_id)], |
| 31 |
'specific' => $specific, |
| 32 |
]; |
| 33 |
} |
| 34 |
|
| 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(); } " '; |
| 37 |
} |
| 38 |
} |