Collects the options for a field.
function _options_get_options($field, $instance, $properties, $entity_type, $entity) {
// Get the list of options.
$options = (array) module_invoke($field['module'], 'options_list', $field, $instance, $entity_type, $entity);
// Sanitize the options.
_options_prepare_options($options, $properties);
if (!$properties['optgroups']) {
$options = options_array_flatten($options);
}
if ($properties['empty_option']) {
$label = theme('options_none', array(
'instance' => $instance,
'option' => $properties['empty_option'],
));
$options = array(
'_none' => $label,
) + $options;
}
return $options;
}