You are here

function template_preprocess_node_gallery_image_navigator in Node Gallery 6.3

File

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

Code

function template_preprocess_node_gallery_image_navigator(&$variables) {
  $relationship = node_gallery_get_relationship(NULL, $variables['image']->type);
  $fragment = FALSE;
  if ($relationship['settings']['node_images_page_fragment']) {
    $fragment = TRUE;
  }
  $entries = array();
  if (isset($variables['navigator']['prev_nid'])) {
    $entries = array_merge($entries, array(
      'prev',
      'first',
    ));
  }
  if (isset($variables['navigator']['next_nid'])) {
    $entries = array_merge($entries, array(
      'next',
      'last',
    ));
  }
  foreach ($entries as $type) {
    $nid = $variables['navigator'][$type . '_nid'];
    $variables[$type . '_link'] = $fragment ? url('node/' . $nid, array(
      'fragment' => 'node-' . $nid,
    )) : url('node/' . $nid);
  }
  $variables['gallery_link'] = url('node/' . $variables['navigator']['gallery_nid']);
  $gallery = node_load($variables['navigator']['gallery_nid']);
  $variables['gallery_title'] = check_plain($gallery->title);
}