You are here

function node_field_node_reference_settings in Node Field 7.2

Settings for node_reference field.

1 string reference to 'node_field_node_reference_settings'
node_field_types_info in includes/node_field.field.inc
Node field types info.

File

includes/node_field.field.inc, line 456
Field types, settings, widget and formatters.

Code

function node_field_node_reference_settings($node_field) {
  $content_types = node_type_get_types();
  foreach ($content_types as $type) {
    $options[] = $type->type;
  }
  $options = drupal_map_assoc($options);
  $form['options'] = [
    '#type' => 'select',
    '#title' => t('Allowed content types'),
    '#options' => $options,
    '#default_value' => !empty($node_field['settings']['options']) ? $node_field['settings']['options'] : NULL,
  ];
  return $form;
}