function theme_imagefield_image_imagecache_photoswipe in PhotoSwipe 6
Implementation of theme_imagefield_image_imagecache_photoswipe().
1 theme call to theme_imagefield_image_imagecache_photoswipe()
- theme_photoswipe_formatter_imagefield in ./
photoswipe.module - Implementation of theme_shadowbox_formatter_imagefield().
File
- ./
photoswipe.module, line 325
Code
function theme_imagefield_image_imagecache_photoswipe($source, $destination, $item, $gallery_id = '', $field_type_names) {
$filepath = $item['filepath'];
if ($filepath == '') {
return;
}
$alt = $item['data']['alt'];
$title_text_setting = variable_get("photoswipe_title_text_{$field_type_names}", 0);
switch ($title_text_setting) {
case 0:
$title = $item['data']['title'];
break;
case 1:
$title = $item['data']['description'];
break;
case 2:
$node = node_load($item['nid']);
$title = $node->title;
break;
}
// $rel = ($gallery_id != '') ? "shadowbox[$gallery_id]" : 'shadowbox';
$link_attributes = array(
// 'rel' => $rel,
'title' => $title,
);
$options = array(
'attributes' => $link_attributes,
'html' => TRUE,
);
if ($source == 'original') {
$image = theme('photoswipe_image', $filepath, $alt, $title);
}
else {
$image = theme('imagecache', $source, $filepath, $alt, $title);
}
if ($destination == 'original') {
$output = l($image, file_create_url($filepath), $options);
}
else {
$output = l($image, photoswipe_imagecache_create_url($destination, $filepath), $options);
}
// $wrapper_classes = ($gallery_id != '') ? "sb-image sb-gallery sb-gallery-$gallery_id" : 'sb-image sb-indivdual';
$wrapper_classes = $gallery_id != '' ? "photoswipe-image photoswipe-gallery photoswipe-gallery-{$gallery_id}" : "photoswipe-image photoswipe-gallery";
return '<div class="' . $wrapper_classes . '">' . $output . '</div>';
}