You are here

function conditional_fields_available_fields_default_values in Conditional Fields 6

Same name and namespace in other branches
  1. 6.2 conditional_fields.module \conditional_fields_available_fields_default_values()

Load default values from conditional_fields table.

1 call to conditional_fields_available_fields_default_values()
conditional_fields_content_admin_field_controllable in ./conditional_fields.module
Controllable field settings form

File

./conditional_fields.module, line 924
Content fields and groups visibility based on the values of user defined 'trigger' fields.

Code

function conditional_fields_available_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;
}