Same name and namespace in other branches
  1. 4.6.x includes/pager.inc \theme_pager_previous()
  2. 4.7.x includes/pager.inc \theme_pager_previous()
  3. 6.x includes/pager.inc \theme_pager_previous()
  4. 7.x includes/pager.inc \theme_pager_previous()

Format a "previous page" link.

Parameters

$text: The name (or image) of the link.

$limit: The number of query results to display per page.

$element: An optional integer to distinguish between multiple pagers on one page.

$interval: The number of pages to move backward when the link is clicked.

$parameters: An associative array of query string parameters to append to the pager links.

Return value

An HTML string that generates this piece of the query pager.

Related topics

2 theme calls to theme_pager_previous()
theme_pager in includes/pager.inc
Format a query pager.
theme_pager_list in includes/pager.inc
Format a list of nearby pages with additional query results.

File

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

Code

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

  // If we are anywhere but the first page
  if ($pager_page_array[$element] > 0) {
    $page_new = pager_load_array($pager_page_array[$element] - $interval, $element, $pager_page_array);

    // If the previous page is the first page, mark the link as such.
    if ($page_new[$element] == 0) {
      $output = theme('pager_first', $text, $limit, $element, $parameters);
    }
    else {
      $output = theme('pager_link', $text, $page_new, $element, $parameters, array(
        'class' => 'pager-previous',
      ));
    }
  }
  return $output;
}