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

Fixed admin page -set path to actually allow empty path

Lacey Sanderson 8 жил өмнө
parent
commit
cef25299d5

+ 12 - 12
includes/blast_ui.admin.inc

@@ -21,14 +21,14 @@ function blast_ui_admin_form($form, $form_state) {
     '#description' => t('You can ignore if your $PATH variable is set. Otherwise, enter the absoulte path to bin folder. For example, /opt/blast/2.2.29+/bin/'),
     '#description' => t('You can ignore if your $PATH variable is set. Otherwise, enter the absoulte path to bin folder. For example, /opt/blast/2.2.29+/bin/'),
     '#default_value' => variable_get('blast_path', ''),
     '#default_value' => variable_get('blast_path', ''),
   );
   );
-  
+
 	$form['general']['blast_threads']= array(
 	$form['general']['blast_threads']= array(
     '#type' => 'textfield',
     '#type' => 'textfield',
     '#title' => t('Enter the number of CPU threads to use in blast search.'),
     '#title' => t('Enter the number of CPU threads to use in blast search.'),
     '#description' => t('You can increase the number to reduce the search time. Before you increase, please check your hardware configurations . A value of one(1) can result in a slower search for some programs eg. tblastn.'),
     '#description' => t('You can increase the number to reduce the search time. Before you increase, please check your hardware configurations . A value of one(1) can result in a slower search for some programs eg. tblastn.'),
     '#default_value' => variable_get('blast_threads', 1),
     '#default_value' => variable_get('blast_threads', 1),
   );
   );
-  
+
    $form['general']['eVal']= array(
    $form['general']['eVal']= array(
     '#type' => 'textfield',
     '#type' => 'textfield',
     '#title' => t('e-Value (Expected Threshold)'),
     '#title' => t('e-Value (Expected Threshold)'),
@@ -36,14 +36,14 @@ function blast_ui_admin_form($form, $form_state) {
      '#default_value' => variable_get('eVal', 0.001),
      '#default_value' => variable_get('eVal', 0.001),
     //'#default_value' => variable_get('blast_threads', 1),
     //'#default_value' => variable_get('blast_threads', 1),
   );
   );
-  
+
   $form['general']['qRange']= array(
   $form['general']['qRange']= array(
     '#type' => 'textfield',
     '#type' => 'textfield',
     '#title' => t('Max matches in a query range'),
     '#title' => t('Max matches in a query range'),
     '#description' => t('Limit the number of matches to a query range. This option is useful if many strong matches to one part of a query may prevent BLAST from presenting weaker matches to another part of the query.'),
     '#description' => t('Limit the number of matches to a query range. This option is useful if many strong matches to one part of a query may prevent BLAST from presenting weaker matches to another part of the query.'),
     '#default_value' => variable_get('qRange', 0),
     '#default_value' => variable_get('qRange', 0),
   );
   );
-  
+
   $form['file_upload'] = array(
   $form['file_upload'] = array(
     '#type' => 'fieldset',
     '#type' => 'fieldset',
     '#title' => 'Allow File Upload',
     '#title' => 'Allow File Upload',
@@ -52,7 +52,7 @@ function blast_ui_admin_form($form, $form_state) {
       them to more conviently BLAST large sets of sequences. However, the size of the
       them to more conviently BLAST large sets of sequences. However, the size of the
       files could be problematic, storage-wise, on your server.<br />'
       files could be problematic, storage-wise, on your server.<br />'
   );
   );
-  
+
   $form['file_upload']['query_upload'] = array(
   $form['file_upload']['query_upload'] = array(
     '#type' => 'checkbox',
     '#type' => 'checkbox',
     '#title' => 'Enable Query Sequence Upload',
     '#title' => 'Enable Query Sequence Upload',
@@ -145,12 +145,12 @@ KRSLEEGLKTTGEGLDWGVLFGFGPGLTIETVVLRSVAI';
 function blast_ui_admin_form_validate($form, &$form_state) {
 function blast_ui_admin_form_validate($form, &$form_state) {
 	$blast_path = $form_state['values']['blast_path'];
 	$blast_path = $form_state['values']['blast_path'];
 	$blast_path .= 'blastn';
 	$blast_path .= 'blastn';
-	if(!empty($blast_path)) {
+	if(!empty($form_state['values']['blast_path'])) {
 		if(file_exists($blast_path) ) {
 		if(file_exists($blast_path) ) {
 			variable_set('blast_path', $form_state['values']['blast_path']);
 			variable_set('blast_path', $form_state['values']['blast_path']);
 		}
 		}
 		else {
 		else {
-			form_set_error('blast_path', t('Please enter a valid path or you can leave it blank'));
+			form_set_error('blast_path', t('Please enter a valid path not including the name of the blast program (ie: /urs/bin/). You can leave this blank if you have your $PATH variable set appropriately.'));
 		}
 		}
 	}
 	}
 
 
@@ -163,13 +163,13 @@ function blast_ui_admin_form_submit($form, $form_state) {
 
 
   variable_set('blast_path', $form_state['values']['blast_path']);
   variable_set('blast_path', $form_state['values']['blast_path']);
   variable_set('blast_threads', $form_state['values']['blast_threads']);
   variable_set('blast_threads', $form_state['values']['blast_threads']);
-  
+
   variable_set('eVal', $form_state['values']['eVal']);
   variable_set('eVal', $form_state['values']['eVal']);
   variable_set('qRange', $form_state['values']['qRange']);
   variable_set('qRange', $form_state['values']['qRange']);
-  
-  variable_set('blast_ui_allow_query_upload', $form_state['values']['query_upload']);	
+
+  variable_set('blast_ui_allow_query_upload', $form_state['values']['query_upload']);
   variable_set('blast_ui_allow_target_upload', $form_state['values']['target_upload']);
   variable_set('blast_ui_allow_target_upload', $form_state['values']['target_upload']);
-  
+
   variable_set('blast_ui_nucleotide_example_sequence', $form_state['values']['nucleotide_example']);
   variable_set('blast_ui_nucleotide_example_sequence', $form_state['values']['nucleotide_example']);
   variable_set('blast_ui_protein_example_sequence', $form_state['values']['protein_example']);
   variable_set('blast_ui_protein_example_sequence', $form_state['values']['protein_example']);
-}
+}