You are here

function search_data in Drupal 5

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

Perform a standard search on the given keys, and return the formatted results.

Related topics

3 calls to search_data()
node_admin_search in modules/node/node.module
search_view in modules/search/search.module
Menu callback; presents the search form and/or search results.
user_admin in modules/user/user.module

File

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

Code

function search_data($keys = NULL, $type = 'node') {
  if (isset($keys)) {
    if (module_hook($type, 'search')) {
      $results = module_invoke($type, 'search', 'search', $keys);
      if (isset($results) && is_array($results) && count($results)) {
        if (module_hook($type, 'search_page')) {
          return module_invoke($type, 'search_page', $results);
        }
        else {
          return theme('search_page', $results, $type);
        }
      }
    }
  }
}