/[drupal]/contributions/tricks/different_pager_view.php
ViewVC logotype

Contents of /contributions/tricks/different_pager_view.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Wed Aug 17 00:42:52 2005 UTC (4 years, 3 months ago) by drumm
Branch: MAIN
File MIME type: text/x-php
Adding in removed code from HEAD.

http://drupal.org/node/27980

Feel free to improve (I don't think this is properly translatable for example).
1 <?php
2 // $Id:
3
4 /**
5 * Format a summary of the current pager position, such as "6 through 10 of 52".
6 *
7 * @param $limit
8 * The number of query results to display per page.
9 * @param $element
10 * An optional integer to distinguish between multiple pagers on one page.
11 * @param $format
12 * A printf-style format string for customizing the pager text.
13 * @return
14 * An HTML string that generates this piece of the query pager.
15 *
16 * @ingroup themeable
17 */
18 function theme_pager_detail($limit, $element = 0, $format = '%d through %d of %d.') {
19 global $pager_page_array, $pager_total, $pager_total_items;
20
21 $output = '<div class="pager-detail">';
22 if ($pager_total[$element] > 1) {
23 $output .= sprintf($format,
24 $pager_page_array[$element] * $limit + 1,
25 min($pager_total_items[$element], ($pager_page_array[$element] + 1) * $limit),
26 $pager_total_items[$element]);
27 }
28 $output .= '</div>';
29
30 return $output;
31 }
32
33
34 ?>

  ViewVC Help
Powered by ViewVC 1.1.2