Index: webform_components.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/Attic/webform_components.inc,v
retrieving revision 1.9.2.29
diff -u -p -r1.9.2.29 webform_components.inc
--- webform_components.inc	3 Jun 2009 19:47:15 -0000	1.9.2.29
+++ webform_components.inc	29 Sep 2009 18:06:11 -0000
@@ -506,6 +506,14 @@ function webform_component_insert($compo
   $component['mandatory'] = isset($component['mandatory']) ? $component['mandatory'] : 0;
   db_query("INSERT INTO {webform_component} (nid, cid, pid, form_key, name, type, value, extra, mandatory, weight, email) VALUES (%d, %d, %d, '%s', '%s', '%s', '%s', '%s', %d, %d, %d)", $component['nid'], $component['cid'], $component['pid'], $component['form_key'], $component['name'], $component['type'], $component['value'], serialize($component['extra']), $component['mandatory'], $component['weight'], $component['email']);
   db_unlock_tables('webform_component');
+  
+  // hook_webform_component_insert($node, $component)
+  // Add a hook to allow other module tap into the submit process.
+  foreach (module_implements('webform_component_insert') as $name) {
+    $function = $name .'_webform_component_insert';
+    $function($component);
+  }
+
   return $component['cid'];
 }
 
@@ -519,7 +527,17 @@ function webform_component_insert($compo
 function webform_component_update($component) {
   $component['value'] = isset($component['value']) ? $component['value'] : NULL;
   $component['mandatory'] = isset($component['mandatory']) ? $component['mandatory'] : 0;
-  return db_query("UPDATE {webform_component} SET pid = %d, form_key = '%s', name = '%s', type = '%s', value = '%s', extra = '%s', mandatory = %d, weight = %d, email = %d WHERE nid = %d AND cid = %d", $component['pid'], $component['form_key'], $component['name'], $component['type'], $component['value'], serialize($component['extra']), $component['mandatory'], $component['weight'], $component['email'], $component['nid'], $component['cid']);
+  $return = db_query("UPDATE {webform_component} SET pid = %d, form_key = '%s', name = '%s', type = '%s', value = '%s', extra = '%s', mandatory = %d, weight = %d, email = %d WHERE nid = %d AND cid = %d", $component['pid'], $component['form_key'], $component['name'], $component['type'], $component['value'], serialize($component['extra']), $component['mandatory'], $component['weight'], $component['email'], $component['nid'], $component['cid']);
+  
+  // hook_webform_component_update($component)
+  // Add a hook to allow other module tap into the CRUD process.
+  foreach (module_implements('webform_component_update') as $name) {
+    $function = $name .'_webform_component_update';
+    $function($component);
+  }
+  
+  // Return the message from the database UPDATE statement.
+  return $return;
 }
 
 function webform_component_delete($node, $component) {
@@ -546,6 +564,13 @@ function webform_component_delete($node,
     $component = $node->webform['components'][$row->cid];
     webform_component_delete($node, $component);
   }
+  
+  // hook_webform_component_delete($component)
+  // Add a hook to allow other module tap into the CRUD process.
+  foreach (module_implements('webform_component_delete') as $name) {
+    $function = $name .'_webform_component_delete';
+    $function($component);
+  }
 }
 
 /**
