X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/f9ade082ba49cf487af31339afa7aeeb0653af57..2cd81a74dcf24acf85c86639ad60a140037d4451:/www/list.php diff --git a/www/list.php b/www/list.php index 5a394eb..7c60ceb 100644 --- a/www/list.php +++ b/www/list.php @@ -3,13 +3,11 @@ * List a repository */ namespace phorkie; +$reqWritePermissions = false; require_once 'www-header.php'; -if ($GLOBALS['phorkie']['auth']['secure'] == 2) { - include_once 'secure.php'; -} $rs = new Repositories(); -$page = 0; +$page = $GLOBALS['phorkie']['cfg']['defaultListPage']; if (isset($_GET['page'])) { if (!is_numeric($_GET['page'])) { throw new Exception_Input('List page is not numeric'); @@ -17,18 +15,21 @@ if (isset($_GET['page'])) { $page = (int)$_GET['page'] - 1; } -$perPage = 10; -list($repos, $repoCount) = $rs->getList($page, $perPage); +$perPage = $GLOBALS['phorkie']['cfg']['perPage']; +list($repos, $repoCount, $page) = $rs->getList($page, $perPage); $pager = new Html_Pager( - $repoCount, $perPage, $page + 1, '/list/%d' + $repoCount, $perPage, $page + 1, 'list/%d' ); +$db = new Database(); render( 'list', array( - 'repos' => $repos, - 'pager' => $pager, + 'repos' => $repos, + 'pager' => $pager, + 'recents' => $db->getSearch()->listAll(0, 5, 'modate', 'desc'), + 'dh' => new \Date_HumanDiff(), ) ); ?>