tripal_organism_image.tpl.php 883 B

1234567891011121314151617181920
  1. <?php
  2. $node = $variables['node'];
  3. $organism = $variables['node']->organism;
  4. ?>
  5. <div id="tripal_organism-image-box" class="tripal_organism-info-box tripal-info-box">
  6. <div class="tripal_analysis_interpro-info-box-title tripal-info-box-title"><?php $organism->genus." ".$organism->species?> Image</div>
  7. <div class="tripal_analysis_interpro-info-box-desc tripal-info-box-desc"></div>
  8. <img src="<?php
  9. $image_name = $organism->genus."_".$organism->species.".jpg";
  10. $image_dir = file_directory_path() . "/tripal/tripal_organism/images";
  11. $files = file_scan_directory($image_dir,$image_name);
  12. if(sizeof($files) > 0){
  13. print file_create_url("$image_dir/$image_name");
  14. } else {
  15. $image_file = file_directory_path() . "/tripal/tripal_organism/images/".$node->nid.".jpg";
  16. print file_create_url($image_file);
  17. }
  18. ?>">
  19. </div>