Move itemCount parameter from constructor to renderFull()

- Remove Pager->itemCount property and Pager->setItemCount() method
- Update usage
This commit is contained in:
Hypolite Petovan 2018-10-24 11:42:59 -04:00
commit 7c0b591043
12 changed files with 70 additions and 80 deletions

View file

@ -343,7 +343,8 @@ function videos_content(App $a)
if (DBA::isResult($r)) {
$total = count($r);
}
$pager = new Pager($a->query_string, $total, 20);
$pager = new Pager($a->query_string, 20);
$r = q("SELECT hash, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`created`) AS `created`,
ANY_VALUE(`filename`) AS `filename`, ANY_VALUE(`filetype`) as `filetype`
@ -389,7 +390,7 @@ function videos_content(App $a)
'$delete_url' => (($can_post) ? System::baseUrl() . '/videos/' . $a->data['user']['nickname'] : false)
]);
$o .= $pager->renderFull();
$o .= $pager->renderFull($total);
return $o;
}