You are here

function recipe_menu in Recipe 5

Same name and namespace in other branches
  1. 6 recipe.module \recipe_menu()
  2. 7.2 recipe.module \recipe_menu()
  3. 7 recipe.module \recipe_menu()

Implementation of hook_menu().

Note: when editing this function you must visit 'admin/menu' to reset the cache

File

./recipe.module, line 422
recipe.module - share recipes for drupal 5.x

Code

function recipe_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'node/add/recipe',
      'title' => t('Recipe'),
      'access' => user_access('create recipes'),
    );
    $items[] = array(
      'path' => 'recipe',
      'title' => t('Recipes'),
      'callback' => 'recipe_page',
      'access' => user_access('access content'),
      'type' => MENU_SUGGESTED_ITEM,
    );
    $items[] = array(
      'path' => 'recipe/ingredient/autocomplete',
      'title' => t('Ingredient autocomplete'),
      'callback' => 'recipe_autocomplete_page',
      'type' => MENU_CALLBACK,
      'access' => user_access('access content'),
    );
    $items[] = array(
      'path' => 'recipe/export',
      'callback' => 'recipe_export',
      'type' => MENU_CALLBACK,
      'access' => user_access('access content'),
    );
    $items[] = array(
      'path' => 'recipe/importolddb',
      'title' => t('import old recipes'),
      'callback' => 'recipe_import_from_46',
      'type' => MENU_SUGGESTED_ITEM,
      'access' => user_access('create recipes'),
    );
    $items[] = array(
      'path' => 'admin/settings/recipe',
      'title' => t('Recipe module'),
      'description' => t('Settings that control how the recipe module functions.'),
      'callback' => 'drupal_get_form',
      'callback arguments' => 'recipe_admin_settings',
      'access' => user_access('administer site configuration'),
      'type' => MENU_NORMAL_ITEM,
    );
  }
  return $items;
}