function _units_default_default_units_measure in Units of Measurement 7
Same name and namespace in other branches
- 7.2 units_default/units_default.module \_units_default_default_units_measure()
Generate all default unit measures this module can provide.
2 calls to _units_default_default_units_measure()
- units_default_default_units_measure in units_default/
units_default.module - Implements hook_default_units_measure().
- units_default_form in units_default/
units_default.pages.inc - Form to manage default units and measures.
File
- units_default/
units_default.module, line 68 - Create common units and measures such as length, volume, weight, etc.
Code
function _units_default_default_units_measure() {
$items = array();
$controller = entity_get_controller('units_measure');
$items['length'] = $controller
->create(array(
'measure' => 'length',
'label' => 'Length',
'description' => '',
'converter' => 'linear',
));
$items['volume'] = $controller
->create(array(
'measure' => 'volume',
'label' => 'Volume',
'description' => '',
'converter' => 'linear',
));
$items['weight'] = $controller
->create(array(
'measure' => 'weight',
'label' => 'Weight',
'description' => '',
'converter' => 'linear',
));
$items['area'] = $controller
->create(array(
'measure' => 'area',
'label' => 'Area',
'description' => '',
'converter' => 'linear',
));
$items['pressure'] = $controller
->create(array(
'measure' => 'pressure',
'label' => 'Pressure',
'description' => '',
'converter' => 'linear',
));
$items['time'] = $controller
->create(array(
'measure' => 'time',
'label' => 'Time',
'description' => '',
'converter' => 'linear',
));
$items['temperature'] = $controller
->create(array(
'measure' => 'temperature',
'label' => 'Temperature',
'description' => '',
'converter' => 'temperature',
));
return $items;
}