Author: sevein
Date: Tue Apr 17 16:41:29 2012
New Revision: 11458

Log:
Use build_i18n_helper when possible

Modified:
   branches/2.0/apps/qubit/modules/search/templates/autocompleteSuccess.php

Modified: 
branches/2.0/apps/qubit/modules/search/templates/autocompleteSuccess.php
==============================================================================
--- branches/2.0/apps/qubit/modules/search/templates/autocompleteSuccess.php    
Tue Apr 17 16:38:31 2012        (r11457)
+++ branches/2.0/apps/qubit/modules/search/templates/autocompleteSuccess.php    
Tue Apr 17 16:41:29 2012        (r11458)
@@ -5,18 +5,17 @@
     <div class="group">
       <?php echo 
image_tag('/plugins/qtDominionPlugin/images/icons-small/icon-new-small.png', 
array('width' => '25', 'height' => '25')) ?>
       <ul>
+
         <?php foreach ($descriptions->getResults() as $hit): ?>
-          <?php $doc = $hit->getData() ?>
-          <?php foreach ($doc['i18n'] as $i18n): ?>
-            <?php $doc[$i18n['culture']] = $i18n ?>
-          <?php endforeach; ?>
-          <?php unset($doc['i18n']) ?>
+          <?php $doc = build_i18n_doc($hit->getData()) ?>
           <li><?php echo link_to(($doc[$sf_user->getCulture()]['title'] ?: 
$doc[$doc['sourceCulture']]['title']), array('module' => 'informationobject', 
'slug' => $doc['slug'])) ?></li>
           <!-- TODO: include description level logic; performance impact? -->
         <?php endforeach; ?>
+
         <?php if ($descriptions->getTotalHits() > 3): ?>
           <li class="showall"><?php echo link_to(__('all matching 
descriptions'), array('module' => 'search', 'action' => 'index') + 
$sf_request->getParameterHolder()->getAll()) ?></li>
         <?php endif; ?>
+
       </ul>
     </div>
 
@@ -27,17 +26,16 @@
     <div class="group">
       <?php echo 
image_tag('/plugins/qtDominionPlugin/images/icons-small/icon-topics-small.png', 
array('width' => '25', 'height' => '25')) ?>
       <ul>
+
         <?php foreach ($subjects->getResults() as $hit): ?>
-          <?php $doc = $hit->getData() ?>
-          <?php foreach ($doc['i18n'] as $i18n): ?>
-            <?php $doc[$i18n['culture']] = $i18n ?>
-          <?php endforeach; ?>
-          <?php unset($doc['i18n']) ?>
+          <?php $doc = build_i18n_doc($hit->getData()) ?>
           <li><?php echo link_to(($doc[$sf_user->getCulture()]['name'] ?: 
$doc[$doc['sourceCulture']]['name']), array('module' => 'search', 'action' => 
'index', 'subjects_id' => $hit->getId())) ?></li>
         <?php endforeach; ?>
+
         <?php if ($subjects->getTotalHits() > 3): ?>
           <li class="showall"><?php echo link_to(__('all matching subjects'), 
array('module' => 'search', 'action' => 'index') + 
$sf_request->getParameterHolder()->getAll()) ?></li>
         <?php endif; ?>
+
       </ul>
     </div>
 
@@ -48,17 +46,16 @@
     <div class="group">
       <?php echo 
image_tag('/plugins/qtDominionPlugin/images/icons-small/icon-institutions-small.png',
 array('width' => '25', 'height' => '25')) ?>
       <ul>
+
         <?php foreach ($repositories->getResults() as $hit): ?>
-          <?php $doc = $hit->getData() ?>
-          <?php foreach ($doc['actor'] as $i18n): ?>
-            <?php $doc[$i18n['culture']] = $i18n ?>
-          <?php endforeach; ?>
-          <?php unset($doc['actor']) // continue; ?>
+          <?php $doc = build_i18n_doc($hit->getData()) ?>
           <li><?php echo 
link_to(($doc[$sf_user->getCulture()]['authorizedFormOfName'] ?: 
$doc[$doc['sourceCulture']]['authorizedFormOfName']), array('module' => 
'repository', 'slug' => $doc['slug'])) ?></li>
         <?php endforeach; ?>
+
         <?php if ($repositories->getTotalHits() > 3): ?>
           <li class="showall"><?php echo link_to(__('all matching 
institutions'), array('module' => 'search', 'action' => 'index') + 
$sf_request->getParameterHolder()->getAll()) ?></li>
         <?php endif; ?>
+
       </ul>
     </div>
 
@@ -69,17 +66,16 @@
     <div class="group">
       <?php echo 
image_tag('/plugins/qtDominionPlugin/images/icons-small/icon-people-small.png', 
array('width' => '25', 'height' => '25')) ?>
       <ul>
+
         <?php foreach ($actors->getResults() as $hit): ?>
-          <?php $doc = $hit->getData() ?>
-          <?php foreach ($doc['i18n'] as $i18n): ?>
-            <?php $doc[$i18n['culture']] = $i18n ?>
-          <?php endforeach; ?>
-          <?php unset($doc['i18n']) // continue; ?>
+          <?php $doc = build_i18n_doc($hit->getData()) ?>
           <li><?php echo 
link_to(($doc[$sf_user->getCulture()]['authorizedFormOfName'] ?: 
$doc[$doc['sourceCulture']]['authorizedFormOfName']), array('module' => 
'search', 'action' => 'index', 'names_id' => $hit->getId())) ?></li>
         <?php endforeach; ?>
+
         <?php if ($actors->getTotalHits() > 3): ?>
           <li class="showall"><?php echo link_to(__('all matching people & 
organizations'), array('module' => 'search', 'action' => 'index') + 
$sf_request->getParameterHolder()->getAll()) ?></li>
         <?php endif; ?>
+
       </ul>
     </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.

Reply via email to