tripal_stock_synonyms.tpl.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. // Copyright 2010 University of Saskatchewan (Lacey-Anne Sanderson)
  3. //
  4. // Purpose: Provides layout and content for Synonyms of the Current Stock.
  5. // Stock synonyms are stored in the stockprop table with a type corresponding
  6. // to the cvterm synonym.
  7. //
  8. // Note: This template controls the layout/content for the default stock node
  9. // template (node-chado_stock.tpl.php) and the Stock Synonyms 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. // - $node->synonyms: an array of stock property objects where each object
  18. // has type=synonyms and the following fields: stockprop_id, type_id,
  19. // type, value, rank
  20. // NOTE: For a full listing of fields available in the node object the
  21. // print_r $node line below or install the Drupal Devel module which
  22. // provides an extra tab at the top of the node page labelled Devel
  23. ?>
  24. <?php
  25. //uncomment this line to see a full listing of the fields avail. to $node
  26. //print '<pre>'.print_r($node,TRUE).'</pre>';
  27. ?>
  28. <div id="tripal_stock-synonyms-box" class="tripal_stock-info-box tripal-info-box">
  29. <div class="tripal_stock-info-box-title tripal-info-box-title">Synonyms</div>
  30. <div class="tripal_stock-info-box-desc tripal-info-box-desc">Synonyms for the stock '<?php print $node->stock_name ?>' include:</div>
  31. <?php if(count($node->synonyms) > 0){
  32. print '<ul>';
  33. // iterate through each synonym
  34. foreach ($node->synonyms as $result){
  35. print '<li>'.$result->value.'</li>';
  36. }
  37. print '</ul>';
  38. } ?>
  39. </div>