You are here

function conditional_fields_forms in Conditional Fields 7.3

Implements hook_forms().

Maps all dependency add forms to the same callback.

File

./conditional_fields.module, line 188
Define dependencies between fields based on their states and values.

Code

function conditional_fields_forms() {
  foreach (entity_get_info() as $entity_type => $entity_info) {
    if ($entity_info['fieldable']) {
      foreach ($entity_info['bundles'] as $bundle_name => $bundle_info) {
        $forms['conditional_fields_dependency_add_form_' . $entity_type . '_' . $bundle_name] = array(
          'callback' => 'conditional_fields_dependency_add_form',
          'callback arguments' => array(
            $entity_type,
            $bundle_name,
          ),
        );
      }
    }
  }
  return $forms;
}