Ver Fonte

Tripal GBrowse: added support for blocks, loading features by analysis, new themeing and nodes

laceysanderson há 13 anos atrás
pai
commit
8a25f7fc54

+ 177 - 0
theme_tripal/node-tripal_gbrowse.tpl.php

@@ -0,0 +1,177 @@
+<?php
+// Developed by: Chad N.A Krilow at The University of Saskatchewan
+//
+// Purpose: This template provides the layout of the Tripal GBrowse Instances node (page)
+//   using the same templates used for the various Tripal GBrowse blocks. An I-Frame is 
+//	 included to show the representation of the GBrowse instance(including tracks). Along with 
+//	 the I-Frame, a link to open a external I-Frame in a new window is supplied
+//
+// To Customize the Stock 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
+//
+// Variables Available:
+//   - $node: a standard object which contains all the fields associated with
+//       nodes and it also includes Tripal GBrowse specific fields.
+//
+//   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
+ //uncomment this line to see a full listing of the fields avail. to $node
+ //print '<pre>'.print_r($node,TRUE).'</pre>';
+ drupal_add_css('./tripal-node-templates.css');
+?>
+
+<?php if ($teaser) { 
+  
+  include('tripal_gbrowse/tripal_gbrowse_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_gbrowse_toc_list').append('<li><a href="#'+id+'" class="tripal_gbrowse_toc_item">'+title+'</a></li>');
+      });
+
+      // when a title in the table of contents is clicked, then
+      // show corresponding item in details box
+      $(".tripal_gbrowse_toc_item").click(function(){
+         $(".tripal-info-box").hide();
+         href = $(this).attr('href');
+         $(href).fadeIn('slow');
+         // make sure table of contents and the details
+         // box stay the same height
+         $("#tripal_gbrowse_toc").height($(href).parent().height());
+         return false;
+      }); 
+
+      // base details show up when the page is first shown 
+      // unless the user specified a specific block
+      var block = window.location.href.match(/\?block=.*/);
+      if(block != null){
+         block_title = block.toString().replace(/\?block=/g,'');
+         $("#tripal_gbrowse-"+block_title+"-box").show();
+      } else {
+         $("#tripal_gbrowse-base-box").show();
+      }
+
+      $("#tripal_gbrowse_toc").height($("#tripal_gbrowse-base-box").parent().height());
+   });
+}
+</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_gbrowse_toc {
+     float: left;
+     width: 20%;
+     background-color: #EEEEEE;
+     -moz-border-radius: 15px;
+     border-radius: 15px;
+     -moz-box-shadow: 3px 3px 4px #888888;
+	  -webkit-box-shadow: 3px 3px 4px #888888;
+	  box-shadow: 3px 3px 4px #888888;
+     padding: 20px;
+     min-height: 200px;
+     border-style:solid;
+     border-width:1px;
+  }
+  #tripal_gbrowse_toc ul {
+    margin-left: 0px;
+    margin-top: 5px;
+    padding-left: 15px;
+  }
+  #tripal_gbrowse_toc_title {
+     font-size: 1.5em;
+  }
+  #tripal_gbrowse_toc_desc {
+    font-style: italic;
+  }
+  #tripal_gbrowse_details {
+     float: left;
+     width: 70%;
+     background-color: #FFFFFF;
+     -moz-border-radius: 15px;
+     border-radius: 15px;
+     -moz-box-shadow: 3px 3px 4px #888888;
+	  -webkit-box-shadow: 3px 3px 4px #888888;
+	  box-shadow: 3px 3px 4px #888888;
+     padding: 20px;
+     min-height: 200px;
+     margin-right: 10px;
+     border-style:solid;
+     border-width:1px;
+  }
+  #tripal_gbrowse-base-box img {
+    float: left;
+    margin-bottom: 10px;
+  }
+  #tripal_gbrowse-table-base {
+    float: left;
+    width: 400px;
+    margin-left: 10px;
+    margin-bottom: 10px;
+  }
+  #tripal_gbrowse_addtional_content {
+		clear:both;
+  	width: 100%;
+  }
+</style>
+
+<div id ="tripal_gbrowse_content">
+<div id="tripal_gbrowse_details" class="tripal_details"><h2>
+
+   <!-- Basic Details Theme -->
+   <?php include('tripal_gbrowse/tripal_gbrowse_details.tpl.php'); ?>
+
+   <!-- GBrowse Details -->
+   <?php 
+   global $account;
+   if(user_access('access database-related details',$account)){
+     include('tripal_gbrowse/tripal_gbrowse_database_details.tpl.php'); 
+	 }?>
+   <?php print $content ?>
+   
+    <!-- GBrowse Loaded Sources -->
+   <?php 
+     include('tripal_gbrowse/tripal_gbrowse_loaded_sources.tpl.php');
+     ?>
+   <?php print $content ?>
+ 
+</div>
+
+<!-- Table of contents -->
+<div id="tripal_gbrowse_toc" class="tripal_toc">
+   <div id="tripal_gbrowse_toc_title" class="tripal_toc_title">Resources</div>
+   <span id="tripal_gbrowse_toc_desc" class="tripal_toc_desc"></span>
+   <ul id="tripal_gbrowse_toc_list" class="tripal_toc_list">
+
+   </ul>
+</div>
+</div>
+
+<!--- I-Frame Code Section --->
+<div id="tripal_gbrowse_addtional_content">
+
+	<!--- Include for file that makes the I-Frame and external window possible --->
+ <?php include('tripal_gbrowse/tripal_gbrowse_gbrowse_instance.tpl.php'); ?>
+
+</div>
+<?php } ?>

