search_menu

Versions
4.6 – 5
search_menu($may_cache)
6 – 7
search_menu()

Implement hook_menu().

Code

modules/search/search.module, line 182

<?php
function search_menu() {
  $items['search'] = array(
    'title' => 'Search',
    'page callback' => 'search_view',
    'access arguments' => array('search content'),
    'type' => MENU_SUGGESTED_ITEM,
    'file' => 'search.pages.inc',
  );
  $items['admin/config/search/settings'] = array(
    'title' => 'Search settings',
    'description' => 'Configure relevance settings for search and other indexing options',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('search_admin_settings'),
    'access arguments' => array('administer search'),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'search.admin.inc',
  );
  $items['admin/config/search/settings/reindex'] = array(
    'title' => 'Clear index',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('search_reindex_confirm'),
    'access arguments' => array('administer search'),
    'type' => MENU_CALLBACK,
    'file' => 'search.admin.inc',
  );
  $items['admin/reports/search'] = array(
    'title' => 'Top search phrases',
    'description' => 'View most popular search phrases.',
    'page callback' => 'dblog_top',
    'page arguments' => array('search'),
    'access arguments' => array('access site reports'),
    'file path' => drupal_get_path('module', 'dblog'),
    'file' => 'dblog.admin.inc',
  );
  drupal_static_reset('search_get_info');
  $search_hooks = search_get_info();
  foreach(variable_get('search_active_modules', array('node', 'user')) as $module) {
    if (isset($search_hooks[$module])) {
      $items['search/' . $search_hooks[$module]['path'] . '/%menu_tail'] = array(
        'title' => $search_hooks[$module]['title'],
        'page callback' => 'search_view',
        'page arguments' => array($module),
        'access callback' => '_search_menu_access',
        'access arguments' => array($module),
        'type' => MENU_LOCAL_TASK,
        'file' => 'search.pages.inc',
      );
    }
  }
  return $items;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.