Index: modules/search.module =================================================================== RCS file: /cvs/drupal/drupal/modules/search.module,v retrieving revision 1.170 diff -u -p -r1.170 search.module --- modules/search.module 31 Mar 2006 04:57:49 -0000 1.170 +++ modules/search.module 31 Mar 2006 09:20:16 -0000 @@ -137,8 +137,8 @@ function search_block($op = 'list', $del $blocks[0]['info'] = t('Search form'); return $blocks; } - else if ($op == 'view' && user_access('search content') && arg(0) != 'search') { - $block['content'] = search_form('', '', null, ''); + else if ($op == 'view' && user_access('search content')) { + $block['content'] = search_box('search_block_form'); $block['subject'] = t('Search'); return $block; } @@ -969,6 +969,13 @@ function search_view() { * An HTML string containing the search form. */ function search_form($action = '', $keys = '', $type = NULL, $prompt = NULL) { + static $called = FALSE; + + if ($called) { + return; + } + $called = TRUE; + if (!$action) { $action = url('search/'. $type); } @@ -1022,8 +1029,44 @@ function search_form_submit($form_id, $f return 'search/'. $type .'/'. $keys; } -function search_box_submit($form_id, $form_values) { - return 'search/node/'. trim($form_values['keys']); +/** + * Output a search form for the search block and the theme's search box. + */ +function search_box($form_id = 'search_theme_form') { + // Use search_keys instead of keys to avoid ID conflicts with the search block. + $form[$form_id .'_keys'] = array( + '#type' => 'textfield', + '#size'=> 20, + '#default_value' => '', + '#attributes' => array('alt' => t('Enter the terms you wish to search for.')), + ); + $form['submit'] = array('#type' => 'submit', '#value' => t('Search')); + // Cannot use a callback here due to theme_search_theme_form(). + return drupal_get_form($form_id, $form); +} + +/** + * Process a theme search form submission. + */ +function search_theme_form_submit($form_id, $form_values) { + return 'search/node/'. trim($form_values[$form_id .'_keys']); +} + +/** + * Process a blcok search form submission. + */ +function search_block_form_submit($form_id, $form_values) { + return 'search/node/'. trim($form_values[$form_id .'_keys']); +} + +/** + * Theme the search box form. + */ +function theme_search_theme_form($form) { + $output = ''; + return $output; } /** Index: modules/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system.module,v retrieving revision 1.301 diff -u -p -r1.301 system.module --- modules/system.module 31 Mar 2006 04:57:49 -0000 1.301 +++ modules/system.module 31 Mar 2006 09:20:25 -0000 @@ -1191,25 +1191,6 @@ function system_theme_settings($key = '' } /** - * Output a search form. - */ -function search_box($path = NULL) { - $form['keys'] = array('#type' => 'textfield', '#size'=> 15, '#default_value' => '', '#attributes' => array('alt' => t('Enter the terms you wish to search for.'))); - $form['submit'] = array('#type' => 'submit', '#value' => t('Search')); - return drupal_get_form('search_box', $form); -} - -/** - * Theme a search form. - */ -function theme_search_box($form) { - $output = ''; - return $output; -} - -/** * Output a confirmation form * * This function outputs a complete form for confirming an action. A link is Index: themes/bluemarine/style.css =================================================================== RCS file: /cvs/drupal/drupal/themes/bluemarine/style.css,v retrieving revision 1.12 diff -u -p -r1.12 style.css --- themes/bluemarine/style.css 20 Jan 2006 09:09:18 -0000 1.12 +++ themes/bluemarine/style.css 31 Mar 2006 09:20:26 -0000 @@ -112,19 +112,6 @@ table { font-weight: bold; color: #9cf; } -#search .form-text, #search .form-submit { - border: 1px solid #369; - font-size: 1.1em; -} -#search .form-text { - width: 8em; - height: 1.4em; - padding: 0 0.5em 0 0.5em; - margin: 0 0 0.5em 0; -} -#search .form-submit { - height: 1.5em; -} #mission { background-color: #369; padding: 1.5em 2em; Index: themes/pushbutton/style.css =================================================================== RCS file: /cvs/drupal/drupal/themes/pushbutton/style.css,v retrieving revision 1.13 diff -u -p -r1.13 style.css --- themes/pushbutton/style.css 20 Jan 2006 09:09:18 -0000 1.13 +++ themes/pushbutton/style.css 31 Mar 2006 09:20:28 -0000 @@ -205,19 +205,6 @@ td#home a:hover img { text-align: right; vertical-align: middle; } -#search .form-text, #search .form-submit { - border: 1px solid #369; - font-size: 0.85em; -} -#search .form-text { - width: 8em; - height: 1.4em; - padding: 0 0.5em 0 0.5em; - margin: 0 0 0.5em 0; -} -#search .form-submit { - height: 1.5em; -} #mission { background-color: #fff; color: #696969;