You are here

function _optionwidgets_options in Content Construction Kit (CCK) 5

1 call to _optionwidgets_options()
optionwidgets_widget in ./optionwidgets.module
Implementation of hook_widget().

File

./optionwidgets.module, line 176
Defines selection, check box and radio button widgets for text and numeric fields.

Code

function _optionwidgets_options($field, $node) {
  $types = _content_field_types();
  $field_allowed_values = $types[$field['type']]['module'] . '_allowed_values';
  if (function_exists($field_allowed_values)) {
    $allowed_values = $field_allowed_values($field);
  }
  else {
    $allowed_values = array();
  }
  if ($field['widget']['type'] == 'options_select' || $field['widget']['type'] == 'options_buttons' && !$field['multiple']) {
    if (!$field['required']) {
      $allowed_values = array(
        '' => theme('optionwidgets_none', $field['widget']['type'], $field['field_name'], $node->type),
      ) + $allowed_values;
    }
  }
  return $allowed_values;
}