You are here

function recipe_unit_name in Recipe 6

Same name and namespace in other branches
  1. 5 recipe.module \recipe_unit_name()

Converts a recipe unit ID to it's name

3 calls to recipe_unit_name()
format_mastercook4_ingredient in plugins/recipe_mastercook4.module
format_plaintext_ingredients in plugins/recipe_plaintext.module
theme_recipe_ingredients in ./recipe.module

File

./recipe.module, line 1148
recipe.module - share recipes

Code

function recipe_unit_name($unit_id) {
  static $unit_names;
  if (!$unit_names) {
    $rs = db_query("SELECT id, name FROM {recipe_unit}");
    while ($unit = db_fetch_object($rs)) {
      $unit_names[$unit->id] = $unit->name;
    }
  }
  return $unit_names[$unit_id];
}