Index: rules/modules/taxonomy.rules_forms.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/rules/rules/modules/Attic/taxonomy.rules_forms.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 taxonomy.rules_forms.inc
--- rules/modules/taxonomy.rules_forms.inc	28 Oct 2008 16:57:19 -0000	1.1.2.3
+++ rules/modules/taxonomy.rules_forms.inc	15 Jan 2009 19:00:09 -0000
@@ -16,11 +16,7 @@
   if (empty($settings['vocabulary'])) {
     // Get existing taxonomy vocabularies.
     $vocab = $options = array();
-    $vocabs = taxonomy_get_vocabularies();
-    foreach ($vocabs as $vocab) {
-      $options[$vocab->vid] = check_plain($vocab->name);
-    }
-
+    $options = _rules_action_taxonomy_get_vocab();
     $form['settings']['vocabulary'] = array(
       '#type' => 'select',
       '#title' => t('Vocabulary'),
@@ -29,6 +25,7 @@
       '#required' => TRUE,
       '#disabled' => empty($options),
     );
+
     // Hide some form elements in the first step.
     $form['new']['#access'] = FALSE;
     $form['input_help']['#access'] = FALSE;
@@ -75,3 +72,57 @@
   return _taxonomy_term_select(check_plain($vocabulary->name), $name, $value, $vid, $help, FALSE, t('- None selected -'));
 }
 
+/**
+ * Action: Load a vocabulary configuration form.
+ */
+function rules_action_taxonomy_load_vocab_form($settings, &$form, $form_state) {
+  $form['settings']['vocabulary'] = array(
+   '#type' => 'fieldset',
+   '#title' => t('Vocabulary selection'),
+  );
+  $options = _rules_action_taxonomy_get_vocab();
+  $form['settings']['vocabulary']['vocab_select'] = array(
+    '#type' => 'select',
+    '#title' => t('Select a vocabulary'),
+    '#options' => $options,
+    '#default_value' => !empty($settings['vocabulary']['vocab_select']) ? $settings['vocabulary']['vocab_select'] : '',
+    '#description' => !empty($options) ? t('Select the vocabulary.') : t('There are no existing vocabularies, you should <a href="!taxonomy-add-vocabulary">add</a> one.', array('!add' => url('/admin/content/taxonomy/add/vocabulary'))),
+    '#required' => TRUE,
+    '#disabled' => empty($options),
+  );
+  $form['settings']['vocabulary']['vocab_text'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Select by term id'),
+    '#default_value' => !empty($settings['vocabulary']['vocab_text']) ? $settings['vocabulary']['vocab_text'] : '',
+    '#disabled' => empty($options),
+    '#description' => t('Optional: enter the vocabulary id (<em>not the vocabulary name</em>) that should be loaded . If this field is used "Select a vocabulary" field will be ignored.'),
+  );
+}
+
+/**
+ * Action: Create a new vocabulary configuration form.
+ */
+function rules_action_taxonomy_add_vocab_form($settings, &$form, $form_state) {
+  module_load_include('inc', 'taxonomy', 'taxonomy.admin');
+  $form['settings']['vocab'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Vocabulary settings'),
+  );
+
+  $form['settings']['vocab']['vocab'] = taxonomy_form_vocabulary($form_state, _rules_action_taxonomy_prepare_vocab_settings($settings));
+  // Remove the 'Save' button.
+  unset($form['settings']['vocab']['vocab']['submit']);
+}
+
+
+/**
+ * Helper function; Return all existing vocabularies.
+ */
+function _rules_action_taxonomy_get_vocab() {
+  $vocabs = taxonomy_get_vocabularies();
+  $options = array();
+  foreach ($vocabs as $vocab) {
+    $options[$vocab->vid] = check_plain($vocab->name);
+  }
+  return $options;
+}
\ No newline at end of file
Index: rules/modules/taxonomy.rules.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/rules/rules/modules/Attic/taxonomy.rules.inc,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 taxonomy.rules.inc
--- rules/modules/taxonomy.rules.inc	15 Jan 2009 17:19:31 -0000	1.1.2.2
+++ rules/modules/taxonomy.rules.inc	15 Jan 2009 19:00:09 -0000
@@ -60,6 +60,7 @@
  */
 function taxonomy_rules_action_info() {
   $info = array();
+  // Term actions.
   $info['rules_action_taxonomy_load_term'] = array(
     'label' => t('Load a term'),
     'new variables' => array(
@@ -100,6 +101,29 @@
     ),
     'module' => 'Taxonomy',
   );
+  // Vocabulary actions.
+  $info['rules_action_taxonomy_load_vocab'] = array(
+    'label' => t('Load a vocabulary'),
+    'new variables' => array(
+      'taxonomy_vocab' => array(
+        'type' => 'taxonomy_vocab',
+        'label' => t('Taxonomy vocabulary'),
+      ),
+    ),
+    'eval input' => array('vocab_text'),
+    'help' => t('Loading a taxonomy vocabulary will allow you to act on this vocabulary.'),
+    'module' => 'Taxonomy',
+  );
+  $info['rules_action_taxonomy_add_vocab'] = array(
+    'label' => t('Add a new vocabulary'),
+    'new variables' => array(
+      'taxonomy_vocab' => array(
+        'type' => 'taxonomy_vocab',
+        'label' => t('Taxonomy vocabulary'),
+      ),
+    ),
+    'module' => 'Taxonomy',
+  );
   return $info;
 }
 
