function custom_search_blocks_form in Custom Search 6
Same name and namespace in other branches
- 7 modules/custom_search_blocks/custom_search_blocks.module \custom_search_blocks_form()
Form builder; Output a search form for the additional search blocks.
4 string references to 'custom_search_blocks_form'
- custom_search_blocks_forms in modules/
custom_search_blocks/ custom_search_blocks.module - Implementation of hook_forms() to generate a unique form_id with the same form builder function
- custom_search_form_alter in ./
custom_search.module - Implementation of hook_form_alter().
- custom_search_i18n_form_alter in modules/
custom_search_i18n/ custom_search_i18n.module - Implementation of hook_form_alter().
- custom_search_taxonomy_form_alter in modules/
custom_search_taxonomy/ custom_search_taxonomy.module - Implementation of hook_form_alter().
File
- modules/
custom_search_blocks/ custom_search_blocks.module, line 124 - Bring additional search blocks
Code
function custom_search_blocks_form(&$form_state, $delta) {
$form['custom_search_blocks_form_' . $delta] = array(
'#type' => 'textfield',
'#size' => 15,
'#default_value' => '',
'#attributes' => array(
'title' => t('Enter the terms you wish to search for.'),
),
);
$form['delta'] = array(
'#type' => 'hidden',
'#value' => $delta,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Search'),
);
$form['#submit'][] = 'search_box_form_submit';
if (function_exists('apachesolr_autocomplete_variable_get_widget')) {
// support for apachesolr_autocomplete module
if (apachesolr_autocomplete_variable_get_widget() == 'custom') {
$form['custom_search_blocks_form_' . $delta]['#attributes']['class'] = 'apachesolr-autocomplete unprocessed';
}
else {
$form['custom_search_blocks_form_' . $delta]['#autocomplete_path'] = 'apachesolr_autocomplete';
}
}
return $form;
}