You are here

function physical_dimension_unit_options in Physical Fields 7

Returns an options array of dimension 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_dimension_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().

File

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

Code

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