You are here

function webform_validation_nodeapi in Webform Validation 6

Implementation of hook_nodeapi().

File

./webform_validation.module, line 331

Code

function webform_validation_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  if ($op == 'insert' && module_exists('clone')) {
    $vars = webform_validation_get_vars();
    if (in_array($node->type, $vars['webform_contenttypes'])) {
      webform_validation_node_clone($node);
    }
  }
  if ($op == 'delete') {
    $rules = webform_validation_get_node_rules($node->nid);
    if ($rules) {
      foreach (array_keys($rules) as $ruleid) {
        webform_dynamic_delete_rule($ruleid);
      }
    }
  }
}