tripal_feature_featurelocs_as_child.tpl.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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>Direction</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
  35. if($loc->strand == -1){
  36. print "reverse";
  37. }
  38. elseif($loc->strand == 1){
  39. print "forward";
  40. }
  41. elseif($loc->strand == 0){
  42. print "N/A";
  43. }
  44. else {
  45. print $loc->strand;
  46. }?>
  47. </td>
  48. </tr>
  49. <?php
  50. $i++;
  51. } ?>
  52. </table>
  53. <?php } else { ?>
  54. <div class="tripal-no-results">There are no locations where this feature is found</div>
  55. <?php }?>
  56. </div>