+ 48 - 0
theme_tripal/tripal_gbrowse/tripal_gbrowse_database_details.tpl.php

@@ -0,0 +1,48 @@
+<?php
+// Developed by: Chad N.A Krilow at The University of Saskatchewan
+//
+// Purpose: Provide layout and content for the GBrowse database details. This
+//   includes database related fields in the tripal_gbrowse_instances table.
+//
+// Note: This template controls the layout/content for the default tripal_gbrowse node
+//   template (node-tripal_grbowse.tpl.php) and the Database Details Block
+//
+// Variables Available:
+//   - $node: a standard object which contains includes GBrowse Databse specific fields such as  
+//			 database_name, database_user, user_password, etc.
+?>
+
+<?php
+ //uncomment this line to see a full listing of the fields avail. to $node
+ //print '<pre>'.print_r($node,TRUE).'</pre>';
+?>  
+
+<?php
+
+$gbrowse = $node->gbrowse;
+
+?>
+<div id="tripal_gbrowse-database-box" class="tripal_gbrowse-info-box tripal-info-box">
+  <div class="tripal_gbrowse-info-box-title tripal-info-box-title"> Data Base Details</div>
+  <div class="tripal_gbrowse-info-box-desc tripal-info-box-desc"></div>
+
+   <?php //if the gbrowse is deleted/removed issue a warning
+   if(strcmp($gbrowse->is_obsolete,'t')==0){ 
+   ?>
+      <div class="tripal_gbrowse-obsolete">This GBrowse Instance is obsolete or has been deleted/removed</div>
+   <?php }?>
+   <table id="tripal_gbrowse-base-table" class="tripal_gbrowse-table tripal-table tripal-table-vert">
+      <tr class="tripal_gbrowse-table-even-row tripal-table-even-row">
+        <th>Data Base Name</th>
+        <td><?php print $node->gbrowse->database_name; ?></td>
+      </tr>
+      <tr class="tripal_gbrowse-table-odd-row tripal-table-odd-row">
+        <th nowrap>Database User Name</th>
+        <td><?php print $node->gbrowse->database_user; ?></td>
+      </tr>
+      <tr class="tripal_gbrowse-table-even-row tripal-table-even-row">
+        <th>User Password</th>
+        <td><?php print $node->gbrowse->user_password; ?></td>
+      </tr>     	                                
+   </table>
+</div>

+ 45 - 0
theme_tripal/tripal_gbrowse/tripal_gbrowse_details.tpl.php

@@ -0,0 +1,45 @@
+<?php
+// Developed by: Chad N.A Krilow at The University of Saskatchewan 
+//
+// Purpose: Provide layout and content for the GBrowse database details. This
+//   includes databse user specific fields in the tripal_gbrowse_instances table.
+//
+// Note: This template controls the layout/content for the default tripal_gbrowse node
+//   template (node-tripal_grbowse.tpl.php) and the Database Details Block
+//
+// Variables Available:
+//   - $node: a standard object which contains all the fields associated with
+//       nodes. It also includes GBrowse specific fields such as gbrowse_name, 
+//			 database_link, config_file.
+?>
+
+<?php
+ //uncomment this line to see a full listing of the fields avail. to $node
+ //print '<pre>'.print_r($node,TRUE).'</pre>';
+?> 
+
+
+<?php $gbrowse = $node->gbrowse; ?>
+
+<div id="tripal_gbrowse-base-box" class="tripal_gbrowse-info-box tripal-info-box">
+  <div class="tripal_gbrowse-info-box-title tripal-info-box-title"> GBrowse Details</div>
+  <div class="tripal_gbrowse-info-box-desc tripal-info-box-desc"></div>
+
+   <?php if(strcmp($gbrowse->is_obsolete,'t')==0){ ?>
+      <div class="tripal_gbrowse-obsolete">This GBrowse Instance is obsolete or has been deleted/removed</div>
+   <?php }?>
+   <table id="tripal_gbrowse-base-table" class="tripal_gbrowse-table tripal-table tripal-table-vert">
+      <tr class="tripal_gbrowse-table-even-row tripal-table-even-row">
+        <th>GBrowse Instance</th>
+        <td><?php print $node->gbrowse->gbrowse_name; ?></td>
+      </tr>
+      <tr class="tripal_gbrowse-table-odd-row tripal-table-odd-row">
+        <th nowrap>GBrowse Instance Link</th>
+        <td><?php print $node->gbrowse->gbrowse_link; ?></td>
+      </tr>
+      <tr class="tripal_gbrowse-table-even-row tripal-table-even-row">
+        <th>Configuration File</th>
+        <td><?php print $node->gbrowse->config_file; ?></td>
+      </tr>     	                                
+   </table>
+</div>

