You are here

function nodereference_allowed_values in Content Construction Kit (CCK) 6

Same name and namespace in other branches
  1. 6.3 modules/nodereference/nodereference.module \nodereference_allowed_values()
  2. 6.2 modules/nodereference/nodereference.module \nodereference_allowed_values()

Implementation of hook_allowed_values().

File

modules/nodereference/nodereference.module, line 520
Defines a field type for referencing one node from another.

Code

function nodereference_allowed_values($field) {
  $options = _nodereference_potential_references($field, TRUE);
  foreach ($options as $key => $value) {
    $options[$key] = _nodereference_item($field, $value);
  }
  if (!$field['required']) {
    $options = array(
      0 => '<' . t('none') . '>',
    ) + $options;
  }
  return $options;
}