tripal_feature_featurelocs_as_child.tpl.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. $featurelocs_as_child = $variables['tripal_feature']['featurelocs_as_child'];
  3. $feature = $variables['node']->feature;
  4. ?>
  5. <div id="tripal_feature-featurelocs_as_child-box" class="tripal_feature-info-box tripal-info-box">
  6. <div class="tripal_feature-info-box-title tripal-info-box-title">Locations where <?php print $feature->featurename;?> is found</div>
  7. <div class="tripal_feature-info-box-desc tripal-info-box-desc">The <?php print $feature->featurename;?> feature is located relative to the following features:</div>
  8. <table class="tripal_feature-table tripal-table tripal-table-horz">
  9. <tr>
  10. <th>Name</th>
  11. <th>Type</th>
  12. <th>Position</th>
  13. <th>Phase</th>
  14. <th>Strand</th>
  15. </tr>
  16. <?php
  17. $i = 0;
  18. foreach ($featurelocs_as_child as $index => $loc){
  19. $class = 'tripal_feature-table-odd-row tripal-table-odd-row';
  20. if($i % 2 == 0 ){
  21. $class = 'tripal_feature-table-odd-row tripal-table-even-row';
  22. }
  23. $locname = $loc->name;
  24. if($loc->nid){
  25. $locname = "<a href=\"" . url("node/$loc->nid") . "\">$loc->name</a> ";
  26. }
  27. ?>
  28. <tr class="<?php print $class ?>">
  29. <td><?php print $locname ?></td>
  30. <td><?php print $loc->cvname ?></td>
  31. <td><?php print $loc->src_name .":".$loc->fmin . ".." . $loc->fmax ?></td>
  32. <td><?php print $loc->phase ?></td>
  33. <td><?php print $loc->strand ?></td>
  34. </tr>
  35. <?php
  36. $i++;
  37. } ?>
  38. </table>
  39. </div>