You are here

function units_default_enabled in Units of Measurement 7.2

Same name and namespace in other branches
  1. 7 units_default/units_default.module \units_default_enabled()

Retrieve all enabled default units.

Return value

array Array of the information about all enabled default units. The array will only include the enabled units. Keys of this array are machine names of enabled measures, whereas values will be arrays with the following structure:

  • units: (array) Array of units enabled within this measure. Its keys and values both will be machine names of enabled units
3 calls to units_default_enabled()
units_default_default_units_measure in units_default/units_default.module
Implements hook_default_units_measure().
units_default_default_units_unit in units_default/units_default.module
Implements hook_default_units_unit().
units_default_form in units_default/units_default.pages.inc
Form to manage default units and measures.

File

units_default/units_default.module, line 661
Create common units and measures such as length, volume, weight, etc.

Code

function units_default_enabled() {
  return variable_get('units_default_enabled', array(
    'length' => array(
      'measure' => 'length',
      'units' => array(
        'meter' => 'meter',
        'foot' => 'foot',
        'centimeter' => 'centimeter',
        'inch' => 'inch',
      ),
    ),
  ));
}