From 5d8b97e2b82b4804d90c4e3b49c69dd39dd516cc Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 28 May 2015 14:19:59 +0200 Subject: [PATCH] (mvc) support "All" entries on grid filter --- src/opnsense/mvc/app/library/OPNsense/Base/UIModelGrid.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/opnsense/mvc/app/library/OPNsense/Base/UIModelGrid.php b/src/opnsense/mvc/app/library/OPNsense/Base/UIModelGrid.php index 47f054a15..81a153bb0 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Base/UIModelGrid.php +++ b/src/opnsense/mvc/app/library/OPNsense/Base/UIModelGrid.php @@ -102,9 +102,10 @@ class UIModelGrid } // if result is relevant, count total and add (max number of) items to result. + // $itemsPerPage = -1 is used as wildcard for "all results" if ($searchFound) { - if (count($result['rows']) < $itemsPerPage && - $recordIndex >= ($itemsPerPage*($currentPage-1)) + if ((count($result['rows']) < $itemsPerPage && + $recordIndex >= ($itemsPerPage*($currentPage-1)) || $itemsPerPage == -1) ) { $result['rows'][] = $row; }