You are here

function theme_gallery_image_navigator in Node Gallery 6.2

Same name and namespace in other branches
  1. 6 node_gallery.themes.inc \theme_gallery_image_navigator()
1 theme call to theme_gallery_image_navigator()
_node_gallery_image_view in ./node_gallery.module

File

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

Code

function theme_gallery_image_navigator($navigator, $image) {
  $col1 = array(
    'data' => t("Image %current of %total", array(
      '%current' => $navigator['current'],
      '%total' => $navigator['total'],
    )),
    'class' => 'image-navigator-left',
  );

  // Eliminate prev/next links when we only have one image
  if ($navigator['total'] <= 1) {
    $col2 = array(
      'data' => t('&nbsp;'),
      'class' => 'image-navigator-mid',
    );
  }
  else {
    if (variable_get('node_images_page_fragment', FALSE)) {
      $col2 = array(
        'data' => l(t('Previous'), 'node/' . $navigator['prev_nid'], array(
          fragment => 'node-inner',
        )) . '/' . l(t('Next'), 'node/' . $navigator['next_nid'], array(
          fragment => 'node-inner',
        )),
        'class' => 'image-navigator-mid',
      );
    }
    else {
      $col2 = array(
        'data' => l(t('Previous'), 'node/' . $navigator['prev_nid']) . '/' . l(t('Next'), 'node/' . $navigator['next_nid']),
        'class' => 'image-navigator-mid',
      );
    }
  }
  $col3 = array(
    'data' => node_gallery_operations('image', $image),
    'class' => 'image-navigator-right',
  );
  $rows[] = array(
    $col1,
    $col2,
    $col3,
  );
  return theme('table', NULL, $rows, array(
    'class' => 'image-navigator',
  ));
}