You are here

function search_box in Drupal 4

Same name and namespace in other branches
  1. 5 modules/search/search.module \search_box()
  2. 6 modules/search/search.module \search_box()
  3. 7 modules/search/search.module \search_box()

Output a search form for the search block and the theme's search box.

Related topics

2 calls to search_box()
phptemplate_page in themes/engines/phptemplate/phptemplate.engine
Prepare the values passed to the theme_page function to be passed into a pluggable template engine.
search_block in modules/search.module
Implementation of hook_block().

File

modules/search.module, line 1028
Enables site-wide keyword searching.

Code

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' => 15,
    '#default_value' => '',
    '#attributes' => array(
      'title' => t('Enter the terms you wish to search for.'),
    ),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Search'),
  );

  // Always go to the search page since the search form is not guaranteed to be
  // on every page.
  $form['#action'] = url('search/node');
  return drupal_get_form($form_id, $form, 'search_box_form');
}