Quellcode durchsuchen

Updates to theming

spficklin vor 14 Jahren
Ursprung
Commit
ac30d020b2

+ 159 - 91
theme_tripal/node-chado_analysis_blast.tpl.php

@@ -1,97 +1,165 @@
 <?php
+// Purpose: This template provides the layout of the organism node (page)
+//   using the same templates used for the various feature content blocks.
 //
-// Copyright 2009 Clemson University
+// To Customize the Featture Node Page:
+//   - This Template: customize basic layout and which elements are included
+//   - Using Panels: Override the node page using Panels3 and place the blocks
+//       of content as you please. This method requires no programming. See
+//       the Tripal User Guide for more details
+//   - Block Templates: customize the content/layout of each block of stock 
+//       content. These templates are found in the tripal_stock subdirectory
 //
+// Variables Available:
+//   - $node: a standard object which contains all the fields associated with
+//       nodes including nid, type, title, taxonomy. It also includes stock
+//       specific fields such as stock_name, uniquename, stock_type, synonyms,
+//       properties, db_references, object_relationships, subject_relationships,
+//       organism, etc.
+//   NOTE: For a full listing of fields available in the node object the
+//       print_r $node line below or install the Drupal Devel module which 
+//       provides an extra tab at the top of the node page labelled Devel
 ?>
 
-   <?php if ($picture) {
-      print $picture;
-   }?>
-    
-   <div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?>">
+<?php
+ //uncomment this line to see a full listing of the fields avail. to $node
+ //print '<pre>'.print_r($variables,TRUE).'</pre>';
+
+$node = $variables['node'];
+$organism = $variables['node']->organism;
+?>
+
+<?php if ($teaser) { 
+  include('tripal_analysis_blast/tripal_analysis_blast_teaser.tpl.php'); 
+} else { ?>
+
+<script type="text/javascript">
+if (Drupal.jsEnabled) {
+   $(document).ready(function() {
+      // hide all tripal info boxes at the start
+      $(".tripal-info-box").hide();
+ 
+      // iterate through all of the info boxes and add their titles
+      // to the table of contents
+      $(".tripal-info-box-title").each(function(){
+        var parent = $(this).parent();
+        var id = $(parent).attr('id');
+        var title = $(this).text();
+        $('#tripal_analysis_blast_toc_list').append('<li><a href="#'+id+'" class="tripal_analysis_blast_toc_item">'+title+'</a></li>');
+      });
+
+      // when a title in the table of contents is clicked, then
+      // show the corresponding item in the details box
+      $(".tripal_analysis_blast_toc_item").click(function(){
+         $(".tripal-info-box").hide();
+         href = $(this).attr('href');
+         $(href).fadeIn('slow');
+         // we want to make sure our table of contents and the details
+         // box stay the same height
+         $("#tripal_analysis_blast_toc").height($(href).parent().height());
+         return false;
+      }); 
+
+      // we want the base details to show up when the page is first shown 
+      // unless we're using the feature browser then we want that page to show
+      if(window.location.href.match(/\?page=\d+/)){
+         $("#tripal_analysis_blast-feature_browser-box").show();
+      } else {
+         $("#tripal_analysis_blast-base-box").show();
+      }
+      $("#tripal_analysis_blast_toc").height($("#tripal_analysis_blast-base-box").parent().height());
+
+      // we want to select the first GO/KEGG report by default
+		$('.form-select').each(function() {
+        var default_option = this.getElementsByTagName('option')[1];
+        if (default_option) {
+           this.selectedIndex =default_option.index ;
+           if (this.onchange.toString().match('tripal_analysis_go_org_charts')) {   
+              tripal_analysis_go_org_charts(default_option.value);
+           } else if (this.onchange.toString().match('tripal_analysis_kegg_org_report')) {            
+              tripal_analysis_kegg_org_report(default_option.value);
+           }
+        }
+		});
+      
+   });
+}
+</script>
+
+<style type="text/css">
+  /* these styles are specific for this template and is not included 
+     in the main CSS files for the theme as it is anticipated that the
+     elements on this page may not be used for other customizations */
+  #tripal_analysis_blast_toc {
+     float: left;
+     width: 20%;
+     background-color: #EEEEEE;
+     -moz-border-radius: 15px;
+     border-radius: 15px;
+     -moz-box-shadow: 3px 3px 4px #000;
+	  -webkit-box-shadow: 3px 3px 4px #000;
+	  box-shadow: 3px 3px 4px #000;
+     padding: 20px;
+     min-height: 500px;
+     border-style:solid;
+     border-width:1px;
+  }
+  #tripal_analysis_blast_toc ul {
+    margin-left: 0px;
+    margin-top: 5px;
+    padding-left: 15px;
+  }
+  #tripal_analysis_blast_toc_title {
+     font-size: 1.5em;
+     line-height: 110%;
+  }
+  #tripal_analysis_blast_toc_desc {
+    /*font-style: italic; */
+  }
+  #tripal_analysis_blast_details {
+     float: left;
+     width: 70%;
+     background-color: #FFFFFF;
+     -moz-border-radius: 15px;
+     border-radius: 15px;
+     -moz-box-shadow: 3px 3px 4px #000;
+	  -webkit-box-shadow: 3px 3px 4px #000;
+	  box-shadow: 3px 3px 4px #000;
+     padding: 20px;
+     min-height: 500px;
+     margin-right: 10px;
+     margin-bottom: 10px;
+     border-style:solid;
+     border-width:1px;
+  }
+  #tripal_analysis_blast-base-box img {
+    float: left;
+    margin-bottom: 10px;
+  }
+  #tripal_analysis_blast-table-base {
+    float: left;
+    width: 100%;
+    margin-left: 0px;
+    margin-bottom: 10px;
+  }
+</style>
+
+
+<div id="tripal_analysis_blast_details">
+
+   <!-- Basic Details Theme -->
+   <?php include('tripal_analysis_blast/tripal_analysis_blast_base.tpl.php'); ?>
+
+   <?php print $content ?>
+</div>
+
+<!-- Table of contents -->
+<div id="tripal_analysis_blast_toc">
+   <div id="tripal_analysis_blast_toc_title">Resources</i></div>
+   <span id="tripal_analysis_blast_toc_desc">Select a link below for more information</span>
+   <ul id="tripal_analysis_blast_toc_list">
+
+   </ul>
+</div>
 
