Author: sevein
Date: Tue Oct 4 18:17:59 2011
New Revision: 9919
Log:
Check dates before start iteration
Modified:
trunk/apps/qubit/modules/search/templates/indexSuccess.php
Modified: trunk/apps/qubit/modules/search/templates/indexSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/search/templates/indexSuccess.php Tue Oct 4
17:20:43 2011 (r9918)
+++ trunk/apps/qubit/modules/search/templates/indexSuccess.php Tue Oct 4
18:17:59 2011 (r9919)
@@ -32,7 +32,7 @@
<h2><?php echo link_to($doc->title, array('slug' => $doc->slug,
'module' => 'informationobject')) ?><?php if
(QubitTerm::PUBLICATION_STATUS_DRAFT_ID == $doc->publicationStatusId): ?> <span
class="publicationStatus">draft</span><?php endif; ?></h2>
<?php if ($doc->scopeAndContent): ?>
- <div>
+ <div class="field">
<?php echo highlight_text(truncate_text($doc->scopeAndContent,
256), $sf_request->query) ?>
</div>
<?php endif; ?>
@@ -41,24 +41,27 @@
<?php echo render_show(__('Reference code'),
render_value($doc->referenceCode)); ?>
<?php endif; ?>
- <div class="field">
- <h3><?php echo __('Date(s)') ?></h3>
- <div>
- <ul>
- <?php foreach (unserialize($doc->dates) as $date): ?>
- <li>
-
- <?php echo $date['rendered'] ?> (<?php echo $date['type'] ?>)
-
- <?php if (isset($date['actor'])): ?>
- <?php echo link_to($date['actor'], array($date['actor'],
'module' => 'actor')) ?>
- <?php endif; ?>
-
- </li>
- <?php endforeach; ?>
- </ul>
+ <?php $dates = unserialize($doc->dates) ?>
+ <?php if (0 < count($dates)): ?>
+ <div class="field">
+ <h3><?php echo __('Date(s)') ?></h3>
+ <div>
+ <ul>
+ <?php foreach ($dates as $date): ?>
+ <li>
+
+ <?php echo $date['rendered'] ?> (<?php echo $date['type']
?>)
+
+ <?php if (isset($date['actor'])): ?>
+ <?php echo link_to($date['actor'], array($date['actor'],
'module' => 'actor')) ?>
+ <?php endif; ?>
+
+ </li>
+ <?php endforeach; ?>
+ </ul>
+ </div>
</div>
- </div>
+ <?php endif; ?>
<?php if ($doc->levelOfDescription): ?>
<?php echo render_show(__('Level of description'),
render_value($doc->levelOfDescription)) ?>
--
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.