tripal_feature_unigenes.tpl.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. $node = $variables['node'];
  3. $feature = $node->feature;
  4. $unigenes = $feature->tripal_analysis_unigene->unigenes;
  5. // if this feature has a unigene then we want to show the box
  6. if($unigenes){
  7. //dpm($unigenes);
  8. ?>
  9. <div id="tripal_feature-unigenes-box" class="tripal_feature-info-box tripal-info-box">
  10. <div class="tripal_feature-info-box-title tripal-info-box-title">Unigenes</div>
  11. <div class="tripal_feature-info-box-desc tripal-info-box-desc">This <?php print $feature->type_id->name ?> is part of the following unigenes:</div>
  12. <?php if(count($unigenes) > 0){ ?>
  13. <table id="tripal_feature-unigenes-table" class="tripal_feature-table tripal-table tripal-table-horz">
  14. <tr>
  15. <th>Unigene Name</th>
  16. <th>Analysis Name</th>
  17. <th>Sequence type in Unigene</th>
  18. </tr>
  19. <?php
  20. $i = 0;
  21. foreach ($unigenes as $unigene){
  22. $class = 'tripal-table-odd-row';
  23. if($i % 2 == 0 ){
  24. $class = 'tripal-table-even-row';
  25. }
  26. ?>
  27. <tr class="<?php print $class ?>">
  28. <td><?php
  29. if($unigene->nid){
  30. print "<a href=\"".url("node/$unigene->nid")."\">$unigene->unigene_name</a>";
  31. } else {
  32. print $unigene->unigene_name;
  33. }?>
  34. </td>
  35. <td><?php
  36. if($analysis->nid){
  37. print "<a href=\"".url("node/$analysis->nid")."\">$analysis->name</a>";
  38. } else {
  39. print $analysis->name;
  40. }?>
  41. </td>
  42. <td nowrap><?php
  43. if($unigene->singlet){
  44. print "Singlet";
  45. } else {
  46. print $feature->type_id->name;
  47. }?>
  48. </td>
  49. </tr>
  50. <?php
  51. $i++;
  52. } ?>
  53. </table>
  54. <?php } else { ?>
  55. <div class="tripal-no-results">There are no unigenes for this feature</div>
  56. <?php }?>
  57. </div>
  58. <?php
  59. }
  60. ?>