You are here

function node_gallery_lightbox2_preprocess_gallery_image_thumbnail in Node Gallery 6.2

File

contrib/node_gallery_lightbox2/node_gallery_lightbox2.module, line 94
node_gallery_lightbox2.module

Code

function node_gallery_lightbox2_preprocess_gallery_image_thumbnail(&$vars) {
  $image = $vars['image'];
  $config = $vars['config'];
  $mode = $vars['mode'];
  switch ($mode) {
    case NODE_GALLERY_VIEW_TEASER:
      if ($config['teaser']['gallery_display_type'] == 'lightbox2_gallery') {
        $image_tag = theme('image_view', $config['image_size']['thumbnail'], $image);
        $vars['image_output'] = l($image_tag, imagecache_create_url($config['teaser']['lightbox2_gallery'], $image->filepath), array(
          'html' => TRUE,
          'attributes' => array(
            'title' => $image->title,
            'rel' => 'lightshow[' . $image->gid . ']',
          ),
        ));
      }
      break;
    case NODE_GALLERY_VIEW_IMAGE_LIST:
      if ($config['gallery']['gallery_display_type'] == 'lightbox2_gallery') {
        $vars['image_output'] = l(theme('image_view', $config['image_size']['thumbnail'], $image), imagecache_create_url($config['gallery']['lightbox2_gallery_preset'], $image->filepath), array(
          'html' => TRUE,
          'attributes' => array(
            'title' => $image->title,
            'rel' => 'lightshow[hi]',
          ),
        ));
      }
      break;
  }
}