function search_block in Drupal 6
Same name and namespace in other branches
- 4 modules/search.module \search_block()
- 5 modules/search/search.module \search_block()
Implementation of hook_block().
File
- modules/
search/ search.module, line 149 - Enables site-wide keyword searching.
Code
function search_block($op = 'list', $delta = 0) {
if ($op == 'list') {
$blocks[0]['info'] = t('Search form');
// Not worth caching.
$blocks[0]['cache'] = BLOCK_NO_CACHE;
return $blocks;
}
else {
if ($op == 'view' && user_access('search content')) {
$block['content'] = drupal_get_form('search_block_form');
$block['subject'] = t('Search');
return $block;
}
}
}