theme_pager

5 pager.inc theme_pager($tags = array(), $limit = 10, $element = 0, $parameters = array())
6 pager.inc theme_pager($tags = array(), $limit = 10, $element = 0, $parameters = array(), $quantity = 9)
7 pager.inc theme_pager($variables)
8 pager.inc theme_pager($variables)

Format a query pager.

Menu callbacks that display paged query results should call theme('pager') to retrieve a pager control so that users can view other results.

Parameters

$tags: An array of labels for the controls in the pager.

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

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

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

Return value

An HTML string that generates the query pager.

Related topics

23 theme calls to theme_pager()

File

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

Code

function theme_pager($tags = array(), $limit = 10, $element = 0, $attributes = array()) {
  global $pager_total;
  $output = '';

  if ($pager_total[$element] > $limit) {
    $output .= '<div id="pager" class="container-inline">';
    $output .= theme('pager_first', ($tags[0] ? $tags[0] : t('first page')), $limit, $element, $attributes);
    $output .= theme('pager_previous', ($tags[1] ? $tags[1] : t('previous page')), $limit, $element, 1, $attributes);
    $output .= theme('pager_list', $limit, $element, ($tags[2] ? $tags[2] : 9 ), '', $attributes);
    $output .= theme('pager_next', ($tags[3] ? $tags[3] : t('next page')), $limit, $element, 1, $attributes);
    $output .= theme('pager_last', ($tags[4] ? $tags[4] : t('last page')), $limit, $element, $attributes);
    $output .= '</div>';

    return $output;
  }
}
Login or register to post comments