You are here

function webform_validation_get_node_rules in Webform Validation 6

Same name and namespace in other branches
  1. 7 webform_validation.rules.inc \webform_validation_get_node_rules()

Get an array of rules assigned to a webform node

4 calls to webform_validation_get_node_rules()
webform_validation_get_webform_rules in ./webform_validation.admin.inc
Get the list of rules associated with the webform
webform_validation_nodeapi in ./webform_validation.module
Implementation of hook_nodeapi().
webform_validation_node_clone in ./webform_validation.module
Adds support for node_clone module
webform_validation_validate in ./webform_validation.module
Webform validation handler to validate against the given rules

File

./webform_validation.rules.inc, line 22
provides API and management functions for the webform validation rules

Code

function webform_validation_get_node_rules($nid) {
  $rules = array();
  $result = db_query("SELECT ruleid, rulename, nid, validator, data, error_message FROM {webform_validation_rule} WHERE nid = %d ORDER BY ruleid DESC", $nid);
  while ($rule = db_fetch_array($result)) {
    $rule['components'] = webform_validation_get_rule_components($rule['ruleid'], $rule['nid']);
    $rules[$rule['ruleid']] = $rule;
  }
  return $rules;
}