';
$from_new = pager_load_array(((int)$pager_from_array[$element] + ((int)$limit * (int)$interval)), $element, $pager_from_array);
if ($from_new[$element] < $pager_total[$element]) {
- return '
';
+ return $output;
}
/**
@@ -210,19 +228,26 @@ function pager_next($text, $limit, $elem
* An associative array of query string parameters to append to the pager links.
* @return
* An HTML string that generates this piece of the query pager.
+ *
+ * @ingroup themeable
*/
-function pager_last($text, $limit, $element = 0, $attributes = array()) {
+function theme_pager_last($text, $limit, $element = 0, $attributes = array()) {
global $pager_from_array, $pager_total;
+ $output = '
';
$last_num = (($pager_total[$element] % $limit) ? ($pager_total[$element] % $limit) : $limit);
$from_new = pager_load_array(($pager_total[$element] - $last_num), $element, $pager_from_array);
if ($from_new[$element] < ($pager_from_array[$element] + $limit)) {
- return pager_next($text, $limit, $element, 1, $attributes);
+ $output .= theme('pager_next', $text, $limit, $element, 1, $attributes);
+ }
+ else if (($from_new[$element] > $pager_from_array[$element]) && ($from_new[$element] > 0) && ($from_new[$element] < $pager_total[$element])) {
+ $output .= '
'. $text .'';
}
- if (($from_new[$element] > $pager_from_array[$element]) && ($from_new[$element] > 0) && ($from_new[$element] < $pager_total[$element])) {
- return '
'. $text .'';
+ else {
+ $output .= ' ';
}
- return ' ';
+ $output .= '
';
+ return $output;
}
/**
@@ -236,14 +261,17 @@ function pager_last($text, $limit, $elem
* A printf-style format string for customizing the pager text.
* @return
* An HTML string that generates this piece of the query pager.
+ *
+ * @ingroup themeable
*/
-function pager_detail($limit, $element = 0, $format = '%d through %d of %d.') {
+function theme_pager_detail($limit, $element = 0, $format = '%d through %d of %d.') {
global $pager_from_array, $pager_total;
- $output = '';
+ $output = '
';
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 .= 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 .= '
';
return $output;
}
@@ -263,9 +291,12 @@ function pager_detail($limit, $element =
* An associative array of query string parameters to append to the pager links.
* @return
* An HTML string that generates this piece of the query pager.
+ *
+ * @ingroup themeable
*/
-function pager_list($limit, $element = 0, $quantity = 5, $text = '', $attributes = array()) {
+function theme_pager_list($limit, $element = 0, $quantity = 5, $text = '', $attributes = array()) {
global $pager_from_array, $pager_total;
+ $output = '
';
// Calculate various markers within this pager piece:
// Middle is used to "center" pages around the current page.
@@ -307,28 +338,29 @@ function pager_list($limit, $element = 0
// When there is more than one page, create the pager list.
if ($i != $pager_max) {
- $output = $text;
+ $output .= $text;
if ($i > 1) {
- $output .= '... ';
+ $output .= '
...
';
}
// Now generate the actual pager piece.
for (; $i <= $pager_last && $i <= $pager_max; $i++) {
if ($i < $pager_current) {
- $output .= pager_previous($i, $limit, $element, ($pager_current - $i), $attributes) ." ";
+ $output .= theme('pager_previous', $i, $limit, $element, ($pager_current - $i), $attributes) ." ";
}
if ($i == $pager_current) {
$output .= '
'. $i .' ';
}
if ($i > $pager_current) {
- $output .= pager_next($i, $limit, $element, ($i - $pager_current), $attributes) ." ";
+ $output .= theme('pager_next', $i, $limit, $element, ($i - $pager_current), $attributes) ." ";
}
}
if ($i < $pager_max) {
- $output .= '...';
+ $output .= '
...
';
}
}
+ $output .= '
';
return $output;
}