tripal_feature_featurelocs_as_parent.tpl.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. $featurelocs_as_parent = $variables['tripal_feature']['featurelocs_as_parent'];
  3. $feature = $variables['node']->feature;
  4. ?>
  5. <div id="tripal_feature-featurelocs_as_parent-box" class="tripal_feature-info-box tripal-info-box">
  6. <div class="tripal_feature-info-box-title tripal-info-box-title">Features located relative to <?php print $feature->featurename;?></div>
  7. <div class="tripal_feature-info-box-desc tripal-info-box-desc">The features shown below are located relative to <?php print $feature->featurename;?></div>
  8. <?php if(count($featurelocs_as_parent) > 0){ ?>
  9. <table id="tripal_feature-featurelocs_as_parent-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_parent 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->fnid){
  26. $locname = "<a href=\"" . url("node/$loc->fnid") . "\">$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>
  34. <?php print $loc->phase ?>
  35. </td>
  36. <td><?php
  37. if($loc->strand == -1){
  38. print "reverse";
  39. }
  40. elseif($loc->strand == 1){
  41. print "forward";
  42. }
  43. elseif($loc->strand == 0){
  44. print "N/A";
  45. }
  46. else {
  47. print $loc->strand;
  48. }?>
  49. </td>
  50. </tr>
  51. <?php
  52. $i++;
  53. } ?>
  54. </table>
  55. <?php } else { ?>
  56. <div class="tripal-no-results">There are no features located relative to <?php print $feature->featurename;?></div>
  57. <?php }?>
  58. </div>