From ff34411675a767f5e7a7fd43d1a013546574cb29 Mon Sep 17 00:00:00 2001 From: Neil Drumm Date: Tue, 19 Dec 2006 09:44:53 +0000 Subject: #102040 by Jose A Reyero. Clean up search menu items, fixing .../search/user under certain permissions. --- modules/search/search.module | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'modules') diff --git a/modules/search/search.module b/modules/search/search.module index a19d62711..70cd29d4d 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -142,8 +142,8 @@ function search_menu($may_cache) { if ($may_cache) { $items[] = array('path' => 'search', 'title' => t('Search'), - 'callback' => 'drupal_get_form', - 'callback arguments' => array('search_view'), + 'callback' => 'search_view', + 'callback arguments' => array('node'), 'access' => user_access('search content'), 'type' => MENU_SUGGESTED_ITEM); $items[] = array('path' => 'admin/settings/search', @@ -173,6 +173,7 @@ function search_menu($may_cache) { if (module_hook($name, 'search') && $title = module_invoke($name, 'search', 'name')) { $items[] = array('path' => 'search/'. $name . $keys, 'title' => $title, 'callback' => 'search_view', + 'callback arguments' => array($name), 'access' => user_access('search content'), 'type' => MENU_LOCAL_TASK); } @@ -890,9 +891,7 @@ function search_get_keys() { /** * Menu callback; presents the search form and/or search results. */ -function search_view() { - $type = arg(1); - +function search_view($type = '') { // Search form submits with POST but redirects to GET. This way we can keep // the search query URL clean as a whistle: // search/type/keyword+keyword -- cgit v1.2.3