library = $photonic_slideshow_library;
}
else {
$this->library = $photonic_custom_lightbox;
}
}
/**
* Generates the markup for a single photo.
*
* @param $data array Pertinent pieces of information about the photo - the source (src), the photo page (href), title and caption
* @param $processor Photonic_Processor The object calling this. A CSS class is created in the header, photonic-single-$processor->provider-photo-header
* @return string
*/
function generate_single_photo_markup($data, $processor) {
$processor->push_to_stack('Generate single photo markup');
$ret = '';
$photo = array_merge(
array('src' => '', 'href' => '', 'title' => '', 'caption' => ''),
$data
);
if (empty($photo['src'])) {
$processor->pop_from_stack();
return $ret;
}
global $photonic_external_links_in_new_tab;
if (!empty($photo['title'])) {
$ret .= "\t".'
$prompt_text
get_lightbox_attributes, which
* returns information for the gallery as a whole.
*
* @param $photo_data
* @return string
*/
function get_lightbox_specific_photo_data($photo_data, $processor) {
if ($this->library == 'lightgallery') {
$download = !empty($photo_data['download']) ? 'data-download-url="'.$photo_data['download'].'" ' : '';
$video = !empty($photo_data['video']) ? ' data-html="#photonic-video-'.$processor->provider.'-'.$processor->gallery_index.'-'.$photo_data['id'].'" ' : '';
return ' data-sub-html="'.$photo_data['title'].'" '.$video.$download;
}
else if ($this->library == 'strip') {
return ' data-strip-caption="'.$photo_data['title'].'" data-strip-options="onShow: function(a) { photonicStripSetHash('."'{$photo_data['deep']}'".'); }, afterHide: function() { photonicStripUnsetHash(); } " ';
}
else if ($this->library == 'lightcase' && $processor->provider == 'google') {
if (empty($photo_data['video'])) {
return " data-lc-options='{\"type\": \"image\"}' ";
}
else {
return " data-lc-options='{\"type\": \"video\"}' ";
}
}
else if ($this->library == 'fancybox' && $processor->provider == 'google') {
if (empty($photo_data['video'])) {
return " data-fancybox='{type: \"image\"}' ";
}
}
else if ($this->library == 'fancybox2' && $processor->provider == 'google') {
if (empty($photo_data['video'])) {
return " data-fancybox-type='image' ";
}
}
else if (in_array($this->library, array('colorbox', 'fancybox', 'fancybox2', 'photoswipe', 'swipebox', )) ||
(in_array($this->library, array('fancybox3', 'lightcase')) && in_array($processor->provider, array('flickr'))) ||
(in_array($this->library, array('fancybox3', )) && in_array($processor->provider, array('google')))) {
return !empty($photo_data['video']) ? ' data-html5-href="'.$photo_data['video'].'" ': '';
}
else if ($this->library == 'featherlight') {
$mime = (!empty($photo['mime']) ? $photo['mime']: 'video/mp4');
if ($processor->provider == 'google' && empty($photo_data['video'])) {
return " data-featherlight-type='image' ";
}
else if ($processor->provider == 'google' && !empty($photo_data['video'])) {
return " data-featherlight='' data-featherlight-type='html'";
}
return !empty($photo_data['video']) ? " data-featherlight='' data-featherlight-type='video'" : '';
}
return '';
}
/**
* Returns the thumbnail effect that should be used for a gallery. Not all effects can be used by all types of layouts.
*
* @param $short_code
* @param $layout
* @param $title_position
* @return string
*/
function get_thumbnail_effect($short_code, $layout, $title_position) {
if (!empty($short_code['thumbnail_effect'])) {
$effect = $short_code['thumbnail_effect'];
}
else {
global $photonic_standard_thumbnail_effect, $photonic_justified_thumbnail_effect, $photonic_mosaic_thumbnail_effect, $photonic_masonry_thumbnail_effect;
$effect = $layout == 'mosaic' ? $photonic_mosaic_thumbnail_effect :
($layout == 'masonry' ? $photonic_masonry_thumbnail_effect :
($layout == 'random' ? $photonic_justified_thumbnail_effect :
$photonic_standard_thumbnail_effect));
}
if ($layout == 'circle' && $effect != 'opacity') { // "Zoom" doesn't work for circle
$thumbnail_effect = 'none';
}
else if (($layout == 'square' || $layout == 'launch' || $layout == 'masonry') && $title_position == 'below') { // For these combinations, Zoom doesn't work
$thumbnail_effect = 'none';
}
else {
$thumbnail_effect = $effect;
}
return apply_filters('photonic_thumbnail_effect', $thumbnail_effect, $short_code, $layout, $title_position);
}
}