You are here

function theme_node_gallery_image in Node Gallery 6

theme_node_gallery_image()

This is the code that directly calls the image node (page view) display We provide this theme function as a user may way to inject some custom markup around already determined theme functions

1 theme call to theme_node_gallery_image()
node_gallery_preprocess_node in ./node_gallery.module

File

./node_gallery.themes.inc, line 222
Node gallery themes.

Code

function theme_node_gallery_image($config, $node) {
  $image_view = theme('image_view', $config->image_size['preview'], $node);
  if ($config->view_original == 'default') {
    $output = l($image_view, file_create_url($node->filepath), array(
      'attributes' => array(
        'target' => '_blank',
      ),
      'html' => TRUE,
    ));
  }
  elseif ($config->view_original == 'text') {
    $download_text = t('Download the Original Image');
    if (check_plain($config->view_original_text) != '') {
      $download_text = check_plain($config->view_original_text);
    }
    $output = $image_view . '<div class="download-full-link">' . l($download_text, file_create_url($node->filepath), array(
      'attributes' => array(
        'target' => '_blank',
      ),
      'html' => FALSE,
    )) . '</div>';
  }
  elseif ($config->view_original == 'lightbox2') {
    $output = l($image_view, imagecache_create_url($config->lightbox2, $node->filepath), array(
      'attributes' => array(
        'rel' => 'lightbox',
      ),
      'html' => TRUE,
    ));
  }
  else {
    $output = $image_view;
  }
  return '<div class="image-preview">' . $output . '</div>';
}