You are here

function node_field_select_or_other_widget in Node Field 7.2

Widget for select_or_other field.

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

File

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

Code

function node_field_select_or_other_widget($node_field) {
  $options = node_field_get_options_field_options($node_field);
  $form = [
    '#type' => 'select_or_other',
    '#title' => $node_field['title'],
    '#options' => $options,
    '#default_value' => $node_field['value'],
    '#other' => isset($node_field['settings']['other_title']) ? $node_field['settings']['other_title'] : t('Other'),
    '#multiple' => FALSE,
    '#other_unknown_defaults' => 'other',
    '#other_delimiter' => FALSE,
    '#select_type' => 'select',
  ];
  return $form;
}