Author: jablko
Date: Sat Oct 16 19:59:01 2010
New Revision: 8183

Log:
Continue avoiding tables for layout

Modified:
   trunk/apps/qubit/modules/function/templates/indexIsdfSuccess.php

Modified: trunk/apps/qubit/modules/function/templates/indexIsdfSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/function/templates/indexIsdfSuccess.php    Sat Oct 
16 19:50:50 2010        (r8182)
+++ trunk/apps/qubit/modules/function/templates/indexIsdfSuccess.php    Sat Oct 
16 19:59:01 2010        (r8183)
@@ -24,7 +24,7 @@
     <h3><?php echo __('Parallel form(s) of name') ?></h3>
     <div>
       <ul>
-        <?php foreach ($this->resource->getOtherNames(array('typeId' => 
QubitTerm::PARALLEL_FORM_OF_NAME_ID)) as $item): ?>
+        <?php foreach ($resource->getOtherNames(array('typeId' => 
QubitTerm::PARALLEL_FORM_OF_NAME_ID)) as $item): ?>
           <li><?php echo render_value($item) ?></li>
         <?php endforeach; ?>
       </ul>
@@ -35,7 +35,7 @@
     <h3><?php echo __('Other form(s) of name') ?></h3>
     <div>
       <ul>
-        <?php foreach ($this->resource->getOtherNames(array('typeId' => 
QubitTerm::OTHER_FORM_OF_NAME_ID)) as $item): ?>
+        <?php foreach ($resource->getOtherNames(array('typeId' => 
QubitTerm::OTHER_FORM_OF_NAME_ID)) as $item): ?>
           <li><?php echo render_value($item) ?></li>
         <?php endforeach; ?>
       </ul>
@@ -70,160 +70,62 @@
     <div class="field">
       <h3><?php echo __('Related function') ?></h3>
       <div>
-        <table class="inline" style="margin-bottom: 5px">
 
-          <!-- Authorized form of name -->
-          <tr>
-            <th style="text-align: left; padding: 1px">
-              <?php echo __('Authorized form of name') ?>
-            </th>
-          </tr><tr>
-            <td>
-              <?php echo link_to($item->getOpposedObject($resource->id), 
array($item->getOpposedObject($resource->id), 'module' => 'function')) ?>
-            </td>
-          </tr>
-
-          <!-- Identifier -->
-          <?php if (0 < strlen($identifier = 
$item->getOpposedObject($resource->id)->getDescriptionIdentifier(array('cultureFallback'
 => true)))): ?>
-            <tr>
-              <th style="text-align: left; padding: 1px">
-                <?php echo __('Identifier') ?>
-              </th>
-            </tr><tr>
-              <td>
-                <?php echo render_value($identifier) ?>
-              </td>
-            </tr>
-          <?php endif; ?>
-
-          <!-- Type of function -->
-          <?php if (isset($item->getOpposedObject($resource->id)->type)): ?>
-            <tr>
-              <th style="text-align: left; padding: 1px">
-                <?php echo __('Type') ?>
-              </th>
-            </tr><tr>
-              <td>
-                <?php echo 
render_value($item->getOpposedObject($resource->id)->type) ?>
-              </td>
-            </tr>
-          <?php endif; ?>
-
-          <!-- Category of relationship -->
-          <?php if (isset($item->type)): ?>
-            <tr>
-              <th style="text-align: left; padding: 1px">
-                <?php echo __('Category of relationship') ?>
-              </th>
-            </tr><tr>
-              <td>
-                <?php echo render_value($item->type) ?>
-              </td>
-            </tr>
-          <?php endif; ?>
-
-          <!-- Description of relationship -->
-          <?php if (null !== $note = 
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DESCRIPTION_ID)): ?>
-            <tr>
-              <th style="text-align: left; padding: 1px">
-                <?php echo __('Description of relationship') ?>
-              </th>
-            </tr><tr>
-              <td>
-                <?php echo 
render_value($note->getContent(array('cultureFallback' => true))) ?>
-              </td>
-            </tr>
-          <?php endif; ?>
-
-          <!-- Dates of relationship -->
-          <?php if ((null !== $note = 
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DATE_DISPLAY_ID)) || 0 < 
count($dateArray = $item->getDates())): ?>
-            <tr>
-              <th style="text-align: left; padding: 1px">
-                <?php echo __('Dates of relationship') ?>
-              </th>
-            </tr><tr>
-              <td>
-                <?php if (null !== $note && 0 < strlen($dateDisplay = 
$note->getContent(array('cultureFallback' => true)))): ?>
-                  <?php echo render_value($dateDisplay) ?>
-                <?php elseif (2 == count($dateArray)): ?>
-                  <?php echo __('%1% - %2%', array('%1%' => 
Qubit::renderDate($dateArray['start']), '%2%' => 
Qubit::renderDate($dateArray['end']))) ?>
-                <?php else: ?>
-                  <?php echo Qubit::renderDate(array_shift($dateArray)) ?>
-                <?php endif; ?>
-              </td>
-            </tr>
-          <?php endif; ?>
+        <?php echo render_show(__('Authorized form of name'), 
link_to($item->getOpposedObject($resource->id), 
array($item->getOpposedObject($resource->id), 'module' => 'function'))) ?>
 
