You are here

function tzfield_options in Time Zone Field 6

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.

3 calls to tzfield_options()
tzfield_data2form in ./tzfield.module
Helper function to transpose the values as stored in the database to the format the widget needs. Can be called anywhere this transformation is needed.
tzfield_form2data in ./tzfield.module
Helper function to transpose the values returned by submitting the widget to the format to be stored in the field. Can be called anywhere this transformation is needed.
tzfield_select_process in ./tzfield.module
Process an individual select element.

File

./tzfield.module, line 432
Defines a field type for storing timezones.

Code

function tzfield_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 selects
  if (!$field['required']) {
    if ($field['widget']['type'] == 'tzfield_select') {
      $options = array(
        '' => theme('tzfield_none', $field),
      ) + $options;
    }
  }
  return $options;
}