Author: jablko
Date: Thu Aug 27 12:35:58 2009
New Revision: 3086

Log:
Factor common parts of search and list templates into partial

Added:
   trunk/apps/qubit/modules/default/
   trunk/apps/qubit/modules/default/templates/
   trunk/apps/qubit/modules/default/templates/_pager.php   (contents, props 
changed)
Modified:
   trunk/apps/qubit/modules/actor/templates/listSuccess.php
   trunk/apps/qubit/modules/informationobject/templates/listSuccess.php
   trunk/apps/qubit/modules/repository/templates/listSuccess.php
   trunk/apps/qubit/modules/search/templates/searchSuccess.php

Modified: trunk/apps/qubit/modules/actor/templates/listSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/actor/templates/listSuccess.php    Thu Aug 27 
12:16:41 2009        (r3085)
+++ trunk/apps/qubit/modules/actor/templates/listSuccess.php    Thu Aug 27 
12:35:58 2009        (r3086)
@@ -41,21 +41,4 @@
     <?php endif; ?>
     </td>
 </tr><?php endforeach; ?></tbody></table>
-
-<?php if ($pager->haveToPaginate()): ?>
-<div class="pager">
-  <?php if (1 != $pager->getCurrentPage()): ?>
- <?php echo link_to('< '.__('previous'), array('page' => 
$pager->getCurrentPage() - 1) + $sf_request->getParameterHolder()->getAll()) ?>
-  <?php endif; ?>
-  <?php foreach ($pager->getPages() as $page): ?>
-    <?php echo ($pager->getCurrentPage() == $page) ? 
'<strong>'.$page.'</strong>' : link_to($page, array('page' => $page) + 
$sf_request->getParameterHolder()->getAll()) ?>
-  <?php endforeach ?>
-  <?php if (count($pager->getPages()) > $pager->getCurrentPage()): ?>
- <?php echo link_to(__('next').' >', array('page' => $pager->getCurrentPage() 
+ 1) + $sf_request->getParameterHolder()->getAll()) ?>
-  <?php endif; ?>
-</div>
-<?php endif ?>
-
-<div class="result-count">
-<?php echo __('displaying %1% to %2% of %3% results', array('%1%' => 
$pager->getFirstHit(), '%2%' => $pager->getLastHit(), '%3%' => 
count($pager->getHits()))) ?>
-</div>
+<?php echo get_partial('default/pager', array('pager' => $pager)) ?>

Added: trunk/apps/qubit/modules/default/templates/_pager.php
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/apps/qubit/modules/default/templates/_pager.php       Thu Aug 27 
12:35:58 2009        (r3086)
@@ -0,0 +1,17 @@
+<?php if ($pager->haveToPaginate()): ?>
+<div class="pager">
+  <?php if (1 != $pager->getCurrentPage()): ?>
+ <?php echo link_to('< '.__('previous'), array('page' => 
$pager->getCurrentPage() - 1) + $sf_request->getParameterHolder()->getAll()) ?>
+  <?php endif; ?>
+  <?php foreach ($pager->getPages() as $page): ?>
+    <?php echo ($pager->getCurrentPage() == $page) ? 
'<strong>'.$page.'</strong>' : link_to($page, array('page' => $page) + 
$sf_request->getParameterHolder()->getAll()) ?>
+  <?php endforeach ?>
+  <?php if (count($pager->getPages()) > $pager->getCurrentPage()): ?>
+ <?php echo link_to(__('next').' >', array('page' => $pager->getCurrentPage() 
+ 1) + $sf_request->getParameterHolder()->getAll()) ?>
+  <?php endif; ?>
+</div>
+<?php endif; ?>
+
+<div class="result-count">
+<?php echo __('displaying %1% to %2% of %3% results', array('%1%' => 
$pager->getFirstHit(), '%2%' => $pager->getLastHit(), '%3%' => 
count($pager->getHits()))) ?>
+</div>

Modified: trunk/apps/qubit/modules/informationobject/templates/listSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/listSuccess.php        
Thu Aug 27 12:16:41 2009        (r3085)
+++ trunk/apps/qubit/modules/informationobject/templates/listSuccess.php        
Thu Aug 27 12:35:58 2009        (r3086)
@@ -64,20 +64,4 @@
 </tbody>
 </table>
 