-        </table>
+        <?php echo render_show(__('Identifier'), 
$item->getOpposedObject($resource->id)->getDescriptionIdentifier(array('cultureFallback'
 => true))) ?>
+
+        <?php echo render_show(__('Type'), 
render_value($item->getOpposedObject($resource->id)->type)) ?>
+
+        <?php echo render_show(__('Category of relationship'), 
render_value($item->type)) ?>
+
+        <?php if (null !== $note = 
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DESCRIPTION_ID)): ?>
+          <?php echo render_show(__('Description of relationship'), 
render_value($note->getContent(array('cultureFallback' => true)))) ?>
+        <?php endif; ?>
+
+        <div class="field">
+          <h3><?php echo __('Dates of relationship') ?></h3>
+          <div>
+            <?php if (null !== $note = 
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DATE_DISPLAY_ID)): ?>
+              <?php echo 
render_value($note->getContent(array('cultureFallback' => true))) ?>
+            <?php elseif (1 < count($dateArray = $relation->getDates())): ?>
+              <?php echo __('%1% - %2%', array('%1%' => 
Qubit::renderDate($dateArray['start']), '%2%' => 
Qubit::renderDate($dateArray['end']))) ?>
+            <?php else: ?>
+              <?php echo Qubit::renderDate(array_shift($dateArray)) ?>
+            <?php endif; ?>
+          </div>
+        </div>
 
       </div>
     </div>
   <?php endforeach; ?>
 
-  <!-- Related corporate bodies -->
   <?php foreach ($actorRelations as $item): ?>
     <div class="field">
       <h3><?php echo __('Related authority record') ?></h3>
       <div>
-        <table class="inline" style="margin-top: 5px">
 
-          <!-- Authorized form of name -->
-          <tr>
-            <th style="text-align: left; padding: 1px">
-              <?php echo __('Authorized form of name') ?>
-            </th>
-          </tr><tr>
-            <td>
-              <?php echo 
link_to($item->object->getAuthorizedFormOfName(array('cultureFallback' => 
true)), array($item->object, 'module' => 'actor')) ?>
-            </td>
-          </tr>
-
-          <!-- Identifier  -->
-          <?php if (isset($item->object->descriptionIdentifier)): ?>
-            <tr>
-              <th style="text-align: left; padding: 1px">
-                <?php echo __('Identifier') ?>
-              </th>
-            </tr><tr>
-              <td>
-                <?php echo render_value($item->object->descriptionIdentifier) 
?>
-              </td>
-            </tr>
-          <?php endif; ?>
-
-          <!-- Description of relationship -->
-          <?php if (null !== $note = 
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DESCRIPTION_ID)): ?>
-            <tr>
-              <th style="text-align: left; padding: 1px">
-                <?php echo __('Nature of relationship') ?>
-              </th>
-            </tr><tr>
-              <td>
-                <?php echo 
render_value($note->getContent(array('cultureFallback' => true))) ?>
-              </td>
-            </tr>
-          <?php endif; ?>
-
-          <!-- Dates of relationship -->
-          <?php if ((null !== $note = 
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DATE_DISPLAY_ID)) || 0 < 
count($dateArray = $item->getDates())): ?>
-            <tr>
-              <th style="text-align: left; padding: 1px">
-                <?php echo __('Dates of the relationship') ?>
-              </th>
-            </tr><tr>
-              <td>
-                <?php if (null !== $note && 0 < strlen($dateDisplay = 
$note->getContent(array('cultureFallback' => true)))): ?>
-                  <?php echo render_value($dateDisplay) ?>
-                <?php elseif (2 == count($dateArray)): ?>
-                  <?php echo __('%1% - %2%', array('%1%' => 
Qubit::renderDate($dateArray['start']), '%2%' => 
Qubit::renderDate($dateArray['end']))) ?>
-                <?php else: ?>
-                  <?php echo Qubit::renderDate(array_shift($dateArray)) ?>
-                <?php endif; ?>
-              </td>
-            </tr>
-          <?php endif; ?>
+        <?php echo render_show(__('Authorized form of name'), 
link_to($item->object->getAuthorizedFormOfName(array('cultureFallback' => 
true)), array($item->object, 'module' => 'actor'))) ?>
+
+        <?php echo render_show(__('Identifier'), 
render_value($item->object->descriptionIdentifier)) ?>
+
+        <?php if (null !== $note = 
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DESCRIPTION_ID)): ?>
+          <?php echo render_show(__('Nature of relationship'), 
render_value($note->getContent(array('cultureFallback' => true)))) ?>
+        <?php endif; ?>
+
+        <div class="field">
+          <h3><?php echo __('Dates of the relationship') ?></h3>
+          <div>
+            <?php if (null !== $note = 
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DATE_DISPLAY_ID)): ?>
+              <?php echo 
render_value($note->getContent(array('cultureFallback' => true))) ?>
+            <?php elseif (1 < count($dateArray = $item->getDates())): ?>
+              <?php echo __('%1% - %2%', array('%1%' => 
Qubit::renderDate($dateArray['start']), '%2%' => 
Qubit::renderDate($dateArray['end']))) ?>
+            <?php else: ?>
+              <?php echo Qubit::renderDate(array_shift($dateArray)) ?>
+            <?php endif; ?>
+          </div>
+        </div>
 
