--- pathauto.admin.inc	2008-06-25 00:07:51.000000000 +0800
+++ ../pathauto/pathauto.admin.inc	2009-03-27 16:36:58.000000000 +0800
@@ -414,6 +414,17 @@
   $objects = module_invoke_all('path_alias_types');
   foreach ($objects as $internal_name => $label) {
     $count = db_result(db_query("SELECT count(1) FROM {url_alias} WHERE src LIKE '%s%%'", $internal_name));
+    if ($label == 'content' || $label == 'vocabularies and terms') {
+      $form['delete'][$internal_name] = array(
+      '#type' => 'select',
+      '#title' => $label, // This label is sent through t() in the hard coded function where it is defined
+      '#default_value' => 'select',
+      '#options' => _list_options($label),
+      '#weight' => 100, // Put the element at the bottom
+      '#description' => t('Delete aliases by @label type. Number of aliases which will be deleted: %count.', array('@label' => $label, '%count' => $count)),
+      );
+    }
+    else {
     $form['delete'][$internal_name] = array(
       '#type' => 'checkbox',
       '#title' => $label, // This label is sent through t() in the hard coded function where it is defined
@@ -421,6 +432,7 @@
       '#description' => t('Delete aliases for all @label. Number of aliases which will be deleted: %count.', array('@label' => $label, '%count' => $count)),
     );
   }
+  }
 
   // Warn them and give a button that shows we mean business
   $form['warning'] = array('#value' => t('<p><strong>Note:</strong> there is no confirmation. Be sure of your action before clicking the "Delete aliases now!" button.<br />You may want to make a backup of the database and/or the url_alias table prior to using this feature.</p>'));
@@ -444,10 +456,84 @@
       }
       $objects = module_invoke_all('path_alias_types');
       if (array_key_exists($key, $objects)) {
+        if ($value == 'select') {
+          continue;
+        }
+        if ($key == 'node/') {
+          if ($value == 'all') {
+            db_query("DELETE FROM {url_alias} WHERE src LIKE '%s%%'", $key);
+            drupal_set_message(t('All of your %type path aliases have been deleted.', array('%type' => $objects[$key])));
+          }
+          else {
+            $node = db_query("SELECT nid FROM {node} WHERE type='%s'", $value);
+            $count = 0;
+            while ($n = db_fetch_object($node)) {
+              db_query("DELETE FROM {url_alias} WHERE src LIKE 'node/%d'", $n->nid);
+              $count = $count + db_affected_rows();
+            }
+            drupal_set_message(t('%num of your %type type path aliases have been deleted.', array('%num' => $count, '%type' => $value)));
+          }
+        }
+        elseif ($key == 'taxonomy/') {
+          if ($value == 'all') {
+            db_query("DELETE FROM {url_alias} WHERE src LIKE '%s%%'", $key);
+            drupal_set_message(t('All of your %type path aliases have been deleted.', array('%type' => $objects[$key])));
+          }
+          else {
+            $voc = db_result(db_query("SELECT vid FROM {vocabulary} WHERE name='%s'", $value));
+            $node = db_query("SELECT tid FROM {term_data} WHERE vid=%d", $voc);
+            $count = 0;
+            while ($n = db_fetch_object($node)) {
+              db_query("DELETE FROM {url_alias} WHERE src LIKE 'taxonomy/term/%d'", $n->tid);
+              $count = $count + db_affected_rows();
+            }
+            drupal_set_message(t('%num of your %type type path aliases have been deleted.', array('%num' => $count, '%type' => $value)));
+          }
+        }
+        else {
         db_query("DELETE FROM {url_alias} WHERE src LIKE '%s%%'", $key);
         drupal_set_message(t('All of your %type path aliases have been deleted.', array('%type' => $objects[$key])));
       }
     }
   }
+  }
   $form_state['redirect'] = 'admin/build/path/delete_bulk';
 }
+
+/**
+ * Getting all node type
+ */
+function _content_type_list() {
+  $node = db_query("SELECT name, type FROM {node_type}");
+  $options = array('select' => '---', 'all' => "All");
+  while ($n = db_fetch_object($node)) {
+    $options[$n->type] = $n->name;
+  }
+  return $options;
+}
+
+/**
+ * Getting all taxonomy vocabulary
+ */
+function _taxonomy_vocabulary_list() {
+  $node = db_query("SELECT name FROM {vocabulary}");
+  $options = array('select' => '---', 'all' => "All");
+  while ($n = db_fetch_object($node)) {
+    $options[$n->name] = $n->name;
+  }
+  return $options;
+}
+
+/**
+ * return for the options function
+ */
+function _list_options($func) {
+  switch ($func) {
+    case 'content':
+      return  _content_type_list();
+      break;
+    case 'vocabularies and terms':
+      return  _taxonomy_vocabulary_list();
+      break;
+  }
+}
\ No newline at end of file
