You are here

function search_api_autocomplete_menu in Search API Autocomplete 7

Implements hook_menu().

File

./search_api_autocomplete.module, line 63
Adds autocomplete capabilities for Search API searches.

Code

function search_api_autocomplete_menu() {

  // Autocompletion path
  $items['search_api_autocomplete/%search_api_autocomplete_search'] = array(
    'title' => 'Search API autocomplete',
    'page callback' => 'search_api_autocomplete_autocomplete',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'search_api_autocomplete_access',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'search_api_autocomplete.pages.inc',
  );

  // Admin UI
  $items['admin/config/search/search_api/index/%search_api_index/autocomplete'] = array(
    'title' => 'Autocomplete',
    'description' => 'Add autocompletion to searches for this index.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'search_api_autocomplete_admin_overview',
      5,
    ),
    'access arguments' => array(
      'administer search_api',
    ),
    'weight' => -1,
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_INLINE | MENU_CONTEXT_PAGE,
    'file' => 'search_api_autocomplete.admin.inc',
  );
  $items['admin/config/search/search_api/index/%/autocomplete/%search_api_autocomplete_search/edit'] = array(
    'title' => 'Edit autocompletion settings',
    'description' => 'Edit the autocompletion settings of a search.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'search_api_autocomplete_admin_search_edit',
      7,
    ),
    'access arguments' => array(
      'administer search_api',
    ),
    'file' => 'search_api_autocomplete.admin.inc',
  );
  $items['admin/config/search/search_api/index/%/autocomplete/%search_api_autocomplete_search/delete'] = array(
    'title' => 'Delete autocompletion settings',
    'description' => 'Delete the autocompletion settings of a search.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'search_api_autocomplete_admin_search_delete',
      7,
    ),
    'access arguments' => array(
      'administer search_api',
    ),
    'file' => 'search_api_autocomplete.admin.inc',
  );
  return $items;
}