function _options_get_options

cis7 options.module _options_get_options($field, $instance, $properties, $entity_type, $entity)
cle7 options.module _options_get_options($field, $instance, $properties, $entity_type, $entity)
elmsmedia7 options.module _options_get_options($field, $instance, $properties, $entity_type, $entity)
icor7 options.module _options_get_options($field, $instance, $properties, $entity_type, $entity)
meedjum_blog7 options.module _options_get_options($field, $instance, $properties, $entity_type, $entity)
mooc7 options.module _options_get_options($field, $instance, $properties, $entity_type, $entity)

Collects the options for a field.

1 call to _options_get_options()
options_field_widget_form in modules/field/modules/options/options.module
Implements hook_field_widget_form().

File

modules/field/modules/options/options.module, line 243
Defines selection, check box and radio button widgets for text and numeric fields.

Code

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;
}