Author: david
Date: Fri Oct 21 14:50:04 2011
New Revision: 10166

Log:
Show notice when shown results is less than found results

Modified:
   trunk/apps/qubit/modules/search/actions/indexAction.class.php
   trunk/apps/qubit/modules/search/templates/_searchResults.php

Modified: trunk/apps/qubit/modules/search/actions/indexAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/search/actions/indexAction.class.php       Fri Oct 
21 14:48:46 2011        (r10165)
+++ trunk/apps/qubit/modules/search/actions/indexAction.class.php       Fri Oct 
21 14:50:04 2011        (r10166)
@@ -26,7 +26,6 @@
     if ('print' == $request->getGetParameter('media'))
     {
       $this->getResponse()->addStylesheet('print-preview', 'last');
-      $request->limit = 500;
     }
 
     if (!isset($request->limit))
@@ -64,7 +63,16 @@
     if (!empty($hits))
     {
       $this->pager = new QubitArrayPager;
-      $this->pager->setMaxPerPage($request->limit);
+
+      if ('print' != $request->getGetParameter('media'))
+      {
+        $this->pager->setMaxPerPage($request->limit);
+      }
+      else
+      {
+        $this->pager->setMaxPerPage(500); // Force
+      }
+
       $this->pager->hits = $hits;
       $this->pager->setPage($request->page);
     }

Modified: trunk/apps/qubit/modules/search/templates/_searchResults.php
==============================================================================
--- trunk/apps/qubit/modules/search/templates/_searchResults.php        Fri Oct 
21 14:48:46 2011        (r10165)
+++ trunk/apps/qubit/modules/search/templates/_searchResults.php        Fri Oct 
21 14:50:04 2011        (r10166)
@@ -1,7 +1,11 @@
 <div id="search-stats">
   <?php echo __('Found %1% results in %2% seconds', array(
-      '%1%' => count($pager->hits),
+      '%1%' => $pager->getNbResults(),
       '%2%' => $timer->elapsed())) ?>
+  <?php if ('print' == $sf_request->getGetParameter('media') && 
$pager->haveToPaginate()): ?>
+    <?php echo __('(Only showing first %1% results for performance reasons)',
+      array('%1%' => $pager->maxPerPage)) ?>
+  <?php endif; ?>
 </div>
 
 <div class="section">

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to