Author: david
Date: Thu Oct 13 11:41:46 2011
New Revision: 10071
Log:
Add result counter
Modified:
trunk/apps/qubit/modules/informationobject/actions/fileListAction.class.php
trunk/apps/qubit/modules/informationobject/templates/fileListSuccess.php
trunk/css/print.css
Modified:
trunk/apps/qubit/modules/informationobject/actions/fileListAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/fileListAction.class.php
Thu Oct 13 11:41:08 2011 (r10070)
+++ trunk/apps/qubit/modules/informationobject/actions/fileListAction.class.php
Thu Oct 13 11:41:46 2011 (r10071)
@@ -115,6 +115,7 @@
$criteria = QubitAcl::addFilterDraftsCriteria($criteria);
$this->results = array();
+ $this->resultCount = 0;
if (null !== ($results = QubitInformationObject::get($criteria)))
{
foreach($results as $item)
@@ -134,6 +135,8 @@
'accessConditions' =>
$item->getAccessConditions(array('cultureFallback' => true)),
'locations' => self::getLocationString($item)
);
+
+ $this->resultCount++;
}
}
Modified:
trunk/apps/qubit/modules/informationobject/templates/fileListSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/fileListSuccess.php
Thu Oct 13 11:41:08 2011 (r10070)
+++ trunk/apps/qubit/modules/informationobject/templates/fileListSuccess.php
Thu Oct 13 11:41:46 2011 (r10071)
@@ -5,7 +5,7 @@
<h1 class="label"><?php echo __('File list') ?></h1>
-<?php $row = 0; foreach ($results as $parent => $items): ?>
+<?php $row = $startrow = 1; foreach ($results as $parent => $items): ?>
<h2 class="element-invisible"><?php echo __('%1% hierarchy', array('%1%' =>
sfConfig::get('app_ui_label_informationobject'))) ?></h2>
<div class="resource-hierarchy">
@@ -33,7 +33,7 @@
</thead><tbody>
<?php foreach ($items as $item): ?>
<tr>
- <td><?php echo ++$row ?></td>
+ <td><?php echo $row++ ?></td>
<td><?php echo $item['referenceCode'] ?></td>
<td><?php echo $item['title'] ?></td>
<td><?php echo $item['dates'] ?></td>
@@ -45,4 +45,11 @@
<?php endforeach; ?>
</tbody>
</table>
+
+ <div class="result-count">
+ <?php echo __('Showing %1% to %2% of %3% results', array(
+ '%1%' => $startrow,
+ '%2%' => $startrow += count($items),
+ '%3%' => $resultCount + 1)) ?>
+ </div>
<?php endforeach; ?>
Modified: trunk/css/print.css
==============================================================================
--- trunk/css/print.css Thu Oct 13 11:41:08 2011 (r10070)
+++ trunk/css/print.css Thu Oct 13 11:41:46 2011 (r10071)
@@ -295,6 +295,12 @@
margin: 0;
}
+.result-count
+{
+ text-align: center;
+ color: #ccc;
+}
+
#page,
#page-wrapper
{
--
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.