|
@@ -1,166 +0,0 @@
|
|
|
-<?php
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-dpm($variables);
|
|
|
-
|
|
|
-$organism = $variables['node']->organism;
|
|
|
-
|
|
|
-
|
|
|
-$template_settings = theme_get_setting('tripal');
|
|
|
-
|
|
|
-
|
|
|
-$no_sidebar = 0;
|
|
|
-if (is_array($template_settings['tripal_no_sidebar']) and
|
|
|
- $template_settings['tripal_no_sidebar']['organism']) {
|
|
|
- $no_sidebar = 1;
|
|
|
-}
|
|
|
-
|
|
|
-if ($teaser) {
|
|
|
- print theme('tripal_organism_teaser', $variables);
|
|
|
-}
|
|
|
-else { ?>
|
|
|
-
|
|
|
-<script type="text/javascript">
|
|
|
-(function ($) {
|
|
|
- Drupal.behaviors.organismBehavior = {
|
|
|
- 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();
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- total_width = $(".tripal_contents").width();
|
|
|
- details_width = (total_width * 0.70) - 52;
|
|
|
- toc_width = (total_width * 0.30) - 42;
|
|
|
-
|
|
|
- if (toc_width > 200) {
|
|
|
- details_width += toc_width - 200;
|
|
|
- toc_width = 200;
|
|
|
- }
|
|
|
- $('#tripal_organism_toc').width(toc_width);
|
|
|
- $('#tripal_organism_details').width(details_width); <?php
|
|
|
- } ?>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $(".tripal-info-box-title").each(function(){
|
|
|
- var parent = $(this).parent();
|
|
|
- var id = $(parent).attr('id');
|
|
|
- var title = $(this).text();
|
|
|
- $('#tripal_organism_toc_list').append('<li><a href="#'+id+'" class="tripal_organism_toc_item">'+title+'</a></li>');
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $(".tripal_organism_toc_item").click(function(){
|
|
|
- $(".tripal-info-box").hide();
|
|
|
- href = $(this).attr('href');
|
|
|
- if(href.match(/^
|
|
|
-
|
|
|
- }
|
|
|
- else{
|
|
|
- tmp = href.replace(/^.*?
|
|
|
- href = tmp;
|
|
|
-
|
|
|
- }
|
|
|
- $(href).fadeIn('slow');
|
|
|
-
|
|
|
-
|
|
|
- $("#tripal_organism_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_organism-"+block[1]+"-box").show();
|
|
|
- }
|
|
|
- else if(window.location.href.match(/\?page=\d+/)){
|
|
|
- $("#tripal_organism-feature_browser-box").show();
|
|
|
- }
|
|
|
- else {
|
|
|
- $("#tripal_organism-base-box").show();
|
|
|
- }
|
|
|
-
|
|
|
- $("#tripal_organism_toc").height($("#tripal_organism-base-box").parent().height());
|
|
|
- }
|
|
|
- };
|
|
|
-})(jQuery);
|
|
|
-</script>
|
|
|
-
|
|
|
-<div id="tripal_organism_content" class="tripal_contents">
|
|
|
- <div id="tripal_organism_details" class="tripal_details">
|
|
|
-
|
|
|
- <!-- Resource Blocks CCK elements --> <?php
|
|
|
- if (property_exists($node, 'field_resource_titles')) {
|
|
|
- for ($i = 0; $i < count($node->field_resource_titles); $i++){
|
|
|
- if ($node->field_resource_titles[$i]['value']){ ?>
|
|
|
- <div id="tripal_organism-resource_<?php print $i?>-box" class="tripal_organism-info-box tripal-info-box">
|
|
|
- <div class="tripal_organism-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
|
|
|
- foreach ($content as $key => $values) {
|
|
|
- if (array_key_exists('#value', $values)) {
|
|
|
- print $content[$key]['#value'];
|
|
|
- }
|
|
|
- }
|
|
|
- ?>
|
|
|
-
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- Table of contents -->
|
|
|
- <div id="tripal_organism_toc" class="tripal_toc">
|
|
|
- <div id="tripal_organism_toc_title" class="tripal_toc_title">Resources</i></div>
|
|
|
- <span id="tripal_organism_toc_desc" class="tripal_toc_desc"></span>
|
|
|
- <ul id="tripal_organism_toc_list" class="tripal_toc_list">
|
|
|
-
|
|
|
- <!-- Resource Links CCK elements --><?php
|
|
|
- if(property_exists($node, 'field_resource_links')) {
|
|
|
- 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
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- ?>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
-</div>
|
|
|
-<?php
|
|
|
-} ?>
|
|
|
-
|