Author: sevein
Date: Wed Apr 18 17:32:58 2012
New Revision: 11471
Log:
Markup cleanups, use of pager partial
Modified:
branches/2.0/apps/qubit/modules/taxonomy/actions/browseAction.class.php
branches/2.0/apps/qubit/modules/taxonomy/templates/browseSuccess.php
Modified:
branches/2.0/apps/qubit/modules/taxonomy/actions/browseAction.class.php
==============================================================================
--- branches/2.0/apps/qubit/modules/taxonomy/actions/browseAction.class.php
Wed Apr 18 17:02:54 2012 (r11470)
+++ branches/2.0/apps/qubit/modules/taxonomy/actions/browseAction.class.php
Wed Apr 18 17:32:58 2012 (r11471)
@@ -66,15 +66,12 @@
return;
}
- // mock up a QubitPager for partial template backward compatibility
- $this->pager = new stdClass();
- $this->pager->resultSet = $resultSet;
+ $this->pager = new QubitSearchPager;
+ $this->pager->setResultSet($resultSet);
+ $this->pager->setPage($request->page ? $request->page : 1);
- if (0 < $resultSet->getTotalHits())
+ if ($this->pager->hasResults())
{
- $this->pager->resultSet = $resultSet;
- $this->pager->page = $request->page ? $request->page : 1;
-
if ($resultSet->hasFacets())
{
// build lookup tables for I18nized values
Modified: branches/2.0/apps/qubit/modules/taxonomy/templates/browseSuccess.php
==============================================================================
--- branches/2.0/apps/qubit/modules/taxonomy/templates/browseSuccess.php
Wed Apr 18 17:02:54 2012 (r11470)
+++ branches/2.0/apps/qubit/modules/taxonomy/templates/browseSuccess.php
Wed Apr 18 17:32:58 2012 (r11471)
@@ -2,65 +2,39 @@
<div class="row">
- <div class="span12" id="headline">
+ <div class="span12 hidden-phone">
<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))); ?>
+ <?php echo __('%1% %2%', array('%1%' => $pager->getNbResults(), '%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% %2%', array('%1%' =>
$pager->resultSet->getTotalHits(), '%2%' => ucfirst($field))); ?></h2>
+ <div id="filter" class="span12 visible-phone">
+ <h2 class="widebtn gray btn-huge" data-toggle="collapse"
data-target="#facets"><?php echo __('Filter %1% %2%', array('%1%' =>
$pager->getNbResults(), '%2%' => ucfirst($field))); ?></h2>
</div>
+
</div>
<div class="row">
- <div class="span3" id="facets">
- <!-- FIXME: HACK HERE -->.
- </div><!-- /.column .sidebar -->
-
- <div class="span9" id="grid">
- <div id="print-date">
- Printed: 2012-02-14
- </div>
- <div class="row">
- <div class="span9">
-
- <?php foreach ($pager->resultSet->getResults() as $hit): ?>
-
- <?php $doc = $hit->getData(); ?>
- <?php foreach ($doc['i18n'] as $i18n): ?>
+ <div class="span3" id="facets">
+
+ </div>
- <?php $doc[$i18n['culture']] = $i18n; ?>
+ <div class="span9">
- <?php endforeach; ?>
- <?php unset($doc['i18n']); // continue; ?>
+ <?php foreach ($pager->getResults() as $hit): ?>
+ <?php $doc = build_i18n_doc($hit) ?>
+ <div class="institution maxi">
+ <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; ?>
- <div class="institution maxi">
- <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 echo get_partial('default/pager', array('pager' => $pager)) ?>
- <?php endforeach; ?>
- </div>
- </div>
+ </div>
- <div class="row">
- <div class="span9">
- <?php if ($pager->resultSet->getTotalHits() > $pager->maxPerPage): ?>
-
- <!-- FIXME: these should probably share a line -->
- <?php if (1 < $pager->page): ?>
- <?php echo link_to('«'. __('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'). ' »', array('page' =>
$pager->page + 1) + $sf_request->getParameterHolder()->getAll(), array('rel' =>
'next', 'class' => 'widebtn btn-huge')) ?>
- <?php endif; ?>
+ </div>
- <?php endif; ?>
- </div>
- </div>
- </div><!-- /#grid -->
- </div><!-- /.searchresults -->
+</div>
--
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.