You are here

function theme_imagefield_image_imagecache_shadowbox in Shadowbox 6.2

Same name and namespace in other branches
  1. 5.2 shadowbox.module \theme_imagefield_image_imagecache_shadowbox()
  2. 5 shadowbox.module \theme_imagefield_image_imagecache_shadowbox()
  3. 6.4 shadowbox.module \theme_imagefield_image_imagecache_shadowbox()
  4. 6.3 shadowbox.module \theme_imagefield_image_imagecache_shadowbox()

Implementation of theme_imagefield_image_imagecache_shadowbox().

1 theme call to theme_imagefield_image_imagecache_shadowbox()
theme_shadowbox_formatter_imagefield in ./shadowbox.module
Implementation of theme_shadowbox_formatter_imagefield().

File

./shadowbox.module, line 729
Shadowbox, a JavaScript media viewer application for displaying content in a modal dialogue.

Code

function theme_imagefield_image_imagecache_shadowbox($source, $destination, $item, $gallery_id = '') {
  $filepath = $item['filepath'];
  $alt = $item['data']['alt'];
  $title = $item['data']['title'];
  $rel = $gallery_id != '' ? 'shadowbox[' . $gallery_id . ']' : 'shadowbox';
  $link_attributes = array(
    'rel' => $rel,
    'title' => $title,
  );
  $options = array(
    'attributes' => $link_attributes,
    'html' => TRUE,
  );
  if ($filepath == '') {
    return;
  }
  if ($source == 'original') {
    $image = theme('shadowbox_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, shadowbox_imagecache_create_url($destination, $filepath), $options);
  }
  $wrapper_classes = $gallery_id != '' ? 'sb-image sb-gallery sb-gallery-' . $gallery_id : 'sb-image sb-indivdual';
  $output = '<div class="' . $wrapper_classes . '">' . $output . '</div>';
  return $output;
}