You are here

function template_preprocess_gallery_images_list in Node Gallery 6.2

File

theme/theme.inc, line 59
theme/theme.inc Node gallery theme functions

Code

function template_preprocess_gallery_images_list(&$vars) {
  $gallery = $vars['gallery'];
  $config = $vars['config'];
  if (!count($gallery->images)) {
    $empty_message = '<p>' . t('There are currently no images in this gallery.');
    if (node_gallery_user_access('edit', $gallery)) {
      $empty_message .= '  ' . l(t('You may upload images to this gallery.'), 'node/' . $gallery->nid . '/upload', array(
        'query' => 'destination=node/' . $gallery->nid,
      ));
    }
    $empty_message .= '</p>';
  }
  else {
    foreach ($gallery->images as $nid => $image) {
      $items[] = theme('gallery_image_thumbnail', $image, $config, NODE_GALLERY_VIEW_IMAGE_LIST);
    }
  }
  $vars['empty_message'] = $empty_message;
  $vars['images_list'] = $items;
}