From: Justin J. Novack Date: Mon, 22 Jul 2013 15:15:22 +0000 (-0400) Subject: Add perPage settings into config X-Git-Tag: v0.4.0~79 X-Git-Url: https://git.cweiske.de/phorkie.git/commitdiff_plain/a8a7006fb93492febf83dfa89583447d958b18fb Add perPage settings into config --- diff --git a/ChangeLog b/ChangeLog index 8886a1c..2d10757 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-08-20 Justin J. Novack + + * Add perPage settings into config + 2013-08-20 Christian Weiske * Fix bug #41: AGPL link broken diff --git a/data/config.default.php b/data/config.default.php index 009b572..7e6ebb9 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -12,7 +12,8 @@ $GLOBALS['phorkie']['cfg'] = array( 'setupcheck' => true, 'elasticsearch' => null, 'geshi' => 'MediaWiki/geshi/geshi/geshi.php', - 'index' => 'new'//"new" or "list" + 'index' => 'new',//"new" or "list" + 'perPage' => 10, ); $GLOBALS['phorkie']['auth'] = array( // 0 = public, no authentication, 1 = protect adds/edits/deletes, diff --git a/data/config.php.dist b/data/config.php.dist index 77d2005..81ffdbe 100644 --- a/data/config.php.dist +++ b/data/config.php.dist @@ -6,6 +6,7 @@ //$GLOBALS['phorkie']['cfg']['git']['private'] = 'ssh://git@bogo:paste/'; //$GLOBALS['phorkie']['cfg']['elasticsearch'] = 'http://localhost:9200/phorkie/'; //$GLOBALS['phorkie']['cfg']['setupcheck'] = false; +//$GLOBALS['phorkie']['cfg']['perPage'] = 10; //$GLOBALS['phorkie']['auth']['securityLevel'] = 0; //$GLOBALS['phorkie']['auth']['listedUsersOnly'] = false; diff --git a/www/list.php b/www/list.php index 1ff8a87..88ad31d 100644 --- a/www/list.php +++ b/www/list.php @@ -15,7 +15,7 @@ if (isset($_GET['page'])) { $page = (int)$_GET['page'] - 1; } -$perPage = 10; +$perPage = $GLOBALS['phorkie']['cfg']['perPage']; list($repos, $repoCount) = $rs->getList($page, $perPage); $pager = new Html_Pager( diff --git a/www/search.php b/www/search.php index 2f2de2e..82b40a7 100644 --- a/www/search.php +++ b/www/search.php @@ -20,7 +20,7 @@ if (isset($_GET['page'])) { //PEAR Pager begins at 1 $page = (int)$_GET['page'] - 1; } -$perPage = 10; +$perPage = $GLOBALS['phorkie']['cfg']['perPage']; $db = new Database(); $search = $db->getSearch();