tripal_organism_base.tpl.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. $node = $variables['node'];
  3. $organism = $variables['node']->organism;
  4. // the comment field is a database text field so we have to expand it so that
  5. // it is included in the organism object
  6. $organism = tripal_core_expand_chado_vars($organism,'field','organism.comment');
  7. ?>
  8. <div id="tripal_organism-base-box" class="tripal_organism-info-box tripal-info-box">
  9. <div class="tripal_organism-info-box-title tripal-info-box-title">Organism Details</div>
  10. <div class="tripal_organism-info-box-desc tripal-info-box-desc"></div>
  11. <img src="<?php
  12. $image_name = $organism->genus."_".$organism->species.".jpg";
  13. $image_dir = file_directory_path() . "/tripal/tripal_organism/images";
  14. $files = file_scan_directory($image_dir,$image_name);
  15. if(sizeof($files) > 0){
  16. print file_create_url("$image_dir/$image_name");
  17. } else {
  18. $image_file = file_directory_path() . "/tripal/tripal_organism/images/".$node->nid.".jpg";
  19. print file_create_url($image_file);
  20. }
  21. ?>">
  22. <table id="tripal_organism-table-base" class="tripal_organism-table tripal-table tripal-table-vert">
  23. <tr class="tripal_organism-table-odd-row tripal-table-even-row">
  24. <th>Common Name</th>
  25. <td><?php print $organism->common_name; ?></td>
  26. </tr>
  27. <tr class="tripal_organism-table-odd-row tripal-table-odd-row">
  28. <th>Genus</th>
  29. <td><?php print $organism->genus; ?></td>
  30. </tr>
  31. <tr class="tripal_organism-table-odd-row tripal-table-even-row">
  32. <th>Species</th>
  33. <td><?php print $organism->species; ?></td>
  34. </tr>
  35. <tr class="tripal_organism-table-odd-row tripal-table-odd-row">
  36. <th>Abbreviation</th>
  37. <td><?php print $organism->abbreviation; ?></td>
  38. </tr>
  39. </table>
  40. <table id="tripal_organism-table-description" class="tripal_organism-table tripal-table tripal-table-horz">
  41. <tr class="tripal_organism-table-odd-row tripal-table-even-row">
  42. <td><?php print $organism->comment; ?></td>
  43. </tr>
  44. </table>
  45. </div>