search_data

Versions
4.6 – 7
search_data($keys = NULL, $type = 'node')

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

Related topics

▾ 3 functions call search_data()

node_admin in modules/node.module
Menu callback; presents the content administration overview.
search_view in modules/search.module
Menu callback; presents the search form and/or search results.
user_admin in modules/user.module

Code

modules/search.module, line 677

<?php
function search_data($keys = NULL, $type = 'node') {
  $output = '';

  if (isset($keys)) {
    if (module_hook($type, 'search')) {
      $results = module_invoke($type, 'search', 'search', $keys);
      if (is_array($results) && count($results)) {
        $output .= '<dl class="search-results">';
        foreach ($results as $entry) {
          $output .= theme('search_item', $entry, $type);
        }
        $output .= '</dl>';
        $output .= theme('pager', NULL, 15, 0);
      }
    }
  }

  return $output;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.