';
$pos = 0;
$current_theme = get_option('current_theme');
if (isset($current_theme) && $current_theme === 'Gleam') {
$tclass = 'fancybox';
} else {
$tclass = '';
}
foreach ($gallery_items as $item_id => $attachment) {
$post_excerpt = $attachment->post_excerpt;
$post_title = $attachment->post_title;
$lb_title = (!empty($caption_lightbox) && $post_excerpt !=='') ? $post_excerpt : $post_title;
$link_target = get_post_meta($attachment->ID, '_gallery_link_target', true);
$link_target = ($link_target !== '') ? $link_target : '_self';
$downloads = $this->wpmfGalleryGetDownloadLink($attachment->ID);
switch ($link) {
case 'file':
$image_output = $this->getAttachmentLink($item_id, $size, false, $targetsize, false, $link_target);
$remote_video = get_post_meta($item_id, 'wpmf_remote_video_link', true);
$lb = 1;
$url = get_post_meta($attachment->ID, _WPMF_GALLERY_PREFIX . 'custom_image_link', true);
if ($url !== '') {
$lb = 0;
} else {
if ($targetsize) {
if ($attachment->post_mime_type === 'application/pdf') {
$link_target = '_blank';
$lb = 0;
} else {
$lb = 1;
}
}
}
$lightbox_urls = $this->getLightboxUrl($attachment->ID, $targetsize);
$lightbox_url = $lightbox_urls['url'];
$icon = '
+';
break;
case 'post':
$image_output = $this->getAttachmentLink($item_id, $size, true, $targetsize, false, $link_target);
$url_image = get_attachment_link($item_id);
if ($attachment->post_mime_type === 'application/pdf') {
$url_image = wp_get_attachment_url($attachment->ID);
$link_target = '_blank';
} else {
$url_image = get_attachment_link($item_id);
}
$icon = '
';
$icon .= '
+';
break;
case 'none':
$image_output = wp_get_attachment_image($item_id, $size, false, array('data-type' => 'wpmfgalleryimg'));
$icon = '
+';
break;
case 'custom':
$image_output = $this->getAttachmentLink($item_id, $size, false, $targetsize, true, $link_target);
$url_image = get_post_meta($item_id, _WPMF_GALLERY_PREFIX . 'custom_image_link', true);
if ($url_image === '') {
$url_image = get_attachment_link($item_id);
}
$icon = '
';
$icon .= '
+';
break;
default:
$image_output = $this->getAttachmentLink($item_id, $size, true, $targetsize, false, $link_target);
}
if ($enable_download) {
$image_output .= '
file_download ';
}
$output .= '
';
$output .= '';
$output .= wpmfRenderVideoIcon($attachment->ID);
$output .= $icon;
$output .= '
';
$output .= '
';
$output .= $image_output;
$output .= '
';
$output .= '
';
$output .= '
';
if (trim($attachment->post_excerpt) || trim($attachment->post_title)) {
$output .= '';
if ($attachment->post_title !== '') {
$output .= '' . wptexturize(esc_html($attachment->post_title)) . '';
}
if ($attachment->post_excerpt !== '') {
$output .= '' . wptexturize($attachment->post_excerpt) . '';
}
if ($attachment->post_content !== '' && defined('WPMF_DISPLAY_GALLERY_DESCRIPTION')) {
$output .= '' . wptexturize($attachment->post_content) . '';
}
$output .= '
';
}
$output .= '';
$pos++;
}
$output .= "