function physical_weight_unit_options in Physical Fields 7
Returns an options array of weight 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_weight_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_weight_unit_options'
- physical_weight_field_data_property_info in ./
physical.module - Defines info for the properties of the Weight field data structure.
File
- ./
physical.module, line 720 - Defines fields (e.g. weight and dimensions) to support describing the physical attributes of entities.
Code
function physical_weight_unit_options($name = TRUE) {
$options = array();
foreach (physical_weight_units() as $key => $value) {
$options[$key] = $name ? $value['name'] : $value['abbreviation'];
}
return $options;
}