theme_pager_last
- Versions
- 4.6
theme_pager_last($text, $limit, $element = 0,$attributes= array())- 4.7 – 6
theme_pager_last($text,$limit,$element= 0,$parameters= array())- 7
theme_pager_last($variables)
Format a "last page" link.
Parameters
$text The name (or image) of the link.
$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 this piece of the query pager.
Related topics
Code
includes/pager.inc, line 233
<?php
function theme_pager_last($text, $limit, $element = 0, $attributes = array()) {
global $pager_from_array, $pager_total;
$output = '<div class="pager-last">';
$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)) {
$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 .= '<a href="'. pager_link($from_new, $element, $attributes) .'">'. $text .'</a>';
}
else {
$output .= ' ';
}
$output .= '</div>';
return $output;
}
?>Login or register to post comments 