You are here

function apachesolr_search_menu_alter in Apache Solr Search 6

Same name and namespace in other branches
  1. 8 apachesolr_search.module \apachesolr_search_menu_alter()
  2. 6.3 apachesolr_search.module \apachesolr_search_menu_alter()
  3. 6.2 apachesolr_search.module \apachesolr_search_menu_alter()
  4. 7 apachesolr_search.module \apachesolr_search_menu_alter()

Implementation of hook_menu_alter().

File

./apachesolr_search.module, line 60
Provides a content search implementation for node content for use with the Apache Solr search application.

Code

function apachesolr_search_menu_alter(&$menu) {
  if (isset($menu['search/apachesolr_search/%menu_tail'])) {
    $menu['search']['page callback'] = 'apachesolr_search_view';
    $menu['search/apachesolr_search/%menu_tail']['page callback'] = 'apachesolr_search_view';
  }
  if (variable_get('apachesolr_search_make_default', 0)) {
    if (isset($menu['search/node/%menu_tail'])) {

      // Hide the node search tab.
      $menu['search/node/%menu_tail']['type'] = MENU_CALLBACK;
      unset($menu['search/node/%menu_tail']['title callback'], $menu['search/node/%menu_tail']['title arguments']);
      $menu['search/node/%menu_tail']['title'] = 'Search';
    }
    if (isset($menu['search/apachesolr_search/%menu_tail'])) {

      // Alter the solr search tab
      $menu['search/apachesolr_search/%menu_tail']['weight'] = -10;
      unset($menu['search/apachesolr_search/%menu_tail']['title callback'], $menu['search/apachesolr_search/%menu_tail']['title arguments']);
      $menu['search/apachesolr_search/%menu_tail']['title'] = 'Content';
    }
  }
  if (variable_get('apachesolr_search_taxonomy_links', 0)) {
    if (isset($menu['taxonomy/term/%'])) {
      $menu['taxonomy/term/%']['module'] = 'apachesolr_search';
      $menu['taxonomy/term/%']['page callback'] = 'apachesolr_search_taxonomy_term_page';
      $menu['taxonomy/term/%']['file path'] = drupal_get_path('module', 'apachesolr_search');
      $menu['taxonomy/term/%']['file'] = 'apachesolr.taxonomy.inc';
    }
  }
}