node-chado_analysis.tpl.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. $node = $variables['node'];
  27. $organism = $variables['node']->organism;
  28. ?>
  29. <?php if ($teaser) {
  30. include('tripal_analysis/tripal_analysis_teaser.tpl.php');
  31. } else { ?>
  32. <script type="text/javascript">
  33. if (Drupal.jsEnabled) {
  34. $(document).ready(function() {
  35. // hide all tripal info boxes at the start
  36. $(".tripal-info-box").hide();
  37. // iterate through all of the info boxes and add their titles
  38. // to the table of contents
  39. $(".tripal-info-box-title").each(function(){
  40. var parent = $(this).parent();
  41. var id = $(parent).attr('id');
  42. var title = $(this).text();
  43. $('#tripal_analysis_toc_list').append('<li><a href="#'+id+'" class="tripal_analysis_toc_item">'+title+'</a></li>');
  44. });
  45. // when a title in the table of contents is clicked, then
  46. // show the corresponding item in the details box
  47. $(".tripal_analysis_toc_item").click(function(){
  48. $(".tripal-info-box").hide();
  49. href = $(this).attr('href');
  50. $(href).fadeIn('slow');
  51. // we want to make sure our table of contents and the details
  52. // box stay the same height
  53. $("#tripal_analysis_toc").height($(href).parent().height());
  54. return false;
  55. });
  56. // we want the base details to show up when the page is first shown
  57. // unless the user specified a specific block
  58. var block = window.location.href.match(/\?block=.*/);
  59. if(block != null){
  60. block_title = block.toString().replace(/\?block=/g,'');
  61. $("#tripal_analysis-"+block_title+"-box").show();
  62. } else {
  63. $("#tripal_analysis-base-box").show();
  64. }
  65. // make the height of the table of contents match the height of the details box
  66. $("#tripal_analysis_toc").height($("#tripal_analysis-base-box").parent().height());
  67. });
  68. }
  69. </script>
  70. <style type="text/css">
  71. /* these styles are specific for this template and is not included
  72. in the main CSS files for the theme as it is anticipated that the
  73. elements on this page may not be used for other customizations */
  74. #tripal_analysis_toc {
  75. float: left;
  76. width: 20%;
  77. background-color: #EEEEEE;
  78. -moz-border-radius: 15px;
  79. border-radius: 15px;
  80. -moz-box-shadow: 3px 3px 4px #888888;
  81. -webkit-box-shadow: 3px 3px 4px #888888;
  82. box-shadow: 3px 3px 4px #888888;
  83. padding: 20px;
  84. min-height: 500px;
  85. border-style:solid;
  86. border-width:1px;
  87. }
  88. #tripal_analysis_toc ul {
  89. margin-left: 0px;
  90. margin-top: 5px;
  91. padding-left: 15px;
  92. }
  93. #tripal_analysis_toc_title {
  94. font-size: 1.5em;
  95. line-height: 110%;
  96. }
  97. #tripal_analysis_toc_desc {
  98. /*font-style: italic; */
  99. }
  100. #tripal_analysis_details {
  101. float: left;
  102. width: 70%;
  103. background-color: #FFFFFF;
  104. -moz-border-radius: 15px;
  105. border-radius: 15px;
  106. -moz-box-shadow: 3px 3px 4px #888888;
  107. -webkit-box-shadow: 3px 3px 4px #888888;
  108. box-shadow: 3px 3px 4px #888888;
  109. padding: 20px;
  110. min-height: 500px;
  111. margin-right: 10px;
  112. margin-bottom: 10px;
  113. border-style:solid;
  114. border-width:1px;
  115. }
  116. #tripal_analysis-base-box img {
  117. float: left;
  118. margin-bottom: 10px;
  119. }
  120. #tripal_analysis-table-base {
  121. float: left;
  122. width: 100%;
  123. margin-left: 0px;
  124. margin-bottom: 10px;
  125. }
  126. </style>
  127. <div id="tripal_analysis_details">
  128. <!-- Basic Details Theme -->
  129. <?php include('tripal_analysis/tripal_analysis_base.tpl.php'); ?>
  130. <?php print $content ?>
  131. </div>
  132. <!-- Table of contents -->
  133. <div id="tripal_analysis_toc">
  134. <div id="tripal_analysis_toc_title">Resources</i></div>
  135. <span id="tripal_analysis_toc_desc">Select a link below for more information</span>
  136. <ul id="tripal_analysis_toc_list">
  137. </ul>
  138. </div>
  139. <?php } ?>