You are here

function units_get_units in Units of Measurement 6

Collect and return units definitions from modules.

4 calls to units_get_units()
units_admin_settings in ./units.admin.inc
Units configuration form
units_admin_settings_submit in ./units.admin.inc
Submit callback for units admin settings form.
units_get_symbol in ./units.module
Return symbol of unit
units_get_unit_names in ./units.module
Return array of unit names keyed by unit id's

File

./units.module, line 38
Units module.

Code

function units_get_units() {
  static $units;
  if (!isset($units)) {
    $units = array();
    $items = module_invoke_all('define_units');
    foreach ($items as $id => $unit) {
      $units[$id] = $unit;
    }

    // Allow other modules to alter units definitions using hook_units_alter().
    drupal_alter('units', $units);
  }
  return $units;
}