Kaynağa Gözat

Fixed a few bugs caused by changing the way features are synced. It broke the feature browser

spficklin 14 yıl önce
ebeveyn
işleme
db8929aefe

+ 6 - 1
theme_tripal/node-chado_organism.tpl.php

@@ -68,9 +68,14 @@ if (Drupal.jsEnabled) {
       }
       if(block != null){
          $("#tripal_organism-"+block[1]+"-box").show();
-      } else {
+      } 
+      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());
       
    });

+ 3 - 3
tripal_feature/syncFeatures.php

@@ -53,7 +53,7 @@ function tripal_feature_sync_form (){
          "spaces or entered separately on new lines. The names must match ".
          "exactly (spelling and case) with terms in the sequence ontology'),
       '#required'    => TRUE,
-      '#default_value' => variable_get('chado_feature_types','EST contig'),
+      '#default_value' => variable_get('chado_sync_feature_types','gene contig'),
    );
 
    // get the list of organisms
@@ -107,7 +107,7 @@ function tripal_feature_sync_form_submit ($form, &$form_state){
       $title = t('Sync all features for all synced organisms');
    }
 
-   variable_get('chado_feature_types',$feature_types);
+   variable_set('chado_sync_feature_types',$feature_types);
 
    tripal_add_job($title,'tripal_feature',
          'tripal_feature_sync_features',$job_args,$user->uid);
@@ -168,7 +168,7 @@ function tripal_feature_sync_features ($max_sync = 0, $organism_id = NULL,
    // we will build drupal pages from features in chado.  If a feature
    // is not one of the specified typse we won't build a node for it.
    if(!$feature_types){
-      $allowed_types = variable_get('chado_feature_types','EST contig');
+      $allowed_types = variable_get('chado_sync_feature_types','gene contig');
    } else {
       $allowed_types = $feature_types;
    }

+ 18 - 3
tripal_feature/tripal_feature.admin.inc

@@ -233,12 +233,25 @@ function tripal_feature_admin () {
       );
 //      $allowedoptions ['allow_feature_browser'] = "Allow loading of the feature browsing through AJAX. For large sites the initial page load will be quick with the feature browser loading afterwards.";
 
-      $form['browser']['browse_features'] = array(
-         '#title' => 'Feature Browser on Organism Page',
-         '#description' => 'A feature browser can be added to an organism page to allow users to quickly '. 
+      $form['browser']['browser_desc'] = array(
+         '#type'        => 'markup',
+         '#value' => 'A feature browser can be added to an organism page to allow users to quickly '. 
             'access a feature.  This will most likely not be the ideal mechanism for accessing feature '.
             'information, especially for large sites, but it will alow users exploring the site (such '.
             'as students) to better understand the data types available on the site.',
+
+      );
+      $form['browser']['feature_types'] = array(
+         '#title'       => t('Feature Types'),
+         '#type'        => 'textarea',
+         '#description' => t("Enter the Sequence Ontology (SO) terms for the feature types that ".
+                             "will be shown in the feature browser."),
+         '#default_value' => variable_get('chado_browser_feature_types','gene contig'),
+      );
+
+
+      $form['browser']['browse_features'] = array(
+         '#title' => 'Feature Browser on Organism Page',
          '#type' => 'radios',
          '#options' => $allowedoptions1,
          '#default_value'=>variable_get('tripal_feature_browse_setting', 'show_feature_browser'),
@@ -298,6 +311,8 @@ function tripal_feature_admin_validate($form, &$form_state) {
    global $user;  // we need access to the user info
    $job_args = array();
 
+   variable_set('chado_browser_feature_types',$form_state['values']['feature_types']);
+
    // if the user wants to sync up the chado features then
    // add the job to the management queue
    switch ($form_state['values']['op']){

+ 1 - 1
tripal_feature/tripal_feature.module

@@ -1360,7 +1360,7 @@ function tripal_feature_load_organism_feature_browser($organism){
    # get the list of available sequence ontology terms for which
    # we will build drupal pages from features in chado.  If a feature
    # is not one of the specified typse we won't build a node for it.
-   $allowed_types = variable_get('chado_feature_types','EST contig');
+   $allowed_types = variable_get('chado_browser_feature_types','EST contig');
    $allowed_types = preg_replace("/[\s\n\r]+/"," ",$allowed_types);
    $so_terms = split(' ',$allowed_types);
    $where_cvt = "";