diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-11-29 06:35:47 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-11-29 06:35:47 +0000 |
commit | 0b978036130c871362a78dccb229ee279d856006 (patch) | |
tree | befe24b8058cd73d565abe1bf59003db167d2329 /modules/field/field.info.inc | |
parent | 4fca5a6412a4315fcc6f1071bff820d20f94ee99 (diff) | |
download | brdo-0b978036130c871362a78dccb229ee279d856006.tar.gz brdo-0b978036130c871362a78dccb229ee279d856006.tar.bz2 |
- Patch #613754 by yched, detour, matt2000: fixed field_info_fields().
Diffstat (limited to 'modules/field/field.info.inc')
-rw-r--r-- | modules/field/field.info.inc | 48 |
1 files changed, 7 insertions, 41 deletions
diff --git a/modules/field/field.info.inc b/modules/field/field.info.inc index 366a009eb..fe2af51a8 100644 --- a/modules/field/field.info.inc +++ b/modules/field/field.info.inc @@ -451,50 +451,16 @@ function field_info_bundles($obj_type = NULL) { } /** - * Return array of all field data, keyed by field name. + * Return all field efinitions. * - * @param $bundle_type - * (optional) The bundle type on which to filter the list of fields. In the - * case of nodes, this is the node type. - * @param $field - * (optional) A field array or name on which to filter the list. - * @param $field_type - * (optional) A field type on which to filter the list. * @return - * An array of Field objects. Each Field object has an additional - * property, bundles, which is an array of all the bundles to which - * this field belongs. + * An array of field definitions, keyd by field name. Each field has an + * additional property, 'bundles', which is an array of all the bundles to + * which this field belongs. */ -function field_info_fields($bundle_type = NULL, $field = NULL, $field_type = NULL) { - // Build the list of fields to be used for retrieval. - if (isset($field)) { - if (is_string($field)) { - $field = field_info_field($field); - } - $fields = array($field['field_name'] => $field); - } - elseif (isset($bundle_type)) { - $instances = field_info_instances($bundle_type); - $fields = array(); - foreach ($instances as $field_name => $instance) { - $fields[$field_name] = field_info_field($field_name); - } - } - else { - $info = _field_info_collate_fields(); - $fields = $info['fields']; - } - - // If a field type was given, filter the list down to fields of that type. - if (isset($field_type)) { - foreach ($fields as $key => $field) { - if ($field['type'] != $field_type) { - unset($fields[$key]); - } - } - } - - return $fields; +function field_info_fields() { + $info = _field_info_collate_fields(); + return $info['fields']; } /** |