node-chado_analysis_blast.tpl.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. // Purpose: This template provides the layout of the organism node (page)
  3. // using the same templates used for the various feature content blocks.
  4. //
  5. // To Customize the Featture Node Page:
  6. // - This Template: customize basic layout and which elements are included
  7. // - Using Panels: Override the node page using Panels3 and place the blocks
  8. // of content as you please. This method requires no programming. See
  9. // the Tripal User Guide for more details
  10. // - Block Templates: customize the content/layout of each block of stock
  11. // content. These templates are found in the tripal_stock subdirectory
  12. //
  13. // Variables Available:
  14. // - $node: a standard object which contains all the fields associated with
  15. // nodes including nid, type, title, taxonomy. It also includes stock
  16. // specific fields such as stock_name, uniquename, stock_type, synonyms,
  17. // properties, db_references, object_relationships, subject_relationships,
  18. // organism, etc.
  19. // NOTE: For a full listing of fields available in the node object the
  20. // print_r $node line below or install the Drupal Devel module which
  21. // provides an extra tab at the top of the node page labelled Devel
  22. ?>
  23. <?php
  24. //uncomment this line to see a full listing of the fields avail. to $node
  25. //print '<pre>'.print_r($variables,TRUE).'</pre>';
  26. //drupal_add_css('./tripal-node-templates.css');
  27. drupal_add_css(drupal_get_path('theme', 'tripal') . '/tripal-node-templates.css');
  28. //this makes tripal required as theme-------^ !!!
  29. $node = $variables['node'];
  30. $organism = $variables['node']->organism;
  31. ?>
  32. <?php if ($teaser) {
  33. include(drupal_get_path('module' , 'tripal_analysis_blast') . '/theme/tripal_analysis_blast/tripal_analysis_blast_teaser.tpl.php');
  34. } else { ?>
  35. <script type="text/javascript">
  36. if (Drupal.jsEnabled) {
  37. $(document).ready(function() {
  38. // hide all tripal info boxes at the start
  39. $(".tripal-info-box").hide();
  40. // iterate through all of the info boxes and add their titles
  41. // to the table of contents
  42. $(".tripal-info-box-title").each(function(){
  43. var parent = $(this).parent();
  44. var id = $(parent).attr('id');
  45. var title = $(this).text();
  46. $('#tripal_analysis_blast_toc_list').append('<li><a href="#'+id+'" class="tripal_analysis_blast_toc_item">'+title+'</a></li>');
  47. });
  48. // when a title in the table of contents is clicked, then
  49. // show the corresponding item in the details box
  50. $(".tripal_analysis_blast_toc_item").click(function(){
  51. $(".tripal-info-box").hide();
  52. href = $(this).attr('href');
  53. $(href).fadeIn('slow');
  54. // we want to make sure our table of contents and the details
  55. // box stay the same height
  56. $("#tripal_analysis_blast_toc").height($(href).parent().height());
  57. return false;
  58. });
  59. // we want the base details to show up when the page is first shown
  60. // unless the user specified a specific block
  61. var block = window.location.href.match(/[\?|\&]block=(.+?)\&/)
  62. if(block == null){
  63. block = window.location.href.match(/[\?|\&]block=(.+)/)
  64. }
  65. if(block != null){
  66. $("#tripal_analysis_blast-"+block[1]+"-box").show();
  67. } else {
  68. $("#tripal_analysis_blast-base-box").show();
  69. }
  70. $("#tripal_analysis_blast_toc").height($("#tripal_analysis_blast-base-box").parent().height());
  71. });
  72. }
  73. </script>
  74. <div id="tripal_analysis_blast_details" class="tripal_details">
  75. <!-- Basic Details Theme -->
  76. <?php include('templates/tripal_analysis_blast_base.tpl.php');?>
  77. <?php print $content ?>
  78. </div>
  79. <!-- Table of contents -->
  80. <div id="tripal_analysis_blast_toc" class="tripal_toc">
  81. <div id="tripal_analysis_blast_toc_title" class="tripal_toc_title">Resources</i></div>
  82. <span id="tripal_analysis_blast_toc_desc" class="tripal_toc_desc"></span>
  83. <ul id="tripal_analysis_blast_toc_list" class="tripal_toc_list">
  84. </ul>
  85. </div>
  86. <?php } ?>