--- taxonomy_actions.inc.orig	2008-11-04 16:01:47.000000000 -0500
+++ taxonomy_actions.inc	2008-11-04 17:17:42.000000000 -0500
@@ -17,8 +17,21 @@
   foreach ($context['terms'] as $tid) {
     $terms[$tid] = taxonomy_get_term($tid);
   }
-  if (!$context['replace']) {
-    $terms = array_merge($terms, taxonomy_node_get_terms($node->nid));
+	// check for add or delete
+  if ($context['do'] == 0 || $context['do'] == 2) {
+		$existing_terms = taxonomy_node_get_terms($node->nid);
+		if($context['do'] == '2') {
+			// delete terms
+			while(list($delete_tid) = each($terms)) {
+				if(array_key_exists($delete_tid,$existing_terms)) {
+					unset($existing_terms[$delete_tid]);
+				}
+			}
+			$terms = $existing_terms;
+		} else {
+			// add terms
+    	$terms = array_merge($terms, $existing_terms);
+		}
   }
   $node->taxonomy = $terms;
 }
@@ -36,27 +49,35 @@
     '#default_value' => $context['terms'],
     '#multiple' => TRUE,
     '#size' => min(20, count($terms)),
-    '#description' => t('Choose the terms you want to associate with the nodes.'),
+    '#description' => t('Choose the terms you want to associate with or delete from the nodes.'),
+		'#weight' => -5,
   );
-  $form['replace'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Replace existing terms'),
-    '#default_value' => FALSE,
-    '#description' => t('Check this box to replace existing terms with selected ones. Leave unchecked to add the new terms.'),
+  $form['do'] = array(
+    '#type' => 'radios',
+    '#title' => t('Action to take'),
+		'#default_value' => 0,
+		'#options' => array(
+			t('Add the selected terms'),
+			t('Replace existing terms with selected ones'),
+			t('Delete selected terms')
+		),
+		'#required' => TRUE,
+		'#weight' => -2,
   );
-  return $form;
+	return $form;
 }
 
 function taxonomy_action_submit($form_id, $form_values) {
   return array(
-    'replace' => $form_values['replace'], 
+    'do' => $form_values['do'], 
     'terms' => $form_values['terms'],
   );
 }
 
 function taxonomy_action_validate($form_id, $form_values) {
-  if (!$form_values['replace'] && empty($form_values['terms'])) {
-    form_set_error('terms', t('You did not select any term nor did you choose to replace existing terms. Please select one or more terms.'));
+  if ($form_values['do'] != 1 && empty($form_values['terms'])) {
+    form_set_error('terms', t('You did not select any term nor did you choose to replace existing terms. Please select one or more terms or choose to replace the terms.'));
   }
+
 }
 
