You are here

function recipe_menu in Recipe 6

Same name and namespace in other branches
  1. 5 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 457
recipe.module - share recipes

Code

function recipe_menu() {

  // Add a tab on the recipe add screen for Recipe Import.
  // Need to add 'file path' because some modules render node/add/recipe/std
  // even though they shouldn't.
  $items['node/add/recipe/std'] = array(
    'title' => 'Standard entry',
    'weight' => 0,
    'file path' => drupal_get_path('module', 'node'),
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['node/add/recipe/import'] = array(
    'title' => 'Recipe Import',
    'description' => 'Allows you to create a recipe by pasting various formats into a big text box.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'recipe_import_form',
    ),
    'access callback' => 'recipe_import_access',
    'access arguments' => array(
      'import recipes',
    ),
    'weight' => 1,
    'type' => MENU_LOCAL_TASK,
  );
  $items['recipe'] = array(
    'title' => 'Recipes',
    'page callback' => 'recipe_landing_page',
    'access arguments' => array(
      'access content',
    ),
    'file' => 'recipe.landing.page.inc',
  );
  $items['recipe/byname'] = array(
    'title' => 'By name',
    'description' => 'Find individual recipes by name.',
    'page callback' => 'recipe_name_index_page',
    'access arguments' => array(
      'access content',
    ),
    'file' => 'recipe_name_index.inc',
    'weight' => -1,
  );
  $items['recipe/bycat'] = array(
    'title' => 'By category',
    'description' => 'Find individual recipes by using the category list.',
    'page callback' => 'recipe_category_index_page',
    'access arguments' => array(
      'access content',
    ),
    'file' => 'recipe_category_index.inc',
  );
  $items['recipe/bying'] = array(
    'title' => 'By ingredient',
    'description' => 'Find individual recipes by their ingredients.',
    'page callback' => 'recipe_ingredient_index_page',
    'access arguments' => array(
      'access content',
    ),
    'file' => 'recipe_ingredient_index.inc',
  );
  $items['recipe/ingredient/autocomplete'] = array(
    'title' => 'Ingredient autocomplete',
    'page callback' => 'recipe_autocomplete_page',
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'access content',
    ),
  );
  $items['recipe/export'] = array(
    'page callback' => 'recipe_export',
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'access content',
    ),
  );

  // Admin menus below here.
  $items['admin/content/recipe'] = array(
    'title' => 'Recipes',
    'description' => 'Settings that control how the recipe module functions.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'recipe_admin_settings',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'recipe.admin.inc',
  );
  $items['admin/content/recipe/settings'] = array(
    'title' => 'Settings',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
  );
  $items['admin/content/recipe/export_multi'] = array(
    'title' => 'Bulk export',
    'description' => 'Export all recipes from this site into a supported output format.  The data is returned directly to your web browser.  You can enable output formats on the modules screen.',
    'page callback' => 'recipe_export_multi',
    'access callback' => 'recipe_export_multi_access',
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'recipe.admin.inc',
  );
  $items['admin/content/recipe/import_multi'] = array(
    'title' => 'Bulk import',
    'description' => 'Import recipes in a supported input format into this site.  The data is uploaded as a file to the server.  You can enable input formats on the modules screen.',
    'page callback' => 'recipe_import_multi',
    'access callback' => 'recipe_import_multi_access',
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'recipe.admin.inc',
  );
  $items['admin/content/recipe/recipe_index'] = array(
    'title' => 'Indexes',
    'description' => t('Configure settings for the recipe index page.'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'recipe_index_settings_form',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'recipe.admin.inc',
  );
  return $items;
}