--- includes/pager.inc.orig 2005-01-26 23:11:44.000000000 -0500 +++ includes/pager.inc 2005-01-27 09:17:43.826019905 -0500 @@ -103,11 +103,11 @@ function theme_pager($tags = array(), $l if ($pager_total[$element] > $limit) { $output .= '
'; - $output .= '
'. pager_first(($tags[0] ? $tags[0] : t('first page')), $limit, $element, $attributes) .'
'; - $output .= '
'. pager_previous(($tags[1] ? $tags[1] : t('previous page')), $limit, $element, 1, $attributes) .'
'; - $output .= '
'. pager_list($limit, $element, ($tags[2] ? $tags[2] : 9 ), '', $attributes) .'
'; - $output .= '
'. pager_next(($tags[3] ? $tags[3] : t('next page')), $limit, $element, 1, $attributes) .'
'; - $output .= '
'. pager_last(($tags[4] ? $tags[4] : t('last page')), $limit, $element, $attributes) .'
'; + $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 .= '
'; return $output; @@ -134,17 +134,21 @@ function theme_pager($tags = array(), $l * 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_first($text, $limit, $element = 0, $attributes = array()) { +function theme_pager_first($text, $limit, $element = 0, $attributes = array()) { global $pager_from_array; + $output = '
'; if ($pager_from_array[$element]) { - return ''. $text .''; + $output .= ''. $text .''; } else { - // We are already at the first page, so return nothing. - return ' '; + $output .= ' '; } + $output .= '
'; + return $output; } /** @@ -162,14 +166,21 @@ function pager_first($text, $limit, $ele * 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_previous($text, $limit, $element = 0, $interval = 1, $attributes = array()) { +function theme_pager_previous($text, $limit, $element = 0, $interval = 1, $attributes = array()) { global $pager_from_array; + $output = '
'; $from_new = pager_load_array(((int)$pager_from_array[$element] - ((int)$limit * (int)$interval)), $element, $pager_from_array); if ($from_new[$element] < 1) { - return pager_first($text, $limit, $element, $attributes); + $output .= theme('pager_first', $text, $limit, $element, $attributes); + } + else { + $output .= ''. $text .''; } - return ''. $text .''; + $output .= '
'; + return $output; } /** @@ -187,14 +198,21 @@ function pager_previous($text, $limit, $ * 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_next($text, $limit, $element = 0, $interval = 1, $attributes = array()) { +function theme_pager_next($text, $limit, $element = 0, $interval = 1, $attributes = array()) { global $pager_from_array, $pager_total; + $output = '
'; $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 ''. $text .''; + $output .= ''. $text .''; + } + else { + $output .= ' '; } - return ' '; + $output .= '
'; + 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; }