function pmpapi_pull_create_pager in Public Media Platform API Integration 7
Creates a pager for a PMP doc metadata table.
Parameters
$total int: Total number of results in the paged table
Return value
string A themed HTML pager
1 call to pmpapi_pull_create_pager()
- pmpapi_pull_filter_form in pmpapi_pull/
pmpapi_pull.pages.inc - Form constructor for the PMPAPI pull search form.
File
- pmpapi_pull/
pmpapi_pull.pages.inc, line 279
Code
function pmpapi_pull_create_pager($total) {
$page = isset($_GET['page']) ? abs((int) $_GET['page']) : 0;
// 'hacking' the pager
// See inpiration (D6) at:
// http://www.jacobsingh.name/content/how-use-themepager-without-sql-query-and-go-hell
global $pager_page_array, $pager_total;
$pager_total[0] = ceil($total / 10);
$pager_page_array[0] = $page;
return theme('pager', array(
'quantity' => 4,
));
}