theme_pager_detail

Definition

theme_pager_detail($limit, $element = 0, $format = '%d through %d of %d.')
drupal/includes/pager.inc, line 266

Description

Format a summary of the current pager position, such as "6 through 10 of 52".

Parameters

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

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

$format A printf-style format string for customizing the pager text.

Return value

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

Related topics

Namesort iconDescription
Themeable functionsFunctions that display HTML, and which can be customized by themes.

Code

function theme_pager_detail($limit, $element = 0, $format = '%d through %d of %d.') {
  global $pager_from_array, $pager_total;

  $output = '<div class="pager-detail">';
  if ($pager_total[$element] > (int)$pager_from_array[$element] + 1) {
    $output .= sprintf($format, (int)$pager_from_array[$element] + 1, ((int)$pager_from_array[$element] + $limit <= $pager_total[$element] ? (int)$pager_from_array[$element] + $limit : $pager_total[$element]), $pager_total[$element]);
  }
  $output .= '</div>';

  return $output;
}