Эх сурвалжийг харах

Merge branch '6.x-0.4-dev' of git.drupal.org:sandbox/spficklin/1337878 into 6.x-0.4-dev

Lacey Sanderson 13 жил өмнө
parent
commit
71107c6f71

+ 0 - 1
base/tripal_db/views/handlers/views_handler_field_dbxref_accession_link.inc

@@ -1 +0,0 @@
-../../../tripal_core/views/handlers/views_handler_field_dbxref_accession_link.inc

+ 1 - 0
base/tripal_db/views/handlers/views_handler_field_dbxref_accession_link.inc

@@ -0,0 +1 @@
+../../../tripal_core/views/handlers/views_handler_field_dbxref_accession_link.inc

+ 0 - 1
base/tripal_feature/views/handlers/views_handler_field_readable_date.inc

@@ -1 +0,0 @@
-../../../tripal_core/views/handlers/views_handler_field_readable_date.inc

+ 1 - 0
base/tripal_feature/views/handlers/views_handler_field_readable_date.inc

@@ -0,0 +1 @@
+../../../tripal_core/views/handlers/views_handler_field_readable_date.inc

+ 0 - 1
base/tripal_library/views/handlers/views_handler_field_readable_date.inc

@@ -1 +0,0 @@
-../../../tripal_core/views/handlers/views_handler_field_readable_date.inc

+ 1 - 0
base/tripal_library/views/handlers/views_handler_field_readable_date.inc

@@ -0,0 +1 @@
+../../../tripal_core/views/handlers/views_handler_field_readable_date.inc

+ 12 - 0
base/tripal_views/tripal_views.views.inc

