optionwidgets_options($field)
contributions/cck/modules/optionwidgets/optionwidgets.module, line 374
Helper function for finding the allowed values list for a field.
See if there is a module hook for the option values. Otherwise, try content_allowed_values() for an options list.
<?php
function optionwidgets_options($field) {
$function = $field['module'] .'_allowed_values';
$options = function_exists($function) ? $function($field) : (array) content_allowed_values($field);
// Add an empty choice for :
// - non required radios
// - non required selects
if (($field['widget']['type'] == 'optionwidgets_buttons' && !$field['required'] && !$field['multiple'])
|| (in_array($field['widget']['type'], array('optionwidgets_select', 'nodereference_select', 'nodereference_buttons', 'userreference_select', 'userreference_buttons')) && !$field['required'])) {
$options = array('' => theme('optionwidgets_none', $field)) + $options;
}
return $options;
}
?>