-        </table>
       </div>
     </div>
   <?php endforeach; ?>
@@ -233,65 +135,28 @@
     <div class="field">
       <h3><?php echo __('Related resource') ?></h3>
       <div>
-        <table class="inline" style="margin-bottom: 5px">
 
-          <!-- Title -->
-          <tr>
-            <th style="text-align: left; padding: 1px">
-              <?php echo __('Title') ?>
-            </th>
-          </tr><tr>
-            <td>
-              <?php echo 
link_to($item->object->getTitle(array('cultureFallback' => true)), 
array($item->object, 'module' => 'informationobject')) ?>
-            </td>
-          </tr>
-
-          <!-- Identifier  -->
-          <?php if (isset($item->object->identifier)): ?>
-            <tr>
-              <th style="text-align: left; padding: 1px">
-                <?php echo __('Identifier') ?>
-              </th>
-            </tr><tr>
-              <td>
-                <?php $isad = new sfIsadPlugin($item->object); echo 
$isad->referenceCode ?>
-              </td>
-            </tr>
-          <?php endif; ?>
-
-          <!-- Description of relationship -->
-          <?php if (null !== $note = 
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DESCRIPTION_ID)): ?>
-            <tr>
-              <th style="text-align: left; padding: 1px">
-                <?php echo __('Nature of relationship') ?>
-              </th>
-            </tr><tr>
-              <td>
-                <?php echo 
render_value($note->getContent(array('cultureFallback' => true))) ?>
-              </td>
-            </tr>
-          <?php endif; ?>
-
-          <!-- Dates of relationship -->
-          <?php if ((null !== $note = 
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DATE_DISPLAY_ID)) || 0 < 
count($dateArray = $item->getDates())): ?>
-            <tr>
-              <th style="text-align: left; padding: 1px">
-                <?php echo __('Dates of the relationship') ?>
-              </th>
-            </tr><tr>
-              <td>
-                <?php if (null !== $note && 0 < strlen($dateDisplay = 
$note->getContent(array('cultureFallback' => true)))): ?>
-                  <?php echo render_value($dateDisplay) ?>
-                <?php elseif (2 == count($dateArray)): ?>
-                  <?php echo __('%1% - %2%', array('%1%' => 
Qubit::renderDate($dateArray['start']), '%2%' => 
Qubit::renderDate($dateArray['end']))) ?>
-                <?php else: ?>
-                  <?php echo Qubit::renderDate(array_shift($dateArray)) ?>
-                <?php endif; ?>
-              </td>
-            </tr>
-          <?php endif; ?>
+        <?php echo render_show(__('Title'), 
link_to($item->object->getTitle(array('cultureFallback' => true)), 
array($item->object, 'module' => 'informationobject'))) ?>
+
+        <?php $isad = new sfIsadPlugin($item->object); echo 
render_show(__('Identifier'), $isad->referenceCode) ?>
+
+        <?php if (null !== $note = 
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DESCRIPTION_ID)): ?>
+          <?php echo render_show(__('Nature of relationship'), 
render_value($note->getContent(array('cultureFallback' => true)))) ?>
+        <?php endif; ?>
+
+        <div class="field">
+          <h3><?php echo __('Dates of the relationship') ?></h3>
+          <div>
+            <?php if (null !== $note = 
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DATE_DISPLAY_ID)): ?>
+              <?php echo 
render_value($note->getContent(array('cultureFallback' => true))) ?>
+            <?php elseif (1 < count($item->getDates())): ?>
+              <?php echo __('%1% - %2%', array('%1%' => 
Qubit::renderDate($dateArray['start']), '%2%' => 
Qubit::renderDate($dateArray['end']))) ?>
+            <?php else: ?>
+              <?php echo Qubit::renderDate(array_shift($dateArray)) ?>
+            <?php endif; ?>
+          </div>
+        </div>
 
-        </table>
       </div>
     </div>
   <?php endforeach; ?>

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