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