You are here

function theme_image_gallery_img in Image 7

Same name and namespace in other branches
  1. 5.2 contrib/image_gallery/image_gallery.module \theme_image_gallery_img()
  2. 5 contrib/image_gallery/image_gallery.module \theme_image_gallery_img()
  3. 6 contrib/image_gallery/image_gallery.pages.inc \theme_image_gallery_img()

Theme a gallery image.

1 theme call to theme_image_gallery_img()
theme_image_gallery in contrib/image_gallery/image_gallery.pages.inc
Theme a gallery page

File

contrib/image_gallery/image_gallery.pages.inc, line 129
Contains menu callbacks for image_gallery pages, ie galleries not made with views module. This file is not loaded when Views is creating the gallery.

Code

function theme_image_gallery_img($image, $size) {
  $width = $size['width'];

  // We'll add height to keep thumbnails lined up.
  $height = $size['height'] + 75;
  $content = '<li';
  if ($image->sticky) {
    $content .= ' class="sticky"';
  }
  $content .= " style='height : {$height}px; width : {$width}px;'>\n";
  $content .= l(image_display($image, IMAGE_THUMBNAIL), 'node/' . $image->nid, array(
    'html' => TRUE,
  ));
  $content .= '<h3>' . l($image->title, 'node/' . $image->nid) . '</h3>';
  if (variable_get('image_gallery_node_info', 0)) {
    $content .= '<div class="author">' . t('Posted by: !name', array(
      '!name' => theme('username', $image),
    )) . "</div>\n";
    if ($image->created > 0) {
      $content .= '<div class="date">' . format_date($image->created) . "</div>\n";
    }
  }
  $content .= "</li>\n";
  return $content;
}