-<?php if ($pager->haveToPaginate()): ?>
-<div class="pager">
-  <?php if (1 != $pager->getCurrentPage()): ?>
- <?php echo link_to('< '.__('previous'), array('page' => 
$pager->getCurrentPage() - 1) + $sf_request->getParameterHolder()->getAll()) ?>
-  <?php endif; ?>
-  <?php foreach ($pager->getPages() as $page): ?>
-    <?php echo ($pager->getCurrentPage() == $page) ? 
'<strong>'.$page.'</strong>' : link_to($page, array('page' => $page) + 
$sf_request->getParameterHolder()->getAll()) ?>
-  <?php endforeach ?>
-  <?php if (count($pager->getPages()) > $pager->getCurrentPage()): ?>
- <?php echo link_to(__('next').' >', array('page' => $pager->getCurrentPage() 
+ 1) + $sf_request->getParameterHolder()->getAll()) ?>
-  <?php endif; ?>
-</div>
-<?php endif; ?>
-
-<div class="result-count">
-<?php echo __('displaying %1% to %2% of %3% results', array('%1%' => 
$pager->getFirstHit(), '%2%' => $pager->getLastHit(), '%3%' => 
count($pager->getHits()))) ?>
-</div>
+<?php echo get_partial('default/pager', array('pager' => $pager)) ?>

Modified: trunk/apps/qubit/modules/repository/templates/listSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/repository/templates/listSuccess.php       Thu Aug 
27 12:16:41 2009        (r3085)
+++ trunk/apps/qubit/modules/repository/templates/listSuccess.php       Thu Aug 
27 12:35:58 2009        (r3086)
@@ -77,20 +77,4 @@
 </tbody>
 </table>
 
-<?php if ($pager->haveToPaginate()): ?>
-<div class="pager">
-  <?php if (1 != $pager->getCurrentPage()): ?>
- <?php echo link_to('< '.__('previous'), array('page' => 
$pager->getCurrentPage() - 1) + $sf_request->getParameterHolder()->getAll()) ?>
-  <?php endif; ?>
-  <?php foreach ($pager->getPages() as $page): ?>
-    <?php echo ($pager->getCurrentPage() == $page) ? 
'<strong>'.$page.'</strong>' : link_to($page, array('page' => $page) + 
$sf_request->getParameterHolder()->getAll()) ?>
-  <?php endforeach ?>
-  <?php if (count($pager->getPages()) != $pager->getCurrentPage()): ?>
- <?php echo link_to(__('next').' >', array('page' => $pager->getCurrentPage() 
+ 1) + $sf_request->getParameterHolder()->getAll()) ?>
-  <?php endif; ?>
-</div>
-<?php endif ?>
-
-<div class="result-count">
-<?php echo __('displaying %1% to %2% of %3% results', array('%1%' => 
$pager->getFirstHit(), '%2%' => $pager->getLastHit(), '%3%' => 
count($pager->getHits()))) ?>
-</div>
+<?php echo get_partial('default/pager', array('pager' => $pager)) ?>

Modified: trunk/apps/qubit/modules/search/templates/searchSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/search/templates/searchSuccess.php Thu Aug 27 
12:16:41 2009        (r3085)
+++ trunk/apps/qubit/modules/search/templates/searchSuccess.php Thu Aug 27 
12:35:58 2009        (r3086)
@@ -28,20 +28,4 @@
   </div>
 <?php endforeach; ?>
 
-<?php if ($results->haveToPaginate()): ?>
-  <div class="pager">
-    <?php if ($results->getCurrentPage() != 1): ?>
-      <?php echo link_to('< '.__('previous'), array('module' => 'search', 
'action' => 'search', 'query' => $sf_request->query, 'page' => 
$results->getCurrentPage() - 1)) ?>
-    <?php endif; ?>
-  <?php foreach ($results->getPages() as $page): ?>
-    <?php echo ($page == $results->getCurrentPage()) ? 
'<strong>'.$page.'</strong>' : link_to($page, array('module' => 'search', 
'action' => 'search', 'query' => $sf_request->query, 'page' => $page)) ?>
-  <?php endforeach; ?>
-  <?php if (count($results->getPages()) > $results->getCurrentPage()): ?>
-    <?php echo link_to(__('next').' >', array('module' => 'search', 'action' 
=> 'search', 'query' => $sf_request->query, 'page' => 
$results->getCurrentPage() + 1)) ?>
-  <?php endif; ?>
-  </div>
-<?php endif; ?>
-
-<div class="result-count">
-<?php echo __('displaying %1% to %2% of %3% results', array('%1%' => 
$results->getFirstHit(), '%2%' => $results->getLastHit(), '%3%' => 
count($hits))) ?>
-</div>
+<?php echo get_partial('default/pager', array('pager' => $results)) ?>

--~--~---------~--~----~------------~-------~--~----~
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.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to