1) {
$output .= '
';
return $output;
}
}
/**
* @name Pager pieces
* @{
* Use these pieces to construct your own custom pagers in your theme. Note that
* you should NOT modify this file to customize your pager.
*/
/**
* Format a "first page" link.
*
* @param $text
* The name (or image) of the link.
* @param $limit
* The number of query results to display per page.
* @param $element
* An optional integer to distinguish between multiple pagers on one page.
* @param $attributes
* 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 theme_pager_first($text, $limit, $element = 0, $attributes = array()) {
global $pager_page_array;
$output = '';
return $output;
}
/**
* Format a "previous page" link.
*
* @param $text
* The name (or image) of the link.
* @param $limit
* The number of query results to display per page.
* @param $element
* An optional integer to distinguish between multiple pagers on one page.
* @param $interval
* The number of pages to move backward when the link is clicked.
* @param $attributes
* 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 theme_pager_previous($text, $limit, $element = 0, $interval = 1, $attributes = array()) {
global $pager_page_array;
$output = '';
return $output;
}
/**
* Format a "next page" link.
*
* @param $text
* The name (or image) of the link.
* @param $limit
* The number of query results to display per page.
* @param $element
* An optional integer to distinguish between multiple pagers on one page.
* @param $interval
* The number of pages to move forward when the link is clicked.
* @param $attributes
* 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 theme_pager_next($text, $limit, $element = 0, $interval = 1, $attributes = array()) {
global $pager_page_array, $pager_total;
$output = '';
return $output;
}
/**
* Format a "last page" link.
*
* @param $text
* The name (or image) of the link.
* @param $limit
* The number of query results to display per page.
* @param $element
* An optional integer to distinguish between multiple pagers on one page.
* @param $attributes
* 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 theme_pager_last($text, $limit, $element = 0, $attributes = array()) {
global $pager_page_array, $pager_total;
$output = '';
return $output;
}
/**
* Format a list of nearby pages with additional query results.
*
* @param $limit
* The number of query results to display per page.
* @param $element
* An optional integer to distinguish between multiple pagers on one page.
* @param $quantity
* The number of pages in the list.
* @param $text
* A string of text to display before the page list.
* @param $attributes
* 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 theme_pager_list($limit, $element = 0, $quantity = 5, $text = '', $attributes = array()) {
global $pager_page_array, $pager_total;
$output = '';
return $output;
}
/**
* Format a link to a specific query result page.
*
* @param $page_new
* The first result to display on the linked page.
* @param $element
* An optional integer to distinguish between multiple pagers on one page.
* @param $attributes
* An associative array of query string parameters to append to the pager link.
* @return
* An HTML string that generates the link.
*/
function theme_pager_link($text, $page_new, $element, $attributes = array()) {
$q = $_GET['q'];
$page = array_key_exists('page', $_GET) ? $_GET['page'] : '';
foreach ($attributes as $key => $value) {
$query[] = $key .'='. $value;
}
$page_new = pager_load_array($page_new[$element], $element, explode(',', $page));
if (count($attributes)) {
$url = url($q, 'page='. implode(',', $page_new) .'&'. implode('&', $query));
}
else {
$url = url($q, 'page='. implode(',', $page_new));
}
return ''. check_plain($text) .'';
}
/**
* @} End of "Pager pieces".
*/
/**
* Helper function
*
* Copies $old_array to $new_array and sets $new_array[$element] = $value
* Fills in $new_array[0 .. $element - 1] = 0
*/
function pager_load_array($value, $element, $old_array) {
$new_array = $old_array;
// Look for empty elements.
for ($i = 0; $i < $element; $i++) {
if (!$new_array[$i]) {
// Load found empty element with 0.
$new_array[$i] = 0;
}
}
// Update the changed element.
$new_array[$element] = (int)$value;
return $new_array;
}