You are here

function get_default_units in Recipe 6

Get an array of the default unit values. Used to fill the recipe_unit table.

2 calls to get_default_units()
recipe_populate_units in ./recipe.install
Load the recipe_units table.
recipe_update_6101 in ./recipe.install
Adds aliases column to recipe_unit

File

./recipe.install, line 341
Install, update and uninstall functions for the recipe module.

Code

function get_default_units() {
  $units = array(
    array(
      'name' => 'Slice',
      'abbreviation' => 'sli',
      'metric' => 0,
      'type' => 'Unit',
      'aliases' => '',
    ),
    array(
      'name' => 'Unit',
      'abbreviation' => '',
      'metric' => 0,
      'type' => 'Unit',
      'aliases' => 'each,ea,whole',
    ),
    array(
      'name' => 'Clove',
      'abbreviation' => 'clv',
      'metric' => 0,
      'type' => 'Unit',
      'aliases' => '',
    ),
    array(
      'name' => 'Pinch',
      'abbreviation' => 'pn',
      'metric' => 0,
      'type' => 'Unit',
      'aliases' => '',
    ),
    array(
      'name' => 'Package',
      'abbreviation' => 'pk',
      'metric' => 0,
      'type' => 'Unit',
      'aliases' => 'pack',
    ),
    array(
      'name' => 'Can',
      'abbreviation' => 'cn',
      'metric' => 0,
      'type' => 'Unit',
      'aliases' => 'jar',
    ),
    array(
      'name' => 'Drop',
      'abbreviation' => 'dr',
      'metric' => 0,
      'type' => 'Unit',
      'aliases' => '',
    ),
    array(
      'name' => 'Bunch',
      'abbreviation' => 'bn',
      'metric' => 0,
      'type' => 'Unit',
      'aliases' => '',
    ),
    array(
      'name' => 'Dash',
      'abbreviation' => 'ds',
      'metric' => 0,
      'type' => 'Unit',
      'aliases' => '',
    ),
    array(
      'name' => 'Carton',
      'abbreviation' => 'ct',
      'metric' => 0,
      'type' => 'Unit',
      'aliases' => '',
    ),
    array(
      'name' => 'Cup',
      'abbreviation' => 'c',
      'metric' => 0,
      'type' => 'Volume',
      'aliases' => '',
    ),
    array(
      'name' => 'Tablespoon',
      'abbreviation' => 'T',
      'metric' => 0,
      'type' => 'Volume',
      'aliases' => 'tbsp,tb',
    ),
    array(
      'name' => 'Teaspoon',
      'abbreviation' => 't',
      'metric' => 0,
      'type' => 'Volume',
      'aliases' => 'tsp',
    ),
    array(
      'name' => 'Pound',
      'abbreviation' => 'lb',
      'metric' => 0,
      'type' => 'Mass',
      'aliases' => '',
    ),
    array(
      'name' => 'Ounce',
      'abbreviation' => 'oz',
      'metric' => 0,
      'type' => 'Mass',
      'aliases' => '',
    ),
    array(
      'name' => 'Pint',
      'abbreviation' => 'pt',
      'metric' => 0,
      'type' => 'Volume',
      'aliases' => '',
    ),
    array(
      'name' => 'Quart',
      'abbreviation' => 'q',
      'metric' => 0,
      'type' => 'Volume',
      'aliases' => '',
    ),
    array(
      'name' => 'Gallon',
      'abbreviation' => 'gal',
      'metric' => 0,
      'type' => 'Volume',
      'aliases' => '',
    ),
    array(
      'name' => 'Milligram',
      'abbreviation' => 'mg',
      'metric' => 1,
      'type' => 'Mass',
      'aliases' => '',
    ),
    array(
      'name' => 'Centigram',
      'abbreviation' => 'cg',
      'metric' => 1,
      'type' => 'Mass',
      'aliases' => '',
    ),
    array(
      'name' => 'Gram',
      'abbreviation' => 'g',
      'metric' => 1,
      'type' => 'Mass',
      'aliases' => '',
    ),
    array(
      'name' => 'Kilogram',
      'abbreviation' => 'kg',
      'metric' => 1,
      'type' => 'Mass',
      'aliases' => '',
    ),
    array(
      'name' => 'Millilitre',
      'abbreviation' => 'ml',
      'metric' => 1,
      'type' => 'Volume',
      'aliases' => '',
    ),
    array(
      'name' => 'Centilitre',
      'abbreviation' => 'cl',
      'metric' => 1,
      'type' => 'Volume',
      'aliases' => '',
    ),
    array(
      'name' => 'Litre',
      'abbreviation' => 'l',
      'metric' => 1,
      'type' => 'Volume',
      'aliases' => '',
    ),
    array(
      'name' => 'Decilitre',
      'abbreviation' => 'dl',
      'metric' => 1,
      'type' => 'Volume',
      'aliases' => '',
    ),
    array(
      'name' => 'Tablespoon (Metric)',
      'abbreviation' => 'tbsp',
      'metric' => 1,
      'type' => 'Volume',
      'aliases' => 'T',
    ),
    array(
      'name' => 'Teaspoon (Metric)',
      'abbreviation' => 'tsp',
      'metric' => 1,
      'type' => 'Volume',
      'aliases' => 't',
    ),
    array(
      'name' => 'Unknown',
      'abbreviation' => 'Unknown',
      'metric' => 0,
      'type' => 'Unit',
      'aliases' => '',
    ),
  );
  return $units;
}