You are here

function search_api_menu in Search API 7

Implements hook_menu().

File

./search_api.module, line 16
Provides a flexible framework for implementing search services.

Code

function search_api_menu() {
  $pre = 'admin/config/search/search_api';
  $items[$pre] = array(
    'title' => 'Search API',
    'description' => 'Create and configure search engines.',
    'page callback' => 'search_api_admin_overview',
    'access arguments' => array(
      'administer search_api',
    ),
    'file' => 'search_api.admin.inc',
  );
  $items[$pre . '/overview'] = array(
    'title' => 'Overview',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items[$pre . '/add_server'] = array(
    'title' => 'Add server',
    'description' => 'Create a new search server.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'search_api_admin_add_server',
    ),
    'access arguments' => array(
      'administer search_api',
    ),
    'file' => 'search_api.admin.inc',
    'weight' => -1,
    'type' => MENU_LOCAL_ACTION,
  );
  $items[$pre . '/add_index'] = array(
    'title' => 'Add index',
    'description' => 'Create a new search index.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'search_api_admin_add_index',
    ),
    'access arguments' => array(
      'administer search_api',
    ),
    'file' => 'search_api.admin.inc',
    'type' => MENU_LOCAL_ACTION,
  );
  $items[$pre . '/server/%search_api_server'] = array(
    'title' => 'View server',
    'title callback' => 'search_api_admin_item_title',
    'title arguments' => array(
      5,
    ),
    'description' => 'View server details.',
    'page callback' => 'search_api_admin_server_view',
    'page arguments' => array(
      5,
    ),
    'access arguments' => array(
      'administer search_api',
    ),
    'file' => 'search_api.admin.inc',
  );
  $items[$pre . '/server/%search_api_server/view'] = array(
    'title' => 'View',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items[$pre . '/server/%search_api_server/edit'] = array(
    'title' => 'Edit',
    'description' => 'Edit server details.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'search_api_admin_server_edit',
      5,
    ),
    'access arguments' => array(
      'administer search_api',
    ),
    'file' => 'search_api.admin.inc',
    'weight' => -1,
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_INLINE | MENU_CONTEXT_PAGE,
  );
  $items[$pre . '/server/%search_api_server/execute-tasks'] = array(
    'title' => 'Execute pending tasks',
    'description' => 'Attempt to process pending tasks for a given server.',
    'page callback' => 'search_api_execute_pending_tasks',
    'page arguments' => array(
      5,
    ),
    'access callback' => 'search_api_access_execute_tasks_batch',
    'access arguments' => array(
      5,
    ),
    'type' => MENU_CALLBACK,
  );
  $items[$pre . '/server/%search_api_server/disable'] = array(
    'title' => 'Disable',
    'description' => 'Disable index.',
    'page callback' => 'search_api_admin_server_view',
    'page arguments' => array(
      5,
      6,
    ),
    'access callback' => 'search_api_access_disable_page',
    'access arguments' => array(
      5,
    ),
    'file' => 'search_api.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_INLINE,
    'weight' => 8,
  );
  $items[$pre . '/server/%search_api_server/delete'] = array(
    'title' => 'Delete',
    'title callback' => 'search_api_title_delete_page',
    'title arguments' => array(
      5,
    ),
    'description' => 'Delete server.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'search_api_admin_confirm',
      'server',
      'delete',
      5,
    ),
    'access callback' => 'search_api_access_delete_page',
    'access arguments' => array(
      5,
    ),
    'file' => 'search_api.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_INLINE,
    'weight' => 10,
  );
  $items[$pre . '/execute-tasks'] = array(
    'title' => 'Execute pending tasks',
    'description' => 'Attempt to process pending server tasks.',
    'page callback' => 'search_api_execute_pending_tasks',
    'access callback' => 'search_api_access_execute_tasks_batch',
    'type' => MENU_LOCAL_ACTION,
  );
  $items[$pre . '/index/%search_api_index'] = array(
    'title' => 'View index',
    'title callback' => 'search_api_admin_item_title',
    'title arguments' => array(
      5,
    ),
    'description' => 'View index details.',
    'page callback' => 'search_api_admin_index_view',
    'page arguments' => array(
      5,
    ),
    'access arguments' => array(
      'administer search_api',
    ),
    'file' => 'search_api.admin.inc',
  );
  $items[$pre . '/index/%search_api_index/view'] = array(
    'title' => 'View',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items[$pre . '/index/%search_api_index/edit'] = array(
    'title' => 'Edit',
    'description' => 'Edit index settings.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'search_api_admin_index_edit',
      5,
    ),
    'access arguments' => array(
      'administer search_api',
    ),
    'file' => 'search_api.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_INLINE | MENU_CONTEXT_PAGE,
    'weight' => -6,
  );
  $items[$pre . '/index/%search_api_index/fields'] = array(
    'title' => 'Fields',
    'description' => 'Select indexed fields.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'search_api_admin_index_fields',
      5,
    ),
    'access arguments' => array(
      'administer search_api',
    ),
    'file' => 'search_api.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_INLINE | MENU_CONTEXT_PAGE,
    'weight' => -4,
  );
  $items[$pre . '/index/%search_api_index/workflow'] = array(
    'title' => 'Filters',
    'description' => 'Edit indexing workflow.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'search_api_admin_index_workflow',
      5,
    ),
    'access arguments' => array(
      'administer search_api',
    ),
    'file' => 'search_api.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_INLINE | MENU_CONTEXT_PAGE,
    'weight' => -2,
  );
  $items[$pre . '/index/%search_api_index/disable'] = array(
    'title' => 'Disable',
    'description' => 'Disable index.',
    'page callback' => 'search_api_admin_index_view',
    'page arguments' => array(
      5,
      6,
    ),
    'access callback' => 'search_api_access_disable_page',
    'access arguments' => array(
      5,
    ),
    'file' => 'search_api.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_INLINE,
    'weight' => 8,
  );
  $items[$pre . '/index/%search_api_index/delete'] = array(
    'title' => 'Delete',
    'title callback' => 'search_api_title_delete_page',
    'title arguments' => array(
      5,
    ),
    'description' => 'Delete index.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'search_api_admin_confirm',
      'index',
      'delete',
      5,
    ),
    'access callback' => 'search_api_access_delete_page',
    'access arguments' => array(
      5,
    ),
    'file' => 'search_api.admin.inc',
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_INLINE,
    'weight' => 10,
  );
  return $items;
}