You are here

function google_appliance_menu in Google Search Appliance 7

Same name and namespace in other branches
  1. 5 google_appliance.module \google_appliance_menu()
  2. 6.2 google_appliance.module \google_appliance_menu()

Implements hook_menu().

File

./google_appliance.module, line 67
Google Appliance module enables searching via a dedicated Google Search Appliance hardware device. See README.txt and the help page at admin/help/google_appliance.

Code

function google_appliance_menu() {
  $items = array();
  $settings = _google_appliance_get_settings();

  // search results page
  $parts = substr_count($settings['drupal_path'], '/');
  $items[$settings['drupal_path']] = array(
    'title' => $settings['search_title'],
    'page callback' => 'google_appliance_search_view',
    'page arguments' => array(
      ++$parts,
      ++$parts,
    ),
    // (1) search query, (2) results sort param
    'access arguments' => array(
      'access_google_appliance_content',
    ),
    'type' => MENU_SUGGESTED_ITEM,
  );

  // admin page
  $items['admin/config/search/google_appliance/settings'] = array(
    'title' => 'Google Appliance',
    'description' => 'Configure options for search via Google Search Appliance.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'google_appliance_admin_settings',
    ),
    'file' => 'google_appliance.admin.inc',
    'access arguments' => array(
      'administer_google_appliance',
    ),
    'weight' => -30,
  );
  return $items;
}