Author: mj
Date: Fri Apr  6 07:50:54 2012
New Revision: 11410

Log:
Issue 2288.  Implement term (subject/place) browse.

Modified:
   
branches/2.0/plugins/qtDominionPlugin/modules/taxonomy/actions/browseAction.class.php
   
branches/2.0/plugins/qtDominionPlugin/modules/taxonomy/templates/browseSuccess.php

Modified: 
branches/2.0/plugins/qtDominionPlugin/modules/taxonomy/actions/browseAction.class.php
==============================================================================
--- 
branches/2.0/plugins/qtDominionPlugin/modules/taxonomy/actions/browseAction.class.php
       Fri Apr  6 07:39:20 2012        (r11409)
+++ 
branches/2.0/plugins/qtDominionPlugin/modules/taxonomy/actions/browseAction.class.php
       Fri Apr  6 07:50:54 2012        (r11410)
@@ -34,14 +34,14 @@
     }
 
     // determine what kind of term we are browsing
-    switch ($this->request->id)
+    switch ($request->id)
     {
       case QubitTaxonomy::SUBJECT_ID:
-        $this->field = 'subjects_id';
+        $this->field = 'subjects';
         break;
 
       case QubitTaxonomy::PLACE_ID:
-        $this->field = 'places_id';
+        $this->field = 'places';
         break;
 
       case '':

Modified: 
branches/2.0/plugins/qtDominionPlugin/modules/taxonomy/templates/browseSuccess.php
==============================================================================
--- 
branches/2.0/plugins/qtDominionPlugin/modules/taxonomy/templates/browseSuccess.php
  Fri Apr  6 07:39:20 2012        (r11409)
+++ 
branches/2.0/plugins/qtDominionPlugin/modules/taxonomy/templates/browseSuccess.php
  Fri Apr  6 07:50:54 2012        (r11410)
@@ -1,12 +1,14 @@
 <div id="searchresults">
   <div class="row">
     <div class="span12" id="headline">
-      <h1><?php echo 
image_tag('/plugins/qtDominionPlugin/images/icons-large/icon-subjects.png', 
array('width' => '42', 'height' => '42')) ?>
-          <?php echo __('%1% Subjects', array('%1%' => 
$pager->resultSet->getTotalHits())); ?></h1>
+      <h1>
+        <?php echo 
image_tag('/plugins/qtDominionPlugin/images/icons-large/icon-'.$field.'.png', 
array('width' => '42', 'height' => '42')) ?>
+        <?php echo __('%1% %2%', array('%1%' => 
$pager->resultSet->getTotalHits(), '%2%' => ucfirst($field))); ?>
+      </h1>
     </div>
 
     <div id="filter" class="span12 mobileonly">
-      <h2 class="widebtn gray btn-huge" data-toggle="collapse" 
data-target="#facets"><?php echo __('Filter %1% Subjects', array('%1%' => 
$pager->resultSet->getTotalHits())); ?></h2>
+      <h2 class="widebtn gray btn-huge" data-toggle="collapse" 
data-target="#facets"><?php echo __('Filter %1% %2%', array('%1%' => 
$pager->resultSet->getTotalHits(), '%2%' => ucfirst($field))); ?></h2>
     </div>
   </div>
 
@@ -34,7 +36,7 @@
             <?php unset($doc['i18n']); // continue; ?>
 
             <div class="institution maxi">
-              <h2 class="filltext"><?php echo 
link_to($doc[$sf_user->getCulture()]['name'] ?: 
$doc[$doc['sourceCulture']]['name'], array('module' => 'search', $field => 
$hit->getId())) ?></h2>
+              <h2 class="filltext"><?php echo 
link_to($doc[$sf_user->getCulture()]['name'] ?: 
$doc[$doc['sourceCulture']]['name'], array('module' => 'search', $field .'_id' 
=> $hit->getId())) ?></h2>
             </div>
 
           <?php endforeach; ?>
@@ -44,7 +46,18 @@
       
       <div class="row">
         <div class="span9">
-          <a href="#" class="widebtn btn-huge">next &raquo;</a>
+          <?php if ($pager->resultSet->getTotalHits() > $pager->maxPerPage): ?>
+
+          <!-- FIXME: these should probably share a line -->
+          <?php if (1 < $pager->page): ?>
+            <?php echo link_to('&laquo;'. __('Previous'), array('page' => 
$pager->page - 1) + $sf_request->getParameterHolder()->getAll(), array('rel' => 
'prev', 'class' => 'widebtn btn-huge')) ?>
+            <?php endif; ?>
+
+          <?php if ($pager->resultSet->getTotalHits() > ($pager->maxPerPage * 
$pager->page)): ?>
+            <?php echo link_to(__('Next'). ' &raquo;', array('page' => 
$pager->page + 1) + $sf_request->getParameterHolder()->getAll(), array('rel' => 
'next', 'class' => 'widebtn btn-huge')) ?>
+            <?php endif; ?>
+
+          <?php endif; ?>
         </div>
       </div>
     </div><!-- /#grid -->

-- 
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