瀏覽代碼

Fixed the bug where the edit drop down box on the feature edit/create form wasn't getting populated with reasonable values.

spficklin 13 年之前
父節點
當前提交
838e168b2f
共有 2 個文件被更改,包括 31 次插入1 次删除
  1. 30 0
      tripal_feature/tripal_feature.admin.inc
  2. 1 1
      tripal_feature/tripal_feature.module

+ 30 - 0
tripal_feature/tripal_feature.admin.inc

@@ -262,6 +262,32 @@ function tripal_feature_admin () {
          '#weight' => 2,
       );
 
+
+      $form['feature_edit'] = array(
+         '#type' => 'fieldset',
+         '#title' => t('Feature Editing')
+      );
+
+      $form['feature_edit']['browser_desc'] = array(
+         '#type'        => 'markup',
+         '#value' => 'When editing or creating a feature, a user must provide the feature type. '.
+                     'The Sequence Ontology list is very large, therefore, to simply the list of types for the user, the following '.
+                     'textbox allows you to specify which features types can be used. This list of terms will appear in the '.
+                     'feature type drop down list of the feature creation/edit form.',
+
+      );
+      $form['feature_edit']['feature_edit_types'] = array(
+         '#title'       => t('Feature Types'),
+         '#type'        => 'textarea',
+         '#description' => t("Enter the Sequence Ontology (SO) terms for the allowed feature types when creating or editing features."),
+         '#default_value' => variable_get('chado_edit_feature_types','gene contig EST mRNA'),
+      );
+
+      $form['feature_edit']['set_feature_types'] = array(
+         '#type' => 'submit',
+         '#value' => t('Set Feature Types'),
+      );
+
       $form['summary'] = array(
          '#type' => 'fieldset',
          '#title' => t('Feature Summary')
@@ -341,6 +367,10 @@ function tripal_feature_admin_validate($form, &$form_state) {
          variable_set('tripal_feature_browse_setting',$form_state['values']['browse_features']);
          break;
 
+      case t('Set Feature Types') :
+         variable_set('tripal_feature_type_setting',$form_state['values']['feature_edit_types']);
+         break;
+
       case t('Set Summary') :
          variable_set('tripal_feature_summary_setting',$form_state['values']['feature_summary']);
          break;

+ 1 - 1
tripal_feature/tripal_feature.module

@@ -778,7 +778,7 @@ function chado_feature_form ($node,$param){
    // get the list of supported feature types
    $ftypes = array();
    $ftypes[''] = '';
-   $supported_ftypes = split("[ \n]",variable_get('chado_browser_feature_types','gene mRNA EST contig'));
+   $supported_ftypes = split("[ \n]",variable_get('tripal_feature_type_setting','gene mRNA EST contig'));
    foreach($supported_ftypes as $ftype){
       $ftypes["$ftype"] = $ftype;
    }