@@ -133,6 +157,46 @@
 }
 
 /**
+ * Action: Load a vocabulary.
+ */
+function rules_action_taxonomy_load_vocab($settings) {
+  $vid = !empty($settings['vocabulary']['vocab_text']) ? $settings['vocabulary']['vocab_text'] : $settings['vocabulary']['vocab_select'];
+  return array('taxonomy_vocab' => taxonomy_vocabulary_load($vid));
+}
+
+/**
+ * Action: Add a new vocabulary.
+ */
+function rules_action_taxonomy_add_vocab($settings) {
+  $vocab = _rules_action_create_vocab($settings);
+  taxonomy_save_vocabulary($vocab);
+  return array('taxonomy_vocab' => $vocab);
+}
+
+/**
+ * Helper function; Prepare the settings for the taxonomy form.
+ */
+function _rules_action_create_vocab($settings) {
+  $vocab = array();
+  if (!empty($settings['vocab'])) {
+    foreach ($settings['vocab']['vocab'] as $key => $values) {
+      if (is_array($values)) {
+        if (!empty($values['nodes'])) {
+          // User array_filter for the nodes, otherwise all content types will be
+          // chosen.
+          $values['nodes'] = array_filter($values['nodes']);
+        }
+        $vocab += $values;
+      }
+      else {
+        $vocab[$key] = $values;
+      }
+    }
+  }
+  return $vocab;
+}
+
+/**
  * Implementation of hook_rules_data_type_info().
  */
 function taxonomy_rules_data_type_info() {
@@ -144,6 +208,13 @@
       'identifiable' => TRUE,
       'module' => 'Taxonomy',
     ),
+    'taxonomy_vocab' => array(
+      'label' => t('Taxonomy vocabulary'),
+      'class' => 'rules_data_type_taxonomy_vocab',
+      'savable' => FALSE,
+      'identifiable' => TRUE,
+      'module' => 'Taxonomy',
+    ),
   );
 }
 
@@ -161,3 +232,18 @@
     return $term->tid;
   }
 }
+
+/**
+ * Defines the taxonomy vocab data type.
+ */
+class rules_data_type_taxonomy_vocab extends rules_data_type {
+
+  function load($vid) {
+    return taxonomy_vocabulary_load($vid);
+  }
+
+  function get_identifier() {
+    $vocab = &$this->get();
+    return $vocab->vid;
+  }
+}
