Commit ff344116 authored by drumm's avatar drumm
Browse files

#102040 by Jose A Reyero. Clean up search menu items, fixing .../search/user...

#102040 by Jose A Reyero. Clean up search menu items, fixing .../search/user under certain permissions.
parent 124c5aeb
...@@ -142,8 +142,8 @@ function search_menu($may_cache) { ...@@ -142,8 +142,8 @@ function search_menu($may_cache) {
if ($may_cache) { if ($may_cache) {
$items[] = array('path' => 'search', $items[] = array('path' => 'search',
'title' => t('Search'), 'title' => t('Search'),
'callback' => 'drupal_get_form', 'callback' => 'search_view',
'callback arguments' => array('search_view'), 'callback arguments' => array('node'),
'access' => user_access('search content'), 'access' => user_access('search content'),
'type' => MENU_SUGGESTED_ITEM); 'type' => MENU_SUGGESTED_ITEM);
$items[] = array('path' => 'admin/settings/search', $items[] = array('path' => 'admin/settings/search',
...@@ -173,6 +173,7 @@ function search_menu($may_cache) { ...@@ -173,6 +173,7 @@ function search_menu($may_cache) {
if (module_hook($name, 'search') && $title = module_invoke($name, 'search', 'name')) { if (module_hook($name, 'search') && $title = module_invoke($name, 'search', 'name')) {
$items[] = array('path' => 'search/'. $name . $keys, 'title' => $title, $items[] = array('path' => 'search/'. $name . $keys, 'title' => $title,
'callback' => 'search_view', 'callback' => 'search_view',
'callback arguments' => array($name),
'access' => user_access('search content'), 'access' => user_access('search content'),
'type' => MENU_LOCAL_TASK); 'type' => MENU_LOCAL_TASK);
} }
...@@ -890,9 +891,7 @@ function search_get_keys() { ...@@ -890,9 +891,7 @@ function search_get_keys() {
/** /**
* Menu callback; presents the search form and/or search results. * Menu callback; presents the search form and/or search results.
*/ */
function search_view() { function search_view($type = '') {
$type = arg(1);
// Search form submits with POST but redirects to GET. This way we can keep // Search form submits with POST but redirects to GET. This way we can keep
// the search query URL clean as a whistle: // the search query URL clean as a whistle:
// search/type/keyword+keyword // search/type/keyword+keyword
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment