node--chado-generic.tpl.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. if ($teaser) {
  3. print render($content);
  4. }
  5. else {
  6. $node_type = $node->type; ?>
  7. <script type="text/javascript">
  8. // We do not use Drupal Behaviors because we do not want this
  9. // code to be executed on AJAX callbacks. This code only needs to
  10. // be executed once the page is ready.
  11. jQuery(document).ready(function($){
  12. // Hide all but the first data pane
  13. $(".tripal-data-pane").hide().filter(":first-child").show();
  14. // When a title in the table of contents is clicked, then
  15. // show the corresponding item in the details box
  16. $(".tripal_toc_list_item_link").click(function(){
  17. var id = $(this).attr('id') + "-tripal-data-pane";
  18. $(".tripal-data-pane").hide().filter("#"+ id).fadeIn('fast');
  19. return false;
  20. });
  21. // If a ?pane= is specified in the URL then we want to show the
  22. // requested content pane. For previous version of Tripal,
  23. // ?block=, was used. We support it here for backwards
  24. // compatibility
  25. var pane;
  26. pane = window.location.href.match(/[\?|\&]pane=(.+?)[\&|\#]/)
  27. if (pane == null) {
  28. pane = window.location.href.match(/[\?|\&]pane=(.+)/)
  29. }
  30. // if we don't have a pane then try the old style ?block=
  31. if (pane == null) {
  32. pane = window.location.href.match(/[\?|\&]block=(.+?)[\&|\#]/)
  33. if (pane == null) {
  34. pane = window.location.href.match(/[\?|\&]block=(.+)/)
  35. }
  36. }
  37. if(pane != null){
  38. $(".tripal-data-pane").hide().filter("#" + pane[1] + "-tripal-data-pane").show();
  39. }
  40. // Remove the 'active' class from the links section, as it doesn't
  41. // make sense for this layout
  42. $("a.active").removeClass('active');
  43. });
  44. </script>
  45. <div id="tripal_<?php print $node_type?>_contents" class="tripal-contents">
  46. <table id ="tripal-<?php print $node_type?>-contents-table" class="tripal-contents-table">
  47. <tr class="tripal-contents-table-tr">
  48. <td nowrap class="tripal-contents-table-td tripal-contents-table-td-toc" align="left"><?php
  49. // print the table of contents. It's found in the content array
  50. if (array_key_exists('tripal_toc', $content)) {
  51. print $content['tripal_toc']['#markup'];
  52. // we may want to add the links portion of the contents to the sidebar
  53. //print render($content['links']);
  54. // remove the table of contents and links so thye doent show up in the
  55. // data section when the rest of the $content array is rendered
  56. unset($content['tripal_toc']);
  57. unset($content['links']);
  58. } ?>
  59. </td>
  60. <td class="tripal-contents-table-td-data" align="left" width="100%"> <?php
  61. // print the rendered content
  62. print render($content); ?>
  63. </td>
  64. </tr>
  65. </table>
  66. </div> <?php
  67. }