Alexander Nicolaysen Sørnes : objectManager: State number of matches when viewing tables

Alexander Nicolaysen Sørnes asornes at winehq.org
Tue Aug 4 09:52:38 CDT 2009


Module: appdb
Branch: master
Commit: fa2d3dc05aa8eb2a622010e962c8615350eb20cc
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=fa2d3dc05aa8eb2a622010e962c8615350eb20cc

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Tue Aug  4 16:52:02 2009 +0200

objectManager: State number of matches when viewing tables

---

 include/objectManager.php |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/include/objectManager.php b/include/objectManager.php
index 6b324f7..8f4ce34 100644
--- a/include/objectManager.php
+++ b/include/objectManager.php
@@ -342,6 +342,8 @@ class ObjectManager
 
         $sQueued = $this->getQueueString($this->getIsQueue(),                                                                         $this->sState == 'rejected');
 
+        $this->showNumberOfResults($oObject);
+
         /* Should we let the class draw its own custom table? */
         if(method_exists($this->sClass, 'objectWantCustomDraw') && 
            $oObject->objectWantCustomDraw('table', $sQueued))
@@ -1643,6 +1645,21 @@ class ObjectManager
         }
     }
 
+    /* Shows how many entries we are displaying */
+    private function showNumberOfResults($oObject)
+    {
+        $iTotalEntries = $oObject->objectGetEntriesCount($this->sState, $this->oFilters);
+        if($this->oMultiPage->isEnabled())
+        {
+            $iShowingEntryFrom = $this->oMultiPage->iLowerLimit + 1;
+            $iShowingEntryTo = min($this->oMultiPage->iLowerLimit + $this->oMultiPage->iItemsPerPage, $iTotalEntries);
+            echo "Showing entry $iShowingEntryFrom to $iShowingEntryTo of $iTotalEntries<br /><br />\n";
+        } else
+        {
+            echo "Showing $iTotalEntries entries";
+        }
+    }
+
     private function handleMultiPageControls($aClean, $bItemsPerPageSelector = TRUE)
     {
         /* Display multi-page browsing controls (prev, next etc.) if applicable.
@@ -1796,6 +1813,11 @@ class MultiPage
         $this->iLowerLimit = $iLowerLimit;
     }
 
+    public function isEnabled()
+    {
+        return $this->bEnabled;
+    }
+
     function getDataFromInput($aClean)
     {
         if(isset($aClean['iItemsPerPage']) && isset($aClean['iPage']))




More information about the wine-cvs mailing list