summaryrefslogtreecommitdiffstats
path: root/usr/local/www/pkg.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-08-03 21:12:55 -0400
committerScott Ullrich <sullrich@pfsense.org>2010-08-03 21:12:55 -0400
commit3ca50a1574784d84db76d0242d59d3f78b386d13 (patch)
tree44afef4348e88837bae26f3f0b70ba917579ce2c /usr/local/www/pkg.php
parent1945741b87ded2b9ea727857ba4788f022f346c0 (diff)
downloadpfsense-3ca50a1574784d84db76d0242d59d3f78b386d13.zip
pfsense-3ca50a1574784d84db76d0242d59d3f78b386d13.tar.gz
Allow setting of how many records per page to show
Diffstat (limited to 'usr/local/www/pkg.php')
-rwxr-xr-xusr/local/www/pkg.php32
1 files changed, 26 insertions, 6 deletions
diff --git a/usr/local/www/pkg.php b/usr/local/www/pkg.php
index 3bf085e..82c87d6 100755
--- a/usr/local/www/pkg.php
+++ b/usr/local/www/pkg.php
@@ -72,6 +72,10 @@ $title = $pkg['title'];
if($_REQUEST['startdisplayingat'])
$startdisplayingat = $_REQUEST['startdisplayingat'];
+if($_REQUEST['display_maximum_rows'])
+ if($_REQUEST['display_maximum_rows'])
+ $display_maximum_rows = $_REQUEST['display_maximum_rows'];
+
$evaledvar = $config['installedpackages'][xml_safe_fieldname($pkg['name'])]['config'];
if ($_GET['act'] == "del") {
@@ -177,9 +181,9 @@ if ($pkg['tabs'] <> "") {
if($field['type'] == "sorting") {
if(isset($field['include_filtering_inputbox']))
$include_filtering_inputbox = true;
- if($field['display_maximum_rows']) {
- $display_maximum_rows = $field['display_maximum_rows'];
- }
+ if($display_maximum_rows < 1)
+ if($field['display_maximum_rows'])
+ $display_maximum_rows = $field['display_maximum_rows'];
echo "<tr><td class='listhdrr' colspan='$colspan'><center>";
echo "Filter by: ";
$isfirst = true;
@@ -227,8 +231,24 @@ if ($pkg['tabs'] <> "") {
$tmppp++;
}
$totalpages++;
- if(!$_REQUEST['pkg_filter'])
- echo "<tr><td colspan='2'><b>Displaying page $page of $totalpages</b></td></tr>";
+ if(!$_REQUEST['pkg_filter']) {
+ echo "<tr><td colspan='" . count($pkg['adddeleteeditpagefields']['columnitem']) . "'>";
+ echo "<table width='100%'>";
+ echo "<tr>";
+ echo "<td align='left'>Displaying page $page of $totalpages</b></td>";
+ echo "<td align='right'>Rows per page: <select onChange='document.pkgform.submit();' name='display_maximum_rows'>";
+ for($x=0; $x<250; $x++) {
+ if($x == $display_maximum_rows)
+ $SELECTED = "SELECTED";
+ else
+ $SELECTED = "";
+ echo "<option value='$x' $SELECTED>$x</option>\n";
+ $x=$x+9;
+ }
+ echo "</select></td></tr>";
+ echo "</table>";
+ echo "</td></tr>";
+ }
}
$cols = 0;
if($pkg['adddeleteeditpagefields']['columnitem'] <> "") {
@@ -320,7 +340,7 @@ if ($pkg['tabs'] <> "") {
echo "</tr>\n";
// Handle pagination and display_maximum_rows
if($display_maximum_rows) {
- if($pagination_counter == $display_maximum_rows or
+ if($pagination_counter == ($display_maximum_rows-1) or
$i == (count($evaledvar)-1)) {
$colcount = count($pkg['adddeleteeditpagefields']['columnitem']);
$final_footer = "";
OpenPOWER on IntegriCloud