tripal_feature_featurelocs_as_child.tpl.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. <?php if(count($featurelocs_as_child) > 0){ ?>
  9. <table id="tripal_feature-featurelocs_as_child-table" class="tripal_feature-table tripal-table tripal-table-horz">
  10. <tr>
  11. <th>Name</th>
  12. <th>Type</th>
  13. <th>Position</th>
  14. <th>Phase</th>
  15. <th>Strand</th>
  16. </tr>
  17. <?php
  18. $i = 0;
  19. foreach ($featurelocs_as_child as $index => $loc){
  20. $class = 'tripal_feature-table-odd-row tripal-table-odd-row';
  21. if($i % 2 == 0 ){
  22. $class = 'tripal_feature-table-odd-row tripal-table-even-row';
  23. }
  24. $locname = $loc->name;
  25. if($loc->nid){
  26. $locname = "<a href=\"" . url("node/$loc->nid") . "\">$loc->name</a> ";
  27. }
  28. ?>
  29. <tr class="<?php print $class ?>">
  30. <td><?php print $locname ?></td>
  31. <td><?php print $loc->cvname ?></td>
  32. <td><?php print $loc->src_name .":".$loc->fmin . ".." . $loc->fmax ?></td>
  33. <td><?php print $loc->phase ?></td>
  34. <td><?php print $loc->strand ?></td>
  35. </tr>
  36. <?php
  37. $i++;
  38. } ?>
  39. </table>
  40. <?php } else { ?>
  41. <div class="tripal-no-results">There are no locations where this feature is found</div>
  42. <?php }?>
  43. </div>