You are here

function theme_imagefield_image_imagecache_lightbox2 in Lightbox2 5

Same name and namespace in other branches
  1. 5.2 lightbox2.module \theme_imagefield_image_imagecache_lightbox2()
  2. 6 lightbox2.formatter.inc \theme_imagefield_image_imagecache_lightbox2()

Implementation of theme_imagefield_image_imagecache_lightbox2().

1 theme call to theme_imagefield_image_imagecache_lightbox2()
lightbox2_field_formatter in ./lightbox2.module
Implementation of hook_field_formatter().

File

./lightbox2.module, line 315

Code

function theme_imagefield_image_imagecache_lightbox2($namespace, $field, $item, $attributes = NULL) {
  $imagecache_path = file_create_url(file_directory_path() . '/imagecache/' . $namespace . '/' . $item['filepath']);
  $rel = 'lightbox';
  if (variable_get('lightbox2_image_group', TRUE)) {
    $rel = 'lightbox[cck_image_nodes]';
  }
  $node_link = '';
  if (!empty($item['nid'])) {
    $node_link = '<br /><br />' . l(t('View Image Information'), 'node/' . $item['nid']);
  }
  $link_attributes = array(
    'rel' => $rel,
    'title' => $item['alt'] . $node_link,
  );
  $image = theme('imagecache', $namespace, $item['filepath'], $item['alt'], $item['title'], $attributes);
  $output = l($image, $item['filepath'], $link_attributes, NULL, NULL, FALSE, TRUE);
  return $output;
}