tripal_library_base.tpl.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. $library = $variables['node']->library;
  3. // expand the library to include the properties.
  4. $library = tripal_core_expand_chado_vars($library,'table','libraryprop');
  5. $library = tripal_core_expand_chado_vars($library,'field','libraryprop.value');
  6. ?>
  7. <div id="tripal_library-base-box" class="tripal_library-info-box tripal-info-box">
  8. <div class="tripal_library-info-box-title tripal-info-box-title">Library Details</div>
  9. <div class="tripal_library-info-box-desc tripal-info-box-desc"></div>
  10. <?php if(strcmp($library->is_obsolete,'t')==0){ ?>
  11. <div class="tripal_library-obsolete">This library is obsolete</div>
  12. <?php }?>
  13. <table id="tripal_library-base-table" class="tripal_library-table tripal-table tripal-table-vert">
  14. <tr class="tripal_library-table-even-row tripal-table-even-row">
  15. <th nowrap>Unique Name</th>
  16. <td><?php print $library->uniquename; ?></td>
  17. </tr>
  18. <tr class="tripal_library-table-odd-row tripal-table-odd-row">
  19. <th>Internal ID</th>
  20. <td><?php print $library->library_id; ?></td>
  21. </tr>
  22. <tr class="tripal_library-table-even-row tripal-table-even-row">
  23. <th>Organism</th>
  24. <td>
  25. <?php if ($library->organism_id->nid) {
  26. print "<a href=\"".url("node/".$library->organism_id->nid)."\">".$library->organism_id->genus ." " . $library->organism_id->species ." (" .$library->organism_id->common_name .")</a>";
  27. } else {
  28. print $library->organism_id->genus ." " . $library->organism_id->species ." (" .$library->organism_id->common_name .")";
  29. } ?>
  30. </td>
  31. </tr>
  32. <tr class="tripal_library-table-odd-row tripal-table-odd-row">
  33. <th>Type</th>
  34. <td><?php
  35. if ($library->type_id->name == 'cdna_library') {
  36. print 'cDNA';
  37. } else if ($library->type_id->name == 'bac_library') {
  38. print 'BAC';
  39. } else {
  40. print $library->type_id->name;
  41. }
  42. ?>
  43. </td>
  44. </tr>
  45. <tr class="tripal_library-table-even-row tripal-table-even-row">
  46. <th>Description</th>
  47. <td><?php
  48. // right now we only have one property for libraries. So we can just
  49. // refernece it directly. If we had more than one property
  50. // we would need to convert this to an if statment and loop
  51. // until we found the right one.
  52. print $library->libraryprop->value?>
  53. </td>
  54. </tr>
  55. </table>
  56. </div>