? .directory
? drupal-621748-D6.patch
? drupal-764726-D6.patch
? includes/.directory
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.414.2.14
diff -u -p -r1.414.2.14 taxonomy.module
--- modules/taxonomy/taxonomy.module	11 May 2010 10:19:04 -0000	1.414.2.14
+++ modules/taxonomy/taxonomy.module	14 Jun 2010 19:05:05 -0000
@@ -194,6 +194,27 @@ function taxonomy_menu() {
   return $items;
 }
 
+/**
+ * Create or update taxonomy vocabulary
+ *
+ * Update: set vid & name
+ * Delete: set vid, do not set name
+ * Insert: do not set vid
+ *
+ * @param array $edit
+ *   vid => (optional) Vocabulary ID
+ *   name => (optional) Vocabulary Name
+ *   multiple => Allows posts to have more than one term from this vocabulary
+ *   required => At least one term must be selected when submitting a post
+ *   hierarchy => 1 if terms have parrents, 0 if not
+ *   relations => 1
+ *   module => Name of module that created this vocabulary. Ususally taxonomy
+ *   weight => Vocabularies are displayed in ascending order by weight
+ *   nodes => array(term_name => boolean)
+ *
+ * @return $status
+ *   SAVED_UPDATED, SAVED_DELETED or SAVED_NEW
+ */
 function taxonomy_save_vocabulary(&$edit) {
   $edit['nodes'] = empty($edit['nodes']) ? array() : $edit['nodes'];
 
@@ -201,6 +222,8 @@ function taxonomy_save_vocabulary(&$edit
     $edit['module'] = 'taxonomy';
   }
 
+  module_invoke_all('taxonomy', 'presave', 'vocabulary', $edit);
+
   if (!empty($edit['vid']) && !empty($edit['name'])) {
     drupal_write_record('vocabulary', $edit, 'vid');
     db_query("DELETE FROM {vocabulary_node_types} WHERE vid = %d", $edit['vid']);
@@ -296,9 +319,20 @@ function taxonomy_check_vocabulary_hiera
 /**
  * Helper function for taxonomy_form_term_submit().
  *
- * @param $form_state['values']
+ * Update: set tid & name
+ * Delete: set tid, do not set name
+ * Insert: do not set tid
+ *
+ * @param array $form_values
+ *   vid => Vocabulary ID
+ *   name => (optional) Term Name
+ *   synonyms => (optional) Synonyms of this term. Use \n for mutiple terms.
+ *   parent => (optional) Term ID of perent term
+ *   relations => (optional) array(tid, tid) Related Term IDs
+ *   tid => (optional) This Term ID
  * @return
- *   Status constant indicating if term was inserted or updated.
+ *   Status constant indicating if term was updated, deleted or inserted.
+ *   SAVED_UPDATED, SAVED_DELETED or SAVED_NEW
  */
 function taxonomy_save_term(&$form_values) {
   $form_values += array(
@@ -306,6 +340,8 @@ function taxonomy_save_term(&$form_value
     'weight' => 0
   );
 
+  module_invoke_all('taxonomy', 'presave', 'term', $form_values);
+
   if (!empty($form_values['tid']) && $form_values['name']) {
     drupal_write_record('term_data', $form_values, 'tid');
     $hook = 'update';
