123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <?php
- $pub = $variables['node']->pub;
- $template_settings = theme_get_setting('tripal');
- $no_sidebar = 0;
- if (is_array($template_settings['tripal_no_sidebar']) and
- $template_settings['tripal_no_sidebar']['pub']) {
- $no_sidebar = 1;
- }
- if ($teaser) {
- print theme('tripal_pub_teaser',$node);
- }
- else { ?>
- <script type="text/javascript">
- $(".title").hide();
-
- (function ($) {
- Drupal.behaviors.pubBehavior = {
- attach: function (context, settings){ <?php
- if ($no_sidebar) { ?>
-
- $(".tripal_toc").hide();
- $(".tripal_details").addClass("tripal_details_full");
- $(".tripal_details_full").removeClass("tripal_details"); <?php
- } else { ?>
-
- $(".tripal-info-box").hide(); <?php
- } ?>
-
-
-
- $(".tripal-info-box-title").each(function(){
- var parent = $(this).parent();
- var id = $(parent).attr('id');
- var title = $(this).text();
- $('#tripal_pub_toc_list').append('<li><a href="#'+id+'" class="tripal_pub_toc_item">'+title+'</a></li>');
- });
-
-
- $(".tripal_pub_toc_item").click(function(){
- $(".tripal-info-box").hide();
- href = $(this).attr('href');
- $(href).fadeIn('slow');
-
-
- $("#tripal_pub_toc").height($(href).parent().height());
- return false;
- });
-
-
- var block = window.location.href.match(/[\?|\&]block=(.+?)\&/)
- if(block == null){
- block = window.location.href.match(/[\?|\&]block=(.+)/)
- }
- if(block != null){
- $("#tripal_pub-"+block[1]+"-box").show();
- } else {
- $("#tripal_pub-base-box").show();
- }
- $("#tripal_pub_toc").height($("#tripal_pub-base-box").parent().height());
- }
- };
- })(jQuery);
- </script>
- <div id="tripal_pub_details" class="tripal_details">
- <!-- Basic Details Theme -->
- <?php print theme('tripal_pub_base', $node); ?>
-
- <!-- Properties Theme -->
- <?php print theme('tripal_pub_properties', $node); ?>
-
- <!-- Authors Theme -->
- <?php print theme('tripal_pub_authors', $node); ?>
-
- <!-- References Theme -->
- <?php print theme('tripal_pub_references', $node); ?>
-
- <!-- Relationships Theme -->
- <?php print theme('tripal_pub_relationships', $node); ?>
- <!-- FeatureMaps Theme -->
- <?php print theme('tripal_pub_featuremaps', $node); ?>
- <!-- Features Theme -->
- <?php print theme('tripal_pub_features', $node); ?>
- <!-- Libraries Theme -->
- <?php print theme('tripal_pub_libraries', $node); ?>
- <!-- Projects Theme -->
- <?php print theme('tripal_pub_projects', $node); ?>
- <!-- Stocks Theme -->
- <?php print theme('tripal_pub_stocks', $node); ?>
- <!-- Resource Blocks CCK elements --><?php
- for($i = 0; $i < count($node->field_resource_titles); $i++){
- if($node->field_resource_titles[$i]['value']){ ?>
- <div id="tripal_pub-resource_<?php print $i?>-box" class="tripal_pub-info-box tripal-info-box">
- <div class="tripal_pub-info-box-title tripal-info-box-title"><?php print $node->field_resource_titles[$i]['value'] ?></div>
- <?php print $node->field_resource_blocks[$i]['value']; ?>
- </div><?php
- }
- }?>
-
- <!-- Let modules add more content -->
- <?php print $content ?>
- </div>
- <!-- Table of contents -->
- <div id="tripal_pub_toc" class="tripal_toc">
- <div id="tripal_pub_toc_title" class="tripal_toc_title">Resources</div>
- <ul id="tripal_pub_toc_list" class="tripal_toc_list">
-
- <!-- Resource Links CCK elements --><?php
- for($i = 0; $i < count($node->field_resource_links); $i++){
- if($node->field_resource_links[$i]['value']){
- $matches = preg_split("/\|/",$node->field_resource_links[$i]['value']);?>
- <li><a href="<?php print $matches[1] ?>" target="_blank"><?php print $matches[0] ?></a></li><?php
- }
- }?>
-
- <?php
- </ul>
- </div>
- <?php } ?>
|