Index: modules/taxonomy/views_handler_filter_term_node_tid.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/taxonomy/views_handler_filter_term_node_tid.inc,v
retrieving revision 1.7
diff -u -p -r1.7 views_handler_filter_term_node_tid.inc
--- modules/taxonomy/views_handler_filter_term_node_tid.inc	20 Feb 2009 20:35:37 -0000	1.7
+++ modules/taxonomy/views_handler_filter_term_node_tid.inc	25 Mar 2009 19:50:12 -0000
@@ -13,6 +13,7 @@ class views_handler_filter_term_node_tid
     $options = parent::option_definition();
 
     $options['type'] = array('default' => 'textfield');
+    $options['limit'] = array('default' => TRUE);
     $options['vid'] = array('default' => 0);
 
     return $options;
@@ -24,21 +25,23 @@ class views_handler_filter_term_node_tid
       $options[$voc->vid] = check_plain($voc->name);
     }
 
-    // We only do this when the form is displayed so this query doesn't run
-    // unnecessarily just when the object is constructed.
-    if ($this->options['vid'] == 0) {
-      $this->options['vid'] = db_result(db_query('SELECT MIN(vid) FROM {vocabulary} v'));
-    }
+    if ($this->options['limit']) {
+      // We only do this when the form is displayed so this query doesn't run
+      // unnecessarily just when the object is constructed.
+      if ($this->options['vid'] == 0) {
+        $this->options['vid'] = db_result(db_query('SELECT MIN(vid) FROM {vocabulary} v'));
+      }
 
-    $form['vid'] = array(
-      '#prefix' => '<div class="views-left-40">',
-      '#suffix' => '</div>',
-      '#type' => 'radios',
-      '#title' => t('Vocabulary'),
-      '#options' => $options,
-      '#description' => t('Select which vocabulary to show terms for in the regular options.'),
-      '#default_value' => $this->options['vid'],
-    );
+      $form['vid'] = array(
+        '#prefix' => '<div class="views-left-40">',
+        '#suffix' => '</div>',
+        '#type' => 'radios',
+        '#title' => t('Vocabulary'),
+        '#options' => $options,
+        '#description' => t('Select which vocabulary to show terms for in the regular options.'),
+        '#default_value' => $this->options['vid'],
+      );
+    }
 
     $form['markup_start'] = array(
       '#value' => '<div class="views-left-40">',
@@ -66,7 +69,7 @@ class views_handler_filter_term_node_tid
 
   function value_form(&$form, &$form_state) {
     $vocabulary = taxonomy_vocabulary_load($this->options['vid']);
-    if (!$vocabulary) {
+    if (empty($vocabulary) && $this->options['limit']) {
       $form['markup'] = array(
         '#prefix' => '<div class="form-item">',
         '#suffix' => '</div>',
@@ -88,14 +91,17 @@ class views_handler_filter_term_node_tid
       }
 
       $form['value'] = array(
-        '#title' => t('Select terms from vocabulary @voc', array('@voc' => $vocabulary->name)),
+        '#title' => $this->options['limit'] ? t('Select terms from vocabulary @voc', array('@voc' => $vocabulary->name)) : t('Select terms'),
         '#type' => 'textfield',
-        '#autocomplete_path' => 'taxonomy/autocomplete/' . $vocabulary->vid,
         '#default_value' => $default,
       );
+
+      if ($this->options['limit']) {
+        $form['value']['#autocomplete_path'] = 'taxonomy/autocomplete/' . $vocabulary->vid;
+      }
     }
     else {
-      if (!empty($this->options['hierarchy'])) {
+      if (!empty($this->options['hierarchy']) && $this->options['limit']) {
         $tree = taxonomy_get_tree($vocabulary->vid);
         $options = array();
 
@@ -109,7 +115,12 @@ class views_handler_filter_term_node_tid
       }
       else {
         $options = array();
-        $result = db_query("SELECT * FROM {term_data} WHERE vid = %d ORDER BY weight, name", $vocabulary->vid);
+        if ($this->options['limit']) {
+          $result = db_query("SELECT * FROM {term_data} WHERE vid = %d ORDER BY weight, name", $vocabulary->vid);
+        }
+        else {
+          $result = db_query("SELECT td.* FROM {term_data} td INNER JOIN {vocabulary} v ON td.vid = v.vid ORDER BY v.weight, v.name, td.weight, td.name");
+        }
         while ($term = db_fetch_object($result)) {
           $options[$term->tid] = $term->name;
         }
@@ -144,7 +155,7 @@ class views_handler_filter_term_node_tid
       }
       $form['value'] = array(
         '#type' => 'select',
-        '#title' => t('Select terms from vocabulary @voc', array('@voc' => $vocabulary->name)),
+        '#title' => $this->options['limit'] ? t('Select terms from vocabulary @voc', array('@voc' => $vocabulary->name)) : t('Select terms'),
         '#multiple' => TRUE,
         '#options' => $options,
         '#size' => min(9, count($options)),
