tripal_feature_references.tpl.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /*
  3. References variables
  4. --------------------
  5. $variables['references']: an array of references indexed 0 .. n, where 'n' the
  6. number of references available for this feature.
  7. These variables are avaliable for each reference in the array:
  8. uniquename
  9. feature_id
  10. accession
  11. dbdesc
  12. db_id
  13. db_name
  14. urlprefix
  15. dbxref_id
  16. */
  17. $references = $variables['tripal_feature']['references'];
  18. $feature = $variables['node']->feature;
  19. ?>
  20. <div id="tripal_feature-references-box" class="tripal_feature-info-box tripal-info-box">
  21. <div class="tripal_feature-info-box-title tripal-info-box-title">References</div>
  22. <div class="tripal_feature-info-box-desc tripal-info-box-desc">The feature '<?php print $feature->featurename ?>' is also available at these locations</div>
  23. <?php if(count($references) > 0){ ?>
  24. <table id="tripal_feature-references-table" class="tripal_feature-table tripal-table tripal-table-horz">
  25. <tr>
  26. <th>Dababase</th>
  27. <th>Accession</th>
  28. </tr>
  29. <?php
  30. $i = 0;
  31. foreach ($references as $result){
  32. $class = 'tripal_feature-table-odd-row tripal-table-odd-row';
  33. if($i % 2 == 0 ){
  34. $class = 'tripal_feature-table-odd-row tripal-table-even-row';
  35. }
  36. ?>
  37. <tr class="<?php print $class ?>">
  38. <td><?php print $result->db_name?></td>
  39. <td><?php
  40. if($result->urlprefix){
  41. ?><a href="<?php print $result->urlprefix.$result->accession?>"><?php print $result->accession?></a><?php
  42. } else {
  43. print $result->accession;
  44. }
  45. ?>
  46. </td>
  47. </tr>
  48. <?php
  49. $i++;
  50. } ?>
  51. </table>
  52. <?php } else { ?>
  53. <div class="tripal-no-results">There are no references for this feature</div>
  54. <?php }?>
  55. </div>