4.6.x pager.inc theme_pager_last($text, $limit, $element = 0, $attributes = array())
4.7.x pager.inc theme_pager_last($text, $limit, $element = 0, $parameters = array())
5.x pager.inc theme_pager_last($text, $limit, $element = 0, $parameters = array())
6.x pager.inc theme_pager_last($text, $limit, $element = 0, $parameters = array())
7.x pager.inc theme_pager_last($variables)

Returns HTML for the "last page" link in query pager.

Parameters

$variables: An associative array containing:

  • text: The name (or image) of the link.
  • element: An optional integer to distinguish between multiple pagers on one page.
  • parameters: An associative array of query string parameters to append to the pager links.

Related topics

2 theme calls to theme_pager_last()
theme_pager in includes/pager.inc
Returns HTML for a query pager.
theme_pager_next in includes/pager.inc
Returns HTML for the "next page" link in a query pager.

File

includes/pager.inc, line 556
Functions to aid in presenting database results as a set of pages.

Code

function theme_pager_last($variables) {
  $text = $variables['text'];
  $element = $variables['element'];
  $parameters = $variables['parameters'];
  global $pager_page_array, $pager_total;
  $output = '';

  // If we are anywhere but the last page
  if ($pager_page_array[$element] < $pager_total[$element] - 1) {
    $output = theme('pager_link', array(
      'text' => $text,
      'page_new' => pager_load_array($pager_total[$element] - 1, $element, $pager_page_array),
      'element' => $element,
      'parameters' => $parameters,
    ));
  }
  return $output;
}