X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/4d3b1690a86631b4b1abc74dfa4c4e5bde8faf10..49a42cb5ac2e29668d2ac584e1a84d9818b047ea:/www/list.php diff --git a/www/list.php b/www/list.php index a212322..7c60ceb 100644 --- a/www/list.php +++ b/www/list.php @@ -1,38 +1,35 @@ getList($page, $perPage); +$perPage = $GLOBALS['phorkie']['cfg']['perPage']; +list($repos, $repoCount, $page) = $rs->getList($page, $perPage); -$links = array('prev' => null, 'next' => null); -if ($page > 0) { - $links['prev'] = '/list/' . ($page - 1); - if ($page - 1 == 0) { - $links['prev'] = '/list'; - } -} -if (count($repos) && count($repos) == $perPage) { - $links['next'] = '/list/' . ($page + 1); -} +$pager = new Html_Pager( + $repoCount, $perPage, $page + 1, 'list/%d' +); +$db = new Database(); render( 'list', array( - 'repos' => $repos, - 'links' => $links, + 'repos' => $repos, + 'pager' => $pager, + 'recents' => $db->getSearch()->listAll(0, 5, 'modate', 'desc'), + 'dh' => new \Date_HumanDiff(), ) ); ?>