Index: context.plugins.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/context/Attic/context.plugins.inc,v
retrieving revision 1.1.2.8.2.3
diff -u -p -r1.1.2.8.2.3 context.plugins.inc
--- context.plugins.inc	21 Sep 2010 00:54:22 -0000	1.1.2.8.2.3
+++ context.plugins.inc	16 Feb 2011 18:52:00 -0000
@@ -70,13 +70,11 @@ function _context_context_registry() {
     );
   }
   if (module_exists('taxonomy')) {
-    /*
     $registry['conditions']['node_taxonomy'] = array(
       'title' => t('Taxonomy'),
       'description' => t('Set this context when viewing a node with the selected taxonomy terms.'),
       'plugin' => 'context_condition_node_taxonomy',
     );
-    */
     $registry['conditions']['taxonomy_term'] = array(
       'title' => t('Taxonomy term'),
       'description' => t('Set this context when viewing a taxonomy term page.'),
@@ -193,7 +191,6 @@ function _context_context_plugins() {
     ),
   );
   if (module_exists('taxonomy')) {
-    /*
     $plugins['context_condition_node_taxonomy'] = array(
       'handler' => array(
         'path' => drupal_get_path('module', 'context') .'/plugins',
@@ -202,7 +199,6 @@ function _context_context_plugins() {
         'parent' => 'context_condition_node',
       ),
     );
-    */
     $plugins['context_condition_taxonomy_term'] = array(
       'handler' => array(
         'path' => drupal_get_path('module', 'context') .'/plugins',
Index: plugins/context_condition_node_taxonomy.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/context/plugins/Attic/context_condition_node_taxonomy.inc,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 context_condition_node_taxonomy.inc
--- plugins/context_condition_node_taxonomy.inc	3 Aug 2010 03:25:23 -0000	1.1.2.3
+++ plugins/context_condition_node_taxonomy.inc	16 Feb 2011 18:52:00 -0000
@@ -24,24 +24,49 @@ class context_condition_node_taxonomy ex
     $form['#type'] = 'select';
     $form['#size'] = 12;
     $form['#multiple'] = TRUE;
-    $form['#options'] = taxonomy_form_all();
+    $vocabularies = taxonomy_get_vocabularies();
+    $options = array();
+    foreach ($vocabularies as $vid => $vocabulary) {
+      $tree = taxonomy_get_tree($vid);
+      if ($tree && (count($tree) > 0)) {
+        $options[$vocabulary->name] = array();
+        foreach ($tree as $term) {
+          $options[$vocabulary->name][$term->tid] = str_repeat('-', $term->depth) . $term->name;
+        }   
+      }   
+    }
+    $form['#options'] = $options;
     return $form;
   }
 
   function execute($node, $op) {
-    if ($this->condition_used() && !empty($node->taxonomy)) {
-      foreach ($node->taxonomy as $term) {
-        foreach ($this->get_contexts($term->tid) as $context) {
-          // Check the node form option.
-          if ($op === 'form') {
-            $options = $this->fetch_from_context($context, 'options');
-            if (!empty($options['node_form'])) {
-              $this->condition_met($context, $term->tid);
+    // build a list of each taxonomy reference field belonging to the bundle for the current node
+    $fields = field_info_fields();
+    $instance_fields = field_info_instances('node', $node->type);
+    $check_fields = array();
+    foreach ($instance_fields as $key => $field_info) {
+      if ($fields[$key]['type'] == 'taxonomy_term_reference') {
+        $check_fields[] = $key;
+      }
+    }
+
+    if ($this->condition_used() && !empty($check_fields)) {
+      foreach ($check_fields as $field) {
+        if (isset($node->{$field}[$node->language])) {
+          foreach ($node->{$field}[$node->language] as $term) {
+            foreach ($this->get_contexts($term['tid']) as $context) {
+              // Check the node form option.
+              if ($op === 'form') {
+                $options = $this->fetch_from_context($context, 'options');
+                if (!empty($options['node_form'])) {
+                  $this->condition_met($context, $term['tid']);
+                }
+              }
+              else {
+                $this->condition_met($context, $term['tid']);
+              }
             }
           }
-          else {
-            $this->condition_met($context, $term->tid);
-          }
         }
       }
     }
