You are here

function activesearch_menu in Javascript Tools 5

Implementation of hook_menu().

File

activesearch/activesearch.module, line 6

Code

function activesearch_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/settings/activesearch',
      'title' => t('Active search'),
      'description' => t('Configuration for active searching'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'activesearch_admin_settings',
      ),
    );
  }
  elseif (user_access('search via ajax') && activesearch_supported_browser()) {
    if (arg(0) == 'search' && arg(1) == 'node' && arg(2)) {
      $q = $_GET;
      $querystring = array();
      unset($q['q']);
      foreach ($q as $key => $value) {
        if ($key != 'q') {
          $querystring[] = $key . '=' . $value;
        }
      }
      drupal_goto('search/node', !empty($querystring) ? implode('&', $querystring) : NULL, 'keys=' . arg(2));
    }
    activesearch_load();
  }
  return $items;
}