Bläddra i källkod

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

spficklin 12 år sedan
förälder
incheckning
9f12d64de0

+ 2 - 2
tripal_analysis/tripal_analysis.views.inc

@@ -441,8 +441,8 @@ function tripal_analysis_views_default_views() {
     'type' => 'normal',
     'title' => 'Analyses',
     'description' => '',
-    'weight' => '0',
-    'name' => 'primary-links',
+    'weight' => '10',
+    'name' => 'navigation',
   ));
   $handler->override_option('tab_options', array(
     'type' => 'none',

+ 2 - 2
tripal_contact/tripal_contact.views.inc

@@ -334,8 +334,8 @@ function tripal_contact_views_default_views() {
     'type' => 'normal',
     'title' => 'Contacts',
     'description' => '',
-    'weight' => '0',
-    'name' => 'primary-links',
+    'weight' => '10',
+    'name' => 'navigation',
   ));
   $handler->override_option('tab_options', array(
     'type' => 'none',

+ 2 - 2
tripal_cv/tripal_cv.views.inc

@@ -441,7 +441,7 @@ function tripal_cv_views_default_views() {
     'type' => 'normal',
     'title' => 'Term Listing',
     'description' => 'A listing of a controlled vocabulary terms for a given vocabulary',
-    'weight' => '0',
+    'weight' => '10',
     'name' => 'navigation',
   ));
   $handler->override_option('tab_options', array(
@@ -676,7 +676,7 @@ function tripal_cv_views_default_views() {
     'type' => 'normal',
     'title' => 'CV Listing',
     'description' => 'A listing of all controlled vocabularies',
-    'weight' => '0',
+    'weight' => '10',
     'name' => 'navigation',
   ));
   $handler->override_option('tab_options', array(

+ 2 - 2
tripal_db/tripal_db.views.inc

@@ -339,7 +339,7 @@ function tripal_db_views_default_views() {
     'type' => 'normal',
     'title' => 'DB Listing',
     'description' => 'Lists all databases available to create database references for.',
-    'weight' => '0',
+    'weight' => '10',
     'name' => 'navigation',
   ));
   $handler->override_option('tab_options', array(
@@ -647,7 +647,7 @@ function tripal_db_views_default_views() {
     'type' => 'normal',
     'title' => 'DB Reference Listing',
     'description' => 'A listing of all database references associated with a given database',
-    'weight' => '0',
+    'weight' => '10',
     'name' => 'navigation',
   ));
   $handler->override_option('tab_options', array(

+ 3 - 3
tripal_feature/tripal_feature.views.inc

@@ -578,9 +578,9 @@ function tripal_feature_views_default_views() {
   $handler->override_option('menu', array(
     'type' => 'normal',
     'title' => 'Features View',
-    'description' => 'Provides a table of sequence features',
-    'weight' => '0',
-    'name' => 'primary-links',
+    'description' => '',
+    'weight' => '10',
+    'name' => 'navigation',
   ));
   $handler->override_option('tab_options', array(
     'type' => 'none',

+ 2 - 2
tripal_genetic/tripal_genetic.views.inc

@@ -310,8 +310,8 @@ function tripal_genetic_views_default_views() {
     'type' => 'normal',
     'title' => 'Genotypes',
     'description' => '',
-    'weight' => '0',
-    'name' => 'primary-links',
+    'weight' => '10',
+    'name' => 'navigation',
   ));
   $handler->override_option('tab_options', array(
     'type' => 'none',

+ 2 - 2
tripal_library/tripal_library.views.inc

@@ -396,8 +396,8 @@ function tripal_library_views_default_views() {
     'type' => 'normal',
     'title' => 'Sequence Libraries',
     'description' => '',
-    'weight' => '0',
-    'name' => 'primary-links',
+    'weight' => '10',
+    'name' => 'navigation',
   ));
   $handler->override_option('tab_options', array(
     'type' => 'none',

+ 7 - 7
tripal_natural_diversity/tripal_natural_diversity.views.inc

@@ -318,8 +318,8 @@ function tripal_natural_diversity_views_default_views() {
     'type' => 'normal',
     'title' => 'Natural Diversity Experiments',
     'description' => '',
-    'weight' => '0',
-    'name' => 'primary-links',
+    'weight' => '10',
+    'name' => 'navigation',
   ));
   $handler->override_option('tab_options', array(
     'type' => 'none',
@@ -704,7 +704,7 @@ function tripal_natural_diversity_views_default_views() {
     'type' => 'normal',
     'title' => 'Geographical Locations',
     'description' => '',
-    'weight' => '0',
+    'weight' => '10',
     'name' => 'navigation',
   ));
   $handler->override_option('tab_options', array(
@@ -839,9 +839,9 @@ function tripal_natural_diversity_views_default_views() {
   $handler->override_option('path', 'natdiv_protocols');
   $handler->override_option('menu', array(
     'type' => 'normal',
-    'title' => 'Natural Diversity Protocols',
+    'title' => 'Protocols',
     'description' => 'The protcols used for natural diversity experiments',
-    'weight' => '0',
+    'weight' => '10',
     'name' => 'navigation',
   ));
   $handler->override_option('tab_options', array(
@@ -1053,9 +1053,9 @@ function tripal_natural_diversity_views_default_views() {
   $handler->override_option('path', 'natdiv_reagents');
   $handler->override_option('menu', array(
     'type' => 'normal',
-    'title' => 'Natural Diversity Protocol Reagents',
+    'title' => 'Reagents',
     'description' => 'Reagents used in natural diversity experiments',
-    'weight' => '0',
+    'weight' => '10',
     'name' => 'navigation',
   ));
   $handler->override_option('tab_options', array(

+ 2 - 2
tripal_organism/tripal_organism.views.inc

@@ -319,8 +319,8 @@ function tripal_organism_views_default_views() {
     'type' => 'normal',
     'title' => 'Organisms',
     'description' => '',
-    'weight' => '0',
-    'name' => 'primary-links',
+    'weight' => '10',
+    'name' => 'navigation',
   ));
   $handler->override_option('tab_options', array(
     'type' => 'none',

+ 2 - 2
tripal_phenotype/tripal_phenotype.views.inc

@@ -546,8 +546,8 @@ function tripal_phenotype_views_default_views() {
     'type' => 'normal',
     'title' => 'Phenotypes',
     'description' => '',
-    'weight' => '0',
-    'name' => 'primary-links',
+    'weight' => '10',
+    'name' => 'navigation',
   ));
   $handler->override_option('tab_options', array(
     'type' => 'none',

+ 2 - 2
tripal_project/tripal_project.views.inc

@@ -240,8 +240,8 @@ function tripal_project_views_default_views() {
     'type' => 'normal',
     'title' => 'Projects',
     'description' => '',
-    'weight' => '0',
-    'name' => 'primary-links',
+    'weight' => '10',
+    'name' => 'navigation',
   ));
   $handler->override_option('tab_options', array(
     'type' => 'none',

+ 3 - 3
tripal_stock/tripal_stock.views.inc

@@ -556,9 +556,9 @@ function tripal_stock_views_default_views() {
   $handler->override_option('menu', array(
     'type' => 'normal',
     'title' => 'Stocks',
-    'description' => 'A full listing of all chado stocks',
-    'weight' => '0',
-    'name' => 'primary-links',
+    'description' => '',
+    'weight' => '10',
+    'name' => 'navigation',
   ));
   $handler->override_option('tab_options', array(
     'type' => 'none',

+ 21 - 10
tripal_views/includes/tripal_views_integration.inc

@@ -360,6 +360,10 @@ function tripal_views_integration_form(&$form_state, $setup_id = NULL) {
     '#options' => $priorities,
     '#default_value' => (isset($setup_obj->priority)) ? $setup_obj->priority : -1,
   );
+  if ($setup_obj->priority >= 9) {
+    drupal_set_message('You are editing a default views integration. To ensure your changes
+    are used, change the priority to -10.','warning');
+  }
 
   $form['views_type']['base_table'] = array(
     '#type' => 'checkbox',
@@ -503,7 +507,7 @@ function tripal_views_integration_form(&$form_state, $setup_id = NULL) {
         '#prefix' => "<div class=\"column-one\">",
         '#value' => "<span class=\"column-name\">" . filter_xss($column_name) . "</span>".
                     "<br /><span class=\"column-type\">" . filter_xss($column_type) . "</span>",
-        '#suffix' => "</div>",        
+        '#suffix' => "</div>",
       );
       $data['field_types'][$column_name] = $column_type;
 
@@ -817,17 +821,24 @@ function tripal_views_integration_form(&$form_state, $setup_id = NULL) {
   //use this to put values into $form_state['values']
   $form['data'] = array();
 
-  //need to find out if storing $form['data'][$key]['#value'] = $value <- is an issue
-  //since it will give me errors if i try to stare an array instead of $value
-  //and yet $value can be an array ie "field_types"
+  // Ensure that we don't store an array
+  // since we will get a check_plain:htmlspecial_characters error if we do
   foreach ($data as $key => $value) {
-    $form['data'][$key] = array(
-      '#type' => 'hidden',
-      '#value' => $value,
-    );
+    if (is_array($value)) {
+      $form['data'][$key] = array(
+        '#type' => 'hidden',
+        '#value' => serialize($value),
+      );
+    }
+    else {
+      $form['data'][$key] = array(
+        '#type' => 'hidden',
+        '#value' => $value,
+      );
+    }
   }
 
-  $form['#redirect'] = 'admin/tripal/views/integration';
+  $form['#redirect'] = 'admin/tripal/views/integration/list';
 
   return $form;
 }
@@ -948,7 +959,7 @@ function tripal_views_integration_form_submit($form, &$form_state) {
   // iterate through the columns of the form and add
   // the joins if provided, and the handlers
   $i = 1;
-  foreach ($form_state['values']['field_types'] as $key => $value) {
+  foreach (unserialize($form_state['values']['field_types']) as $key => $value) {
 
     // add the field definition
     $view_field_record = array(