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. dpm($featurelocs_as_child);
  5. ?>
  6. <div id="tripal_feature-featurelocs_as_child-box" class="tripal_feature-info-box tripal-info-box">
  7. <div class="tripal_feature-info-box-title tripal-info-box-title">Locations where <?php print $feature->featurename;?> is found</div>
  8. <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>
  9. <?php if(count($featurelocs_as_child) > 0){ ?>
  10. <table id="tripal_feature-featurelocs_as_child-table" class="tripal_feature-table tripal-table tripal-table-horz">
  11. <tr>
  12. <th>Name</th>
  13. <th>Type</th>
  14. <th>Position</th>
  15. <th>Phase</th>
  16. <th>Direction</th>
  17. </tr>
  18. <?php
  19. $i = 0;
  20. foreach ($featurelocs_as_child as $index => $loc){
  21. $class = 'tripal_feature-table-odd-row tripal-table-odd-row';
  22. if($i % 2 == 0 ){
  23. $class = 'tripal_feature-table-odd-row tripal-table-even-row';
  24. }
  25. $src_name = $loc->src_name;
  26. if($loc->snid){
  27. $src_name = "<a href=\"" . url("node/$loc->snid") . "\">".$loc->src_name .":".$loc->fmin . ".." . $loc->fmax ."</a> ";
  28. }
  29. ?>
  30. <tr class="<?php print $class ?>">
  31. <td><?php print $loc->name ?></td>
  32. <td><?php print $loc->cvname ?></td>
  33. <td><?php print $src_name</td>
  34. <td><?php print $loc->phase ?></td>
  35. <td><?php
  36. if($loc->strand == -1){
  37. print "reverse";
  38. }
  39. elseif($loc->strand == 1){
  40. print "forward";
  41. }
  42. elseif($loc->strand == 0){
  43. print "N/A";
  44. }
  45. else {
  46. print $loc->strand;
  47. }?>
  48. </td>
  49. </tr>
  50. <?php
  51. $i++;
  52. } ?>
  53. </table>
  54. <?php } else { ?>
  55. <div class="tripal-no-results">There are no locations where this feature is found</div>
  56. <?php }?>
  57. </div>