node-tripal_gbrowse.tpl.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <?php
  2. // Developed by: Chad N.A Krilow at The University of Saskatchewan
  3. //
  4. // Purpose: This template provides the layout of the Tripal GBrowse Instances node (page)
  5. // using the same templates used for the various Tripal GBrowse blocks. An I-Frame is
  6. // included to show the representation of the GBrowse instance(including tracks). Along with
  7. // the I-Frame, a link to open a external I-Frame in a new window is supplied
  8. //
  9. // To Customize the Stock Node Page:
  10. // - This Template: customize basic layout and which elements are included
  11. // - Using Panels: Override the node page using Panels3 and place the blocks
  12. // of content as you please. This method requires no programming. See
  13. // the Tripal User Guide for more details
  14. //
  15. // Variables Available:
  16. // - $node: a standard object which contains all the fields associated with
  17. // nodes and it also includes Tripal GBrowse specific fields.
  18. //
  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($node,TRUE).'</pre>';
  26. drupal_add_css('./tripal-node-templates.css');
  27. ?>
  28. <?php if ($teaser) {
  29. include('tripal_gbrowse/tripal_gbrowse_teaser.tpl.php');
  30. } else { ?>
  31. <script type="text/javascript">
  32. if (Drupal.jsEnabled) {
  33. $(document).ready(function() {
  34. // hide all tripal info boxes at the start
  35. $(".tripal-info-box").hide();
  36. // iterate through all of the info boxes and add their titles
  37. // to the table of contents
  38. $(".tripal-info-box-title").each(function(){
  39. var parent = $(this).parent();
  40. var id = $(parent).attr('id');
  41. var title = $(this).text();
  42. $('#tripal_gbrowse_toc_list').append('<li><a href="#'+id+'" class="tripal_gbrowse_toc_item">'+title+'</a></li>');
  43. });
  44. // when a title in the table of contents is clicked, then
  45. // show corresponding item in details box
  46. $(".tripal_gbrowse_toc_item").click(function(){
  47. $(".tripal-info-box").hide();
  48. href = $(this).attr('href');
  49. $(href).fadeIn('slow');
  50. // make sure table of contents and the details
  51. // box stay the same height
  52. $("#tripal_gbrowse_toc").height($(href).parent().height());
  53. return false;
  54. });
  55. // base details show up when the page is first shown
  56. // unless the user specified a specific block
  57. var block = window.location.href.match(/\?block=.*/);
  58. if(block != null){
  59. block_title = block.toString().replace(/\?block=/g,'');
  60. $("#tripal_gbrowse-"+block_title+"-box").show();
  61. } else {
  62. $("#tripal_gbrowse-base-box").show();
  63. }
  64. $("#tripal_gbrowse_toc").height($("#tripal_gbrowse-base-box").parent().height());
  65. });
  66. }
  67. </script>
  68. <style type="text/css">
  69. /* these styles are specific for this template and is not included
  70. in the main CSS files for the theme as it is anticipated that the
  71. elements on this page may not be used for other customizations */
  72. #tripal_gbrowse_toc {
  73. float: left;
  74. width: 20%;
  75. background-color: #EEEEEE;
  76. -moz-border-radius: 15px;
  77. border-radius: 15px;
  78. -moz-box-shadow: 3px 3px 4px #888888;
  79. -webkit-box-shadow: 3px 3px 4px #888888;
  80. box-shadow: 3px 3px 4px #888888;
  81. padding: 20px;
  82. min-height: 200px;
  83. border-style:solid;
  84. border-width:1px;
  85. }
  86. #tripal_gbrowse_toc ul {
  87. margin-left: 0px;
  88. margin-top: 5px;
  89. padding-left: 15px;
  90. }
  91. #tripal_gbrowse_toc_title {
  92. font-size: 1.5em;
  93. }
  94. #tripal_gbrowse_toc_desc {
  95. font-style: italic;
  96. }
  97. #tripal_gbrowse_details {
  98. float: left;
  99. width: 70%;
  100. background-color: #FFFFFF;
  101. -moz-border-radius: 15px;
  102. border-radius: 15px;
  103. -moz-box-shadow: 3px 3px 4px #888888;
  104. -webkit-box-shadow: 3px 3px 4px #888888;
  105. box-shadow: 3px 3px 4px #888888;
  106. padding: 20px;
  107. min-height: 200px;
  108. margin-right: 10px;
  109. border-style:solid;
  110. border-width:1px;
  111. }
  112. #tripal_gbrowse-base-box img {
  113. float: left;
  114. margin-bottom: 10px;
  115. }
  116. #tripal_gbrowse-table-base {
  117. float: left;
  118. width: 400px;
  119. margin-left: 10px;
  120. margin-bottom: 10px;
  121. }
  122. #tripal_gbrowse_addtional_content {
  123. clear:both;
  124. width: 100%;
  125. }
  126. </style>
  127. <div id ="tripal_gbrowse_content">
  128. <div id="tripal_gbrowse_details" class="tripal_details"><h2>
  129. <!-- Basic Details Theme -->
  130. <?php include('tripal_gbrowse/tripal_gbrowse_details.tpl.php'); ?>
  131. <!-- GBrowse Details -->
  132. <?php
  133. global $account;
  134. if(user_access('access database-related details',$account)){
  135. include('tripal_gbrowse/tripal_gbrowse_database_details.tpl.php');
  136. }?>
  137. <?php print $content ?>
  138. <!-- GBrowse Loaded Sources -->
  139. <?php
  140. include('tripal_gbrowse/tripal_gbrowse_loaded_sources.tpl.php');
  141. ?>
  142. <?php print $content ?>
  143. </div>
  144. <!-- Table of contents -->
  145. <div id="tripal_gbrowse_toc" class="tripal_toc">
  146. <div id="tripal_gbrowse_toc_title" class="tripal_toc_title">Resources</div>
  147. <span id="tripal_gbrowse_toc_desc" class="tripal_toc_desc"></span>
  148. <ul id="tripal_gbrowse_toc_list" class="tripal_toc_list">
  149. </ul>
  150. </div>
  151. </div>
  152. <!--- I-Frame Code Section --->
  153. <div id="tripal_gbrowse_addtional_content">
  154. <!--- Include for file that makes the I-Frame and external window possible --->
  155. <?php include('tripal_gbrowse/tripal_gbrowse_gbrowse_instance.tpl.php'); ?>
  156. </div>
  157. <?php } ?>