X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/2b4b34a76f42841e964a549fc64c02ba4f60a3f4..HEAD:/www/list.php diff --git a/www/list.php b/www/list.php index a75fda8..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(), ) ); ?>