function theme_pager_next

7.x theme.inc theme_pager_next($text, $limit, $element = 0, $interval = 1, $parameters = array())
6.x theme.inc theme_pager_next($text, $limit, $element = 0, $interval = 1, $parameters = array())

Adapted from https://api.drupal.org/api/drupal/includes%21pager.inc/function/theme_pa...

File

includes/theme.inc, line 420

Code

function theme_pager_next($text, $limit, $element = 0, $interval = 1, $parameters = array()) {
  global $pager_page_array, $pager_total;
  $output = '';

  // If we are anywhere but the last page
  if ($pager_page_array [$element] < $pager_total [$element] - 1) {
    $page_new = pager_load_array($pager_page_array [$element] + $interval, $element, $pager_page_array);

    // If the next page is the last page, mark the link as such.
    if ($page_new [$element] == $pager_total [$element] - 1) {
      $output = theme_pager_last($text, $limit, $element, $parameters);
    }
    else {
      $output = theme_pager_link($text, $page_new, $element, $parameters);
    }
  }
  return $output;
}