You are here

function nodereference_count_field_options in Nodereference Count 6

Same name and namespace in other branches
  1. 7 nodereference_count.module \nodereference_count_field_options()

Generate list of available nodereference fields to count.

Parameters

$field: the field array passed from hook_field_settings().

Return value

an array of nodereference fields that are available to count.

1 call to nodereference_count_field_options()
nodereference_count_field_settings in ./nodereference_count.module
Implementation of hook_field_settings().

File

./nodereference_count.module, line 28
Defines a field type for counting the references to a node.

Code

function nodereference_count_field_options($field) {
  $field_types = content_fields();
  $field_options = array();
  foreach ($field_types as $field_type) {
    if ($field_type['type'] == 'nodereference' && $field_type['referenceable_types'][$field['type_name']] === $field['type_name']) {
      $field_options[$field_type['field_name']] = $field_type['field_name'];
    }
  }
  return $field_options;
}