-   <?php if ($page == 0) { ?><h2 class="nodeTitle"><a href="<?php print $node_url?>"><?php print $title?></a>
-	<?php global $base_url;
-	if ($sticky) { print '<img src="'.base_path(). drupal_get_path('theme','sanqreal').'/img/sticky.gif" alt="sticky icon" class="sticky" />'; } ?>
-	</h2><?php }; ?>
-    
-	<?php if (!$teaser): ?>
-	   <?php if ($submitted): ?>     
-      <div class="metanode"><p><?php print t('') .'<span class="author">'. theme('username', $node).'</span>' . t(' - Posted on ') . '<span class="date">'.format_date($node->created, 'custom', "d F Y").'</span>'; ?></p></div>
-      <?php endif; ?>
-      <div>
-      <!-- tripal_analysis_blast theme -->
-         <table>
-            <tr><th>Name</th><td><?php print $node->analysisname;?></td></tr>
-            <tr><th>Program (version)</th><td><?php print $node->program.' ('.$node->programversion.')';?></td></tr>
-            <?php
-               $ver = $node->sourceversion;
-               if ($node->sourceversion) {
-                  $ver = "($node->sourceversion)";
-               }
-               $date = preg_replace("/^(\d+-\d+-\d+) .*/","$1",$node->timeexecuted);
-            ?>
-            <tr><th>Source (version)</th><td><?php print $node->sourcename.' '.$ver;?></td></tr>
-            <tr><th>Source URI</th><td><?php print $node->sourceuri;?></td></tr>
-            <tr><th>Executed</th><td><?php print $date?></td></tr>
-            <tr><th>Description</th><td><?php print $node->description?></td></tr>
-            <tr><th>Blast Settings</th>
-              <td>
-                <b>Database:</b> 
-                  <?php
-                    // We want to show database name instead of database id
-                    $previous_db = db_set_active('chado');
-                    $sql = "SELECT name FROM db WHERE db_id = %d";
-                    $dbname = db_result(db_query($sql, $node->blastdb)); 
-                    print $dbname;
-                    db_set_active($previous_db);
-                  ?><br>
-                <b>File:</b>
-                  <?php print preg_replace("/.*\/(.*)/", "$1", $node->blastfile); ?><br>
-                <b>Parameters:</b>
-                  <?php print $node->blastparameters?><br>
-                  <?php if ($node->blastjob) {
-                           print "A job for parsing blast xml output will be submitted.";
-                        }
-                  ?>
-              </td>
-            </tr>
-            <tr><th>Report</th>
-            <?php
-            	$sql = "SELECT AFP.analysisfeature_id
-	                         FROM {analysisfeature} AF 
-	                         INNER JOIN {analysisfeatureprop} AFP ON AF.analysisfeature_id = AFP.analysisfeature_id
-	                         WHERE analysis_id = %d
-	                         AND AFP.type_id = (SELECT cvterm_id FROM {cvterm} WHERE name = '%s' AND cv_id = (SELECT cv_id FROM {cv} WHERE name = 'tripal'))";
-            	$previous_db = db_set_active('chado');
-            	$exists = db_result(db_query($sql, $node->analysis_id, 'analysis_blast_besthit_query'));
-            	db_set_active($previous_db);
-            	if ($exists) {
-                   $report_url = url("tripal_blast_report/".$node->analysis_id."/1/0/0/20");
-                   print "<td><a href=$report_url>View the best hit homology report</a></td>";
-            	} else {
-            		print "<td>The homology report is not available. Please submit a job to parse the best hit first.</td>";
-            	}
-             ?>
-            
-            </tr>
-         </table>
-      <!-- End of tripal_analysis_blast theme-->
-	  </div> 
-    
-    <?php endif; ?>
-    
-    <div class="content"><?php print $content?></div>
-    
-    <?php if (!$teaser): ?>
-    <?php if ($links) { ?><div class="links"><?php print $links?></div><?php }; ?>
-    <?php endif; ?>
-    
-    <?php if ($teaser): ?>
-    <?php if ($links) { ?><div class="linksteaser"><div class="links"><?php print $links?></div></div><?php }; ?>
-    <?php endif; ?>
-    
-    <?php if (!$teaser): ?>
-    <?php if ($terms) { ?><div class="taxonomy"><span><?php print t('tags') ?></span> <?php print $terms?></div><?php } ?>
-    <?php endif; ?>
-  </div>
+<?php } ?>

