You are here

public function Botcha::menu in BOTCHA Spam Prevention 7.3

Same name and namespace in other branches
  1. 6.3 controller/application/botcha.application.controller.inc \Botcha::menu()

Implements hook_menu().

Overrides IBotcha::menu

File

controller/application/botcha.application.controller.inc, line 165
Contains Botcha class.

Class

Botcha
Just a middleman for achieving purposes such as:

Code

public function menu() {
  $items = array();

  // Main configuration page of BOTCHA module.
  $items[Botcha::ADMIN_PATH] = array(
    'title' => 'BOTCHA',
    'description' => 'Administer how and where BOTCHAs are used.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'botcha_getAdminForm',
      'general',
    ),
    'access arguments' => array(
      'administer BOTCHA settings',
    ),
    'type' => MENU_NORMAL_ITEM,
  );
  $items[Botcha::ADMIN_PATH . '/general'] = array(
    'title' => 'General',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items[Botcha::ADMIN_PATH . '/form'] = array(
    'title' => 'Forms',
    'description' => 'Administer BOTCHA forms.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'botcha_getAdminForm',
      'form_list',
    ),
    'access arguments' => array(
      'administer BOTCHA settings',
    ),
    // @todo Abstract it.

    //'type' => MENU_LOCAL_TASK + MENU_NORMAL_ITEM,
    'type' => MENU_LOCAL_TASK,
  );
  $items[Botcha::ADMIN_PATH . '/form/add'] = array(
    'title' => 'Add BOTCHA protection to form',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'botcha_getAdminForm',
      'form_edit',
    ),
    'access arguments' => array(
      'administer BOTCHA settings',
    ),
    // @todo Abstract it.

    //'type' => MENU_CALLBACK,
    'type' => MENU_LOCAL_ACTION,
  );
  $items[Botcha::ADMIN_PATH . '/form/%botcha_form'] = array(
    'title' => 'BOTCHA form administration',
    'page callback' => 'drupal_get_form',
    // @todo Abstract it.

    //'page arguments' => array('botcha_getAdminForm', 'form_edit', 4),
    'page arguments' => array(
      'botcha_getAdminForm',
      'form_edit',
      5,
    ),
    'access callback' => 'botcha_form_access',
    // @todo Abstract it.

    //'access arguments' => array(4),
    'access arguments' => array(
      5,
    ),
    'type' => MENU_CALLBACK,
  );
  $items[Botcha::ADMIN_PATH . '/form/%botcha_form/edit'] = array(
    'title' => 'Edit',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => 1,
  );
  $items[Botcha::ADMIN_PATH . '/form/%botcha_form/delete'] = array(
    'title' => 'Delete',
    'page callback' => 'drupal_get_form',
    // @todo Abstract it.

    //'page arguments' => array('botcha_getAdminForm', 'form_delete', 4),
    'page arguments' => array(
      'botcha_getAdminForm',
      'form_delete',
      5,
    ),
    'access callback' => 'botcha_form_access',
    // @todo Abstract it.

    //'access arguments' => array(4),
    'access arguments' => array(
      5,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 4,
  );
  $items[Botcha::ADMIN_PATH . '/recipebook'] = array(
    'title' => 'Recipe books',
    'description' => 'Administer BOTCHA recipe books.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'botcha_getAdminForm',
      'recipebook_list',
    ),
    'access arguments' => array(
      'administer BOTCHA settings',
    ),
    // @todo Abstract it.

    //'type' => MENU_LOCAL_TASK + MENU_NORMAL_ITEM,
    'type' => MENU_LOCAL_TASK,
  );
  $items[Botcha::ADMIN_PATH . '/recipebook/add'] = array(
    'title' => 'Add recipe book',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'botcha_getAdminForm',
      'recipebook_edit',
    ),
    'access arguments' => array(
      'administer BOTCHA settings',
    ),
    // @todo Abstract it.

    //'type' => MENU_CALLBACK,
    'type' => MENU_LOCAL_ACTION,
  );
  $items[Botcha::ADMIN_PATH . '/recipebook/%botcha_recipebook'] = array(
    'title callback' => 'botcha_recipebook_title',
    // @todo Abstract it.

    //'title arguments' => array(4),
    'title arguments' => array(
      5,
    ),
    'page callback' => 'drupal_get_form',
    // @todo Abstract it.

    //'page arguments' => array('botcha_getAdminForm', 'recipebook_edit', 4),
    'page arguments' => array(
      'botcha_getAdminForm',
      'recipebook_edit',
      5,
    ),
    'access callback' => 'botcha_recipebook_access',
    // @todo Abstract it.

    //'access arguments' => array(4),
    'access arguments' => array(
      5,
    ),
    // @todo Abstract it.

    //'type' => MENU_CALLBACK,
    'type' => MENU_NORMAL_ITEM,
  );
  $items[Botcha::ADMIN_PATH . '/recipebook/%botcha_recipebook/edit'] = array(
    'title' => 'Edit',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => 1,
  );
  $items[Botcha::ADMIN_PATH . '/recipebook/%botcha_recipebook/delete'] = array(
    'title' => 'Delete',
    'page callback' => 'drupal_get_form',
    // @todo Abstract it.

    //'page arguments' => array('botcha_getAdminForm', 'recipebook_delete', 4),
    'page arguments' => array(
      'botcha_getAdminForm',
      'recipebook_delete',
      5,
    ),
    'access callback' => 'botcha_recipebook_access',
    // @todo Abstract it.

    //'access arguments' => array(4),
    'access arguments' => array(
      5,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 4,
  );
  $items[Botcha::ADMIN_PATH . '/recipe'] = array(
    'title' => 'Recipes',
    'description' => 'Administer BOTCHA recipes.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'botcha_getAdminForm',
      'recipe_list',
    ),
    'access arguments' => array(
      'administer BOTCHA settings',
    ),
    // @todo Abstract it.

    //'type' => MENU_LOCAL_TASK + MENU_NORMAL_ITEM,
    'type' => MENU_LOCAL_TASK,
  );
  return $items;
}