+ 28 - 0
theme_tripal/tripal_gbrowse/tripal_gbrowse_gbrowse_instance.tpl.php

@@ -0,0 +1,28 @@
+<?php
+// Developed by: Chad N.A Krilow at The University of Saskatchewan
+//
+// Purpose: Provide a in window I-Frame that displays the GBrowse instance. As well,
+// a link to open the GBrowse instance in a external window is provided. If the window can not be
+// opened a warning is issued
+//   
+// Variables Available:
+//   - $node: a standard object which contains all the fields associated with
+//       nodes. Here it is utilized for accessing the link to a specific GBrowse instance.
+//
+//   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
+ //uncomment this line to see a full listing of the fields avail. to $node
+ //print '<pre>'.print_r($node,TRUE).'</pre>';
+?>
+
+<br />
+<h3><a href="<?php print $node->gbrowse->gbrowse_link; ?>" target="_blank">Open GBrowse Instance in new Window</a></h3>
+<br />
+
+<iframe src="<?php print $node->gbrowse->gbrowse_link; ?>" width="100%" height="800">
+  <p>Your browser does not support iframes.</p>
+</iframe>

+ 42 - 0
theme_tripal/tripal_gbrowse/tripal_gbrowse_loaded_sources.tpl.php

@@ -0,0 +1,42 @@
+<?php
+// Developed by: Chad N.A Krilow at The University of Saskatchewan
+//
+// Variables Available:
+//   - $node: a standard object which contains includes GBrowse Databse specific fields such as  
+//			 database_name, database_user, user_password, etc.
+?>
+
+<?php
+ //uncomment this line to see a full listing of the fields avail. to $node
+ //print '<pre>'.print_r($node,TRUE).'</pre>';
+?>  
+
+<?php
+
+$gbrowse = $node->gbrowse;
+$node->sources = tripal_gbrowse_getloaded_sources($node->gbrowse);
+
+?>
+<div id="tripal_gbrowse-source-box" class="tripal_gbrowse-info-box tripal-info-box">
+  <div class="tripal_gbrowse-info-box-title tripal-info-box-title"> Loaded Sources</div>
+  <div class="tripal_gbrowse-info-box-desc tripal-info-box-desc">A source can be either a library or analysis or any other grouping of features.</div>
+
+   <?php //if the gbrowse is deleted/removed issue a warning
+   if(strcmp($gbrowse->is_obsolete,'t')==0){ 
+   ?>
+      <div class="tripal_gbrowse-obsolete">This GBrowse Library is obsolete or has been deleted/removed</div>
+   <?php }?>
+   <table id="tripal_gbrowse-base-table" class="tripal_gbrowse-table tripal-table tripal-table-vert">
+   <tr><th>Name</th></tr>
+   
+   
+   <?php 
+   if(!empty($node->sources)){
+   	foreach($node->sources as $key => $source){
+   ?>
+      <tr class="tripal_gbrowse-table-even-row tripal-table-even-row">
+        <td><?php print $source; ?></td>
+      </tr>
+		<?php }} //end of foreach library & end of if statement ?>  	                                
+   </table>
+</div>

+ 34 - 0
theme_tripal/tripal_gbrowse/tripal_gbrowse_teaser.tpl.php

@@ -0,0 +1,34 @@
+<?php
+// Developed by: Chad N.A Krilow at The University of Saskatchewan
+//
+// Purpose: Provide layout and content for the Tripal Gbrowse details.Represents
+// what the user will see if the there is no information in the node
+//
+// Variables Available:
+//   - $node: a standard object which contains all the fields associated with
+//       nodes including nid, gbrowse_id.
+//   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
+ //uncomment this line to see a full listing of the fields avail. to $node
+ //print '<pre>'.print_r($node,TRUE).'</pre>';
+?>
+
+<div id="tripal_gbrowse-base-box" class="tripal_gbrowse-info-box tripal-info-box">
+  <div class="tripal_gbrowse-info-box-title tripal-info-box-title">
+  
+  	<!-- Title -->  	
+    <?php print l($node->gbrowse->gbrowse_name, 'node/'.$node->nid); ?>
+
+		
+  </div>
+  <div class="tripal_gbrowse-info-box-desc tripal-info-box-desc"></div>
+
+<p>This is a representation of a created GBrowse instance.<p>
+<?php print l('See More Details', 'node/'.$node->nid); ?>
+
+ 
+</div>

Diff do ficheiro suprimidas por serem muito extensas
+ 771 - 257
tripal_gbrowse/tripal_gbrowse.module


Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff