tripal_stock_base.tpl.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. // Copyright 2010 University of Saskatchewan (Lacey-Anne Sanderson)
  3. //
  4. // Purpose: Provide layout and content for the basic stock details. This
  5. // includes all fields in the chado stock table supplemented with extra
  6. // details for each foreign key to provide human-readable output
  7. //
  8. // Note: This template controls the layout/content for the default stock node
  9. // template (node-chado_stock.tpl.php) and the Stock Details Block
  10. //
  11. // Variables Available:
  12. // - $node: a standard object which contains all the fields associated with
  13. // nodes including nid, type, title, taxonomy. It also includes stock
  14. // specific fields such as stock_name, uniquename, stock_type, synonyms,
  15. // properties, db_references, object_relationships, subject_relationships,
  16. // organism, etc.
  17. // NOTE: For a full listing of fields available in the node object the
  18. // print_r $node line below or install the Drupal Devel module which
  19. // provides an extra tab at the top of the node page labelled Devel
  20. ?>
  21. <?php
  22. //uncomment this line to see a full listing of the fields avail. to $node
  23. //print '<pre>'.print_r($node,TRUE).'</pre>';
  24. ?>
  25. <?php $organism = $node->organism; ?>
  26. <div id="tripal_stock-base-box" class="tripal_stock-info-box tripal-info-box">
  27. <div class="tripal_stock-info-box-title tripal-info-box-title">Stock Details</div>
  28. <div class="tripal_stock-info-box-desc tripal-info-box-desc"></div>
  29. <?php if($node->is_obsolete == 't'){ ?>
  30. <div class="tripal_stock-obsolete">This stock is obsolete and no longer used in analysis, but is here for reference</div>
  31. <?php }?>
  32. <table class="tripal_stock-table tripal-table tripal-table-vert">
  33. <tr class="tripal_stock-table-odd-row tripal-table-even-row">
  34. <th>Name</th>
  35. <td><?php print $node->stock_name; ?></td>
  36. </tr>
  37. <tr class="tripal_stock-table-odd-row tripal-table-odd-row">
  38. <th nowrap>Unique Name</th>
  39. <td><?php print $node->uniquename; ?></td>
  40. </tr>
  41. <tr class="tripal_stock-table-odd-row tripal-table-even-row">
  42. <th>Internal ID</th>
  43. <?php if (!empty($node->main_db_reference->dbxref_id)) { ?>
  44. <?php
  45. if ($node->main_db_reference->db_urlprefix) {
  46. $accession = l($node->main_db_reference->accession, $node->main_db_reference->db_urlprefix.$node->main_db_reference->accession);
  47. } else {
  48. $accession = $node->main_db_reference->accession;
  49. }
  50. if ($node->main_db_reference->db_url) {
  51. $accession .= ' ('.l($node->main_db_reference->db_name, $node->main_db_reference->db_url).')';
  52. } else {
  53. $accession .= ' ('.$node->main_db_reference->db_name.')';
  54. }
  55. ?>
  56. <td><?php print $accession; ?></td>
  57. <?php } else { ?>
  58. <td></td>
  59. <?php } ?>
  60. </tr>
  61. <tr class="tripal_stock-table-odd-row tripal-table-odd-row">
  62. <th>Type</th>
  63. <td><?php print $node->stock_type; ?></td>
  64. </tr>
  65. <tr class="tripal_stock-table-odd-row tripal-table-even-row">
  66. <th>Organism</th>
  67. <td>
  68. <?php if ($organism->nid) { ?>
  69. <a href="<?php print url("node/$organism->nid") ?>"><?php print $organism->genus ." " . $organism->species ." (" .$organism->common_name ." )"?></a>
  70. <?php
  71. } else {
  72. print $organism->genus ." " . $organism->species ." (" .$organism->common_name ." )";
  73. } ?>
  74. </td>
  75. </tr>
  76. </table>
  77. </div>