+ 62 - 0
theme_tripal/tripal_analysis_blast/tripal_analysis_blast_base.tpl.php

@@ -0,0 +1,62 @@
+<?php
+$node = $variables['node'];
+$analysis = $variables['node']->analysis;
+$blast = $node->analysis->tripal_analysis_blast;
+
+?>
+<div id="tripal_analysis_blast-base-box" class="tripal_analysis_blast-info-box tripal-info-box">
+  <div class="tripal_analysis_blast-info-box-title tripal-info-box-title">Blast Analysis Details</div>
+  <div class="tripal_analysis_blast-info-box-desc tripal-info-box-desc"></div>
+   <table id="tripal_analysis_blast-table-base" class="tripal_analysis_blast-table tripal-table tripal-table-vert">
+      <tr class="tripal_analysis_blast-table-odd-row tripal-table-even-row">
+        <th>Analysis Name</th>
+        <td><?php print $analysis->name; ?></td>
+      </tr>
+      <tr class="tripal_analysis_blast-table-odd-row tripal-table-odd-row">
+        <th nowrap>Software</th>
+        <td><?php 
+          print $analysis->program; 
+          if($analysis->programversion){
+             print " (" . $analysis->programversion . ")"; 
+          }
+          if($analysis->algorithm){
+             print ". " . $analysis->algorithm; 
+          }
+          ?>
+        </td>
+      </tr>
+      <tr class="tripal_analysis_blast-table-odd-row tripal-table-even-row">
+        <th nowrap>Source</th>
+        <td><?php 
+          if($analysis->sourceuri){
+             print "<a href=\"$analysis->sourceuri\">$analysis->sourcename</a>"; 
+          } else {
+             print $analysis->sourcename; 
+          }
+          if($analysis->sourceversion){
+             print " (" . $analysis->sourceversion . ")"; 
+          }
+          ?>
+          </td>
+      </tr>
+      <tr class="tripal_analysis_blast-table-odd-row tripal-table-odd-row">
+        <th nowrap>Date performed</th>
+        <td><?php print preg_replace("/^(\d+-\d+-\d+) .*/","$1",$analysis->timeexecuted); ?></td>
+      </tr>
+      <tr class="tripal_analysis_blast-table-odd-row tripal-table-even-row">
+        <th nowrap>Description</th>
+        <td><?php print $analysis->description; ?></td>
+      </tr> 
+      <tr class="tripal_analysis_blast-table-even-row tripal-table-odd-row">
+        <th nowrap>Database</th>
+        <td><?php print $blast->db->name ?></td>
+      </tr> 
+      <tr class="tripal_analysis_blast-table-even-row tripal-table-even-row">
+        <th nowrap>Blast Arguments</th>
+        <td><?php print $blast->blastparameters ?></td>
+      </tr>  
+      <tr class="tripal_analysis_blast-table-odd-row tripal-table-odd-row">
+        <th>Report</th>
+      </tr>       	                                
+   </table>   
+</div>

+ 0 - 4
theme_tripal/tripal_analysis_unigene/tripal_analysis_unigene_base.tpl.php

@@ -13,10 +13,6 @@ $unigene = $node->analysis->tripal_analysis_unigene;
         <th>Analysis Name</th>
         <td><?php print $analysis->name; ?></td>
       </tr>
-      <tr class="tripal_analysis_unigene-table-odd-row tripal-table-odd-row">
-        <th nowrap>Unigene Name</th>
-        <td><?php print $unigene->unigene_name; ?></td>
-      </tr>
       <tr class="tripal_analysis_unigene-table-odd-row tripal-table-even-row">
         <th nowrap>Software</th>
         <td><?php