@@ -625,6 +625,18 @@ function tripal_views_views_plugins() {
  * Implementation of hook_views_pre_view().
  */
 function tripal_views_views_pre_view(&$view,&$display_id,&$args){
+
+   // merge the $_GET and $_POST into the $_GET. This is because
+   // Views and Views Data Export modules only uses the $_GET variable but
+   // file uploads require $_POST. We need to make sure these two modules
+   // have access to everything needed for this view to work properlys
+   $_GET = array_merge($_GET, $_POST);
+
+
+   // we want to add to the bottom of the views the form for downloading 
+   // results in other formats (e.g. Excel, FASTA, CSV, etc.).  The Views Data
+   // Export module provides small images at the bottom, but we want to provide
+   // a more intutitive interface for getting different file formats
    $form = drupal_get_form('tripal_views_data_export_download_form',$view,$display_id,$args);
    $view->attachment_after = $form;
 }

+ 19 - 14
base/tripal_views/views/handlers/views_handler_filter_file_upload.inc

@@ -1,11 +1,10 @@
 <?php
 
-require_once "/var/www/sites/all/modules/views/handlers/views_handler_filter_string.inc";
 /**
- * Purpose: This Handler provides a file upload field.
+ * Purpose: This Handler provides a file upload field by extending the
+ * views_handler_filter object.
  *
- * @ingroup views_filter_handlers
- * @ingroup tripal_core
+ * @ingroup tripal_views_integration
  */
 class views_handler_filter_file_upload extends views_handler_filter {
 
@@ -28,7 +27,7 @@ class views_handler_filter_file_upload extends views_handler_filter {
     
     // we'll provide a single text area for this field.
     // in the exposed_form function we'll add in the file upload button
-    $form['value'] = array(
+    $form['value'][$this->options['field'] . '_textarea']  = array(
        '#type' => 'textarea',
        '#title' => $this->options['expose']['label'],
        '#default_value' => $this->value,
@@ -36,6 +35,13 @@ class views_handler_filter_file_upload extends views_handler_filter {
        '#description' => t('Provide search values for ' . $this->options['expose']['label'] . 
          '. Please place each search item on a separate line or separated by commas.'),
     ); 
+    $form['value'][$this->options['field'] . '_upload'] = array(
+      '#type' => 'file',
+      '#title' => '',
+      '#description' => t('Upload a file to provide search values for ' . $this->options['expose']['label'] . 
+         '. Please place each search item on a separate line. If a file is uploaded but values are present '.
+         'in the text box above, the values in the text box will be ignored.'),
+    );
   }
 
   /** 
@@ -46,10 +52,12 @@ class views_handler_filter_file_upload extends views_handler_filter {
 
   }
   /**
-  * Ensures the select list gets rendered when the filter is exposed
+  * Ensures the upload field gets rendered when the filter is exposed. It also
+  * changes the form type from a GET to a POST so that file uploads will work.
   */
   function exposed_form(&$form, &$form_state) {
 
+    // don't do anything if the form isn't exposed.
     if (empty($this->options['exposed'])) {
       return;
     }
@@ -58,13 +66,10 @@ class views_handler_filter_file_upload extends views_handler_filter {
     $value = $this->options['expose']['identifier'];
     $this->value_form($form, $form_state);
     $form[$value] = $form['value'];
-    unset($form[$value]['#title']);
-    $form[$this->options['field'] . '_upload'] = array(
-      '#type' => 'file',
-      '#title' => '',
-      '#description' => t('Upload a file to provide search values for ' . $this->options['expose']['label'] . 
-         '. Please place each search item on a separate line.'),
-    );
+    unset($form[$value][$this->options['field'] . '_textarea']['#title']);
+
+    // since this is an exposed form we want to enable file uploads by
+    // setting the 'enctype' attribute and the method to POST
     $form['#attributes']['enctype'] = 'multipart/form-data';
     $form['#method'] = 'POST';
     $this->exposed_translate($form[$value], 'value');
@@ -78,7 +83,7 @@ class views_handler_filter_file_upload extends views_handler_filter {
      $holders = array();
      $values = array();
 
-     // get the file upload info if one has been provided
+     // get the file upload content if one has been provided
      $file = file_save_upload($this->field.'_upload',array());
      if($file){
         $fh = fopen($file->filepath,'r');

+ 1 - 1
extensions/tripal_analysis_blast/theme/tripal_feature/tripal_feature_blast_results.tpl.php

@@ -71,7 +71,7 @@ if(count($blast_results_list) > 0){
 		foreach($hits_array AS $hit) { 
          $class = 'tripal-table-odd-row tripal_analysis_blast-table-odd-row';
          if($i % 2 == 0 ){
-            $class = 'tripal-table-even-row tripal_analysis_blast-table-odd-row';
+            $class = 'tripal-table-even-row tripal_analysis_blast-table-even-row';
          }?>
          <tr class="<?php print $class ?> tripal_analysis_blast-result-first-row">
             <td><?php print $i+1 ?>.</td>

+ 1 - 1
extensions/tripal_analysis_blast/tripal_analysis_blast.module

@@ -9,7 +9,7 @@ require_once "includes/parse_blast_XML.inc";
  ******************************************************************************/
 function tripal_analysis_blast_init(){
 	// Add javascript and style sheet
-	drupal_add_css(drupal_get_path('module', 'tripal_analysis_blast') .'/theme/css/tripal_analysis_blast.css');
+	drupal_add_css(drupal_get_path('module', 'tripal_analysis_blast') .'/theme/css/tripal_analysis_blast.css', 'theme');
 	drupal_add_js(drupal_get_path('module', 'tripal_analysis_blast') .'/theme/js/tripal_analysis_blast.js');
 }
 

+ 2 - 2
extensions/tripal_analysis_go/tripal_analysis_go.module

@@ -4,7 +4,7 @@ require_once "includes/gaf_loader.inc";
 
 function tripal_analysis_go_init(){
    // Add style sheet
-   drupal_add_css(drupal_get_path('module', 'tripal_analysis_go').'/theme/css/tripal_analysis_go.css');
+   drupal_add_css(drupal_get_path('module', 'tripal_analysis_go').'/theme/css/tripal_analysis_go.css', 'theme');
 
    drupal_add_js(drupal_get_path('module', 'tripal_analysis_go').'/theme/js/tripal_analysis_go.js');
 }
@@ -390,7 +390,7 @@ function tripal_analysis_go_cv_chart($chart_id){
         )
      ",
      type             => 'p',
-     size             => '550x175',
+     size             => '650x260',
      title            => $title,
   );
   return $options;

+ 1 - 1
extensions/tripal_analysis_interpro/node-chado_analysis_interpro.tpl.php

@@ -83,7 +83,7 @@ if (Drupal.jsEnabled) {
 <div id="tripal_analysis_interpro_details" class="tripal_details">
 
    <!-- Basic Details Theme -->
-   <?php include('tripal_analysis_interpro/tripal_analysis_interpro_base.tpl.php'); ?>
+   <?php include('theme/tripal_analysis_interpro/tripal_analysis_interpro_base.tpl.php'); ?>
 
    <?php print $content ?>
 </div>

+ 2 - 2
extensions/tripal_analysis_interpro/tripal_analysis_interpro.module

@@ -9,7 +9,7 @@ require_once "includes/parseInterpro.inc";
 function tripal_analysis_interpro_init(){
 
 	// Add javascript and style sheet
-   drupal_add_css(drupal_get_path('module', 'tripal_analysis_interpro').'/theme/css/tripal_analysis_interpro.css');
+   drupal_add_css(drupal_get_path('module', 'tripal_analysis_interpro').'/theme/css/tripal_analysis_interpro.css', 'theme');
    drupal_add_js( drupal_get_path('module', 'tripal_analysis_interpro').'/theme/js/tripal_analysis_interpro.js');
 }
 /*******************************************************************************
@@ -428,7 +428,7 @@ function tripal_analysis_interpro_preprocess_tripal_feature_interpro_results(&$v
 
    // we don't know how many analysis are the old style HTML version and how many are the newer
    // XML format.  So, to be backwards compatible we should get both.
-   $feature->tripal_analysis_interpro->results->html = tripal_get_interpro_HTML_results($feature->feature_id);
+  // $feature->tripal_analysis_interpro->results->html = tripal_get_interpro_HTML_results($feature->feature_id);
 	$feature->tripal_analysis_interpro->results->xml = tripal_get_interpro_XML_results($feature->feature_id);
 }
 

+ 2 - 2
extensions/tripal_analysis_kegg/tripal_analysis_kegg.module

@@ -8,9 +8,9 @@
 function tripal_analysis_kegg_init(){
    // add the tripal_analysis_kegg JS and CSS
    drupal_add_js(drupal_get_path('module', 'tripal_analysis_kegg').'/theme/js/tripal_analysis_kegg.js');
-   drupal_add_css(drupal_get_path('module', 'tripal_analysis_kegg').'/theme/css/tripal_analysis_kegg.css');
+   drupal_add_css(drupal_get_path('module', 'tripal_analysis_kegg').'/theme/css/tripal_analysis_kegg.css', 'theme');
    // add the jsTree JS and CSS
-   drupal_add_css(drupal_get_path('theme', 'tripal').'/js/jsTree/source/tree_component.css');
+   drupal_add_css(drupal_get_path('theme', 'tripal').'/js/jsTree/source/tree_component.css', 'theme');
    drupal_add_js (drupal_get_path('theme', 'tripal').'/js/jsTree/source/_lib.js');
    drupal_add_js (drupal_get_path('theme', 'tripal').'/js/jsTree/source/tree_component.js');
 }

+ 1 - 1
extensions/tripal_analysis_unigene/node-chado_analysis_unigene.tpl.php

@@ -86,7 +86,7 @@ if (Drupal.jsEnabled) {
 <div id="tripal_analysis_unigene_details" class="tripal_details">
 
    <!-- Basic Details Theme -->
-   <?php include('tripal_analysis_unigene/tripal_analysis_unigene_base.tpl.php'); ?>
+   <?php include('theme/tripal_analysis_unigene/tripal_analysis_unigene_base.tpl.php'); ?>
 
    <?php print $content ?>
 </div>

+ 1 - 1
extensions/tripal_analysis_unigene/tripal_analysis_unigene.module

@@ -2,7 +2,7 @@
 
 function tripal_analysis_unigene_init(){
    // Add style sheet
-   drupal_add_css(drupal_get_path('module', 'tripal_analysis_unigene').'/theme/css/tripal_analysis_unigene.css');
+   drupal_add_css(drupal_get_path('module', 'tripal_analysis_unigene').'/theme/css/tripal_analysis_unigene.css', 'theme');
 }
 /**
 *