You are here

function physical_volume_unit_options in Physical Fields 7

Returns an options array of volume units of measurement.

Parameters

$name: Boolean indicating whether or not the value should be the human readable name of the unit of measurement instead of the abbreviation.

2 calls to physical_volume_unit_options()
physical_field_widget_form in ./physical.module
Implements hook_field_widget_form().
physical_field_widget_settings_form in ./physical.module
Implements hook_field_widget_settings_form().
1 string reference to 'physical_volume_unit_options'
physical_volume_field_data_property_info in ./physical.module
Defines info for the properties of the volume field data structure.

File

./physical.module, line 703
Defines fields (e.g. weight and dimensions) to support describing the physical attributes of entities.

Code

function physical_volume_unit_options($name = TRUE) {
  $options = array();
  foreach (physical_volume_units() as $key => $value) {
    $options[$key] = $name ? $value['name'] : $value['abbreviation'];
  }
  return $options;
}