You are here

function _units_default_default_units_measure in Units of Measurement 7.2

Same name and namespace in other branches
  1. 7 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' => '',
  ));
  $items['volume'] = $controller
    ->create(array(
    'measure' => 'volume',
    'label' => 'Volume',
    'description' => '',
  ));
  $items['weight'] = $controller
    ->create(array(
    'measure' => 'weight',
    'label' => 'Weight',
    'description' => '',
  ));
  $items['area'] = $controller
    ->create(array(
    'measure' => 'area',
    'label' => 'Area',
    'description' => '',
  ));
  $items['force'] = $controller
    ->create(array(
    'measure' => 'force',
    'label' => 'Force',
    'description' => '',
  ));
  $items['pressure'] = $controller
    ->create(array(
    'measure' => 'pressure',
    'label' => 'Pressure',
    'description' => '',
  ));
  $items['time'] = $controller
    ->create(array(
    'measure' => 'time',
    'label' => 'Time',
    'description' => '',
  ));
  $items['temperature'] = $controller
    ->create(array(
    'measure' => 'temperature',
    'label' => 'Temperature',
    'description' => '',
  ));
  return $items;
}