You are here

function conditional_fields_default_values in Conditional Fields 5

Load default values from conditional_fields table.

1 call to conditional_fields_default_values()
_conditional_fields_build_form in ./conditional_fields.module
This adds conditional fields settings in the field and fieldgroup editing forms. Valid choices for $op are 'field' and 'group'

File

./conditional_fields.module, line 747

Code

function conditional_fields_default_values($control_field, $conditional_fields) {
  foreach ($conditional_fields as $field) {
    $query = db_query("SELECT trigger_values FROM {conditional_fields} WHERE control_field_name = '%s' AND field_name = '%s' AND type = '%s'", $field['field_name'], $control_field, $field['type_name']);
    $default_values[$field['field_name']] = unserialize(db_result($query));
  }
  return $default_values;
}