You are here

function botcha_menu in BOTCHA Spam Prevention 7.2

Same name and namespace in other branches
  1. 6 botcha.module \botcha_menu()
  2. 6.2 botcha.module \botcha_menu()
  3. 7 botcha.module \botcha_menu()

Implements hook_menu().

File

./botcha.module, line 79

Code

function botcha_menu() {
  $items = array();

  // Main configuration page of BOTCHA module.
  $items[Botcha::BOTCHA_ADMIN_PATH] = array(
    'title' => 'BOTCHA',
    'description' => 'Administer how and where BOTCHAs are used.',
    'file' => 'botcha.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'botcha_admin_settings',
    ),
    'access arguments' => array(
      'administer BOTCHA settings',
    ),
    'type' => MENU_NORMAL_ITEM,
  );
  $items[Botcha::BOTCHA_ADMIN_PATH . '/general'] = array(
    'title' => 'General',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items[Botcha::BOTCHA_ADMIN_PATH . '/form'] = array(
    'title' => 'Forms',
    'description' => 'Administer BOTCHA forms.',
    'file' => 'botcha.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'botcha_forms_form',
    ),
    'access arguments' => array(
      'administer BOTCHA settings',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  $items[Botcha::BOTCHA_ADMIN_PATH . '/form/add'] = array(
    'title' => 'Add BOTCHA protection to form',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'botcha_form_form',
    ),
    'access arguments' => array(
      'administer BOTCHA settings',
    ),
    'file' => 'botcha.admin.inc',
    'type' => MENU_LOCAL_ACTION,
  );
  $items[Botcha::BOTCHA_ADMIN_PATH . '/form/%botcha_form'] = array(
    'title' => 'BOTCHA form administration',
    'file' => 'botcha.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'botcha_form_form',
      5,
    ),
    'access callback' => 'botcha_form_access',
    'access arguments' => array(
      5,
    ),
    'type' => MENU_CALLBACK,
  );
  $items[Botcha::BOTCHA_ADMIN_PATH . '/form/%botcha_form/edit'] = array(
    'title' => 'Edit',
    //'page callback' => 'drupal_get_form',

    //'page arguments' => array('botcha_recipebook_form', 5),

    //'access arguments' => array('administer BOTCHA settings'),

    //'file' => 'botcha.admin.inc',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => 1,
  );
  $items[Botcha::BOTCHA_ADMIN_PATH . '/form/%botcha_form/delete'] = array(
    'title' => 'Delete',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'botcha_form_delete_form',
      5,
    ),
    'access callback' => 'botcha_form_access',
    'access arguments' => array(
      5,
    ),
    'file' => 'botcha.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 4,
  );
  $items[Botcha::BOTCHA_ADMIN_PATH . '/recipebook'] = array(
    'title' => 'Recipe books',
    'description' => 'Administer BOTCHA recipe books.',
    'file' => 'botcha.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'botcha_recipebooks_form',
    ),
    'access arguments' => array(
      'administer BOTCHA settings',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  $items[Botcha::BOTCHA_ADMIN_PATH . '/recipebook/add'] = array(
    'title' => 'Add recipe book',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'botcha_recipebook_form',
    ),
    'access arguments' => array(
      'administer BOTCHA settings',
    ),
    'file' => 'botcha.admin.inc',
    'type' => MENU_LOCAL_ACTION,
  );
  $items[Botcha::BOTCHA_ADMIN_PATH . '/recipebook/%botcha_recipebook'] = array(
    'title callback' => 'botcha_recipebook_title',
    'title arguments' => array(
      5,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'botcha_recipebook_form',
      5,
    ),
    'access callback' => 'botcha_recipebook_access',
    'access arguments' => array(
      5,
    ),
    'file' => 'botcha.admin.inc',
    'type' => MENU_NORMAL_ITEM,
  );
  $items[Botcha::BOTCHA_ADMIN_PATH . '/recipebook/%botcha_recipebook/edit'] = array(
    'title' => 'Edit',
    //'page callback' => 'drupal_get_form',

    //'page arguments' => array('botcha_recipebook_form', 5),

    //'access arguments' => array('administer BOTCHA settings'),

    //'file' => 'botcha.admin.inc',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => 1,
  );
  $items[Botcha::BOTCHA_ADMIN_PATH . '/recipebook/%botcha_recipebook/delete'] = array(
    'title' => 'Delete',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'botcha_recipebook_delete_form',
      5,
    ),
    'access callback' => 'botcha_recipebook_access',
    'access arguments' => array(
      5,
    ),
    'file' => 'botcha.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'weight' => 4,
  );
  $items[Botcha::BOTCHA_ADMIN_PATH . '/recipe'] = array(
    'title' => 'Recipes',
    'description' => 'Administer BOTCHA recipes.',
    'file' => 'botcha.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'botcha_recipes_form',
    ),
    'access arguments' => array(
      'administer BOTCHA settings',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  return $items;
}