Index: modules/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node.module,v
retrieving revision 1.591
diff -u -r1.591 node.module
--- modules/node.module	24 Jan 2006 08:26:21 -0000	1.591
+++ modules/node.module	27 Jan 2006 14:57:04 -0000
@@ -733,26 +733,28 @@
       return $results;
 
     case 'form':
-      $form = array();
+      if (variable_get('advanced_search', true)) {
+        $form = array();
 
-      // Keyword boxes
-      $form['advanced'] = array('#type' => 'fieldset', '#title' => t('Advanced search'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#attributes' => array('class' => 'search-advanced'));
+        // Keyword boxes
+        $form['advanced'] = array('#type' => 'fieldset', '#title' => t('Advanced search'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#attributes' => array('class' => 'search-advanced'));
 
-      $form['advanced']['keywords'] = array('#type' => 'markup', '#prefix' => '<div class="criterium">', '#suffix' => '</div>');
-      $form['advanced']['keywords']['or'] = array('#type' => 'textfield', '#title' => t('Containing any of the words'), '#size' => 30, '#maxlength' => 255);
-      $form['advanced']['keywords']['phrase'] = array('#type' => 'textfield', '#title' => t('Containing the phrase'), '#size' => 30, '#maxlength' => 255);
-      $form['advanced']['keywords']['negative'] = array('#type' => 'textfield', '#title' => t('Containing none of the words'), '#size' => 30, '#maxlength' => 255);
-
-      // Taxonomy box
-      if ($taxonomy = module_invoke('taxonomy', 'form_all')) {
-        $form['advanced']['category'] = array('#type' => 'select', '#title' => t('Only in the category'), '#prefix' => '<div class="criterium">', '#suffix' => '</div>', '#options' => $taxonomy, '#extra' => 'size="10"', '#multiple' => true);
-      }
-
-      // Node types
-      $types = node_get_types();
-      $form['advanced']['type'] = array('#type' => 'checkboxes', '#title' => t('Only of the type'), '#prefix' => '<div class="criterium">', '#suffix' => '</div>', '#options' => $types);
-      $form['advanced']['submit'] = array('#type' => 'submit', '#value' => t('Advanced Search'), '#prefix' => '<div class="action">', '#suffix' => '</div>');
-      return $form;
+        $form['advanced']['keywords'] = array('#type' => 'markup', '#prefix' => '<div class="criterium">', '#suffix' => '</div>');
+        $form['advanced']['keywords']['or'] = array('#type' => 'textfield', '#title' => t('Containing any of the words'), '#size' => 30, '#maxlength' => 255);
+        $form['advanced']['keywords']['phrase'] = array('#type' => 'textfield', '#title' => t('Containing the phrase'), '#size' => 30, '#maxlength' => 255);
+        $form['advanced']['keywords']['negative'] = array('#type' => 'textfield', '#title' => t('Containing none of the words'), '#size' => 30, '#maxlength' => 255);
+
+        // Taxonomy box
+        if ($taxonomy = module_invoke('taxonomy', 'form_all')) {
+          $form['advanced']['category'] = array('#type' => 'select', '#title' => t('Only in the category'), '#prefix' => '<div class="criterium">', '#suffix' => '</div>', '#options' => $taxonomy, '#extra' => 'size="10"', '#multiple' => true);
+        }
+
+        // Node types
+        $types = node_get_types();
+        $form['advanced']['type'] = array('#type' => 'checkboxes', '#title' => t('Only of the type'), '#prefix' => '<div class="criterium">', '#suffix' => '</div>', '#options' => $types);
+        $form['advanced']['submit'] = array('#type' => 'submit', '#value' => t('Advanced Search'), '#prefix' => '<div class="action">', '#suffix' => '</div>');
+        return $form;
+      }
 
     case 'post':
       // Insert extra restrictions into the search keywords string.
Index: modules/search.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/search.module,v
retrieving revision 1.159
diff -u -r1.159 search.module
--- modules/search.module	22 Jan 2006 07:43:19 -0000	1.159
+++ modules/search.module	27 Jan 2006 14:57:04 -0000
@@ -225,6 +225,11 @@
   $form['indexing_settings']['minimum_word_size'] = array('#type' => 'textfield', '#title' => t('Minimum word length to index'), '#default_value' => variable_get('minimum_word_size', 3), '#size' => 5, '#maxlength' => 3, '#description' => t('The number of characters a word has to be to be indexed. A lower setting means better search result ranking, but also a larger database. Each search query must contain at least one keyword that is this size (or longer).'));
   $form['indexing_settings']['overlap_cjk'] = array('#type' => 'checkbox', '#title' => t('Simple CJK handling'), '#default_value' => variable_get('overlap_cjk', true), '#description' => t('Whether to apply a simple Chinese/Japanese/Korean tokenizer based on overlapping sequences. Turn this off if you want to use an external preprocessor for this instead. Does not affect other languages.'));
 
+  // Advanced search:
+  $form['advanced_search'] = array('#type' => 'fieldset', '#title' => t('Advanced search settings'));
+  $form['advanced_search']['advanced_search'] = array('#type' => 'checkbox', '#title' => t('Show advanced search form'), '#default_value' => variable_get('advanced_search', true), '#description' => t('Advanced searching may not be desirable with extremely large vocabularies. Uncheck this to disable advanced search'));
+
+
   // Per module settings
   $form = array_merge($form, module_invoke_all('search', 'admin'));
   return $form;
