1 search.module | search_block_configure($delta = '', $settings = array()) |
Implements hook_block_configure().
File
- core/
modules/ search/ search.module, line 123 - Enables site-wide keyword searching.
Code
function search_block_configure($delta = '', $settings = array()) {
$form = array();
if ($delta == 'form') {
$search_settings = !empty($settings['search']) ? $settings['search'] : array();
$search_settings += array(
'label' => '',
'label_hide' => FALSE,
'placeholder' => '',
'button_text' => 'Search',
);
$form['search'] = array(
'#type' => 'fieldset',
'#title' => t('Search form settings'),
'#collapsible' => TRUE,
);
$form['search']['label'] = array(
'#type' => 'textfield',
'#title' => t('Search box label'),
'#default_value' => check_plain($search_settings['label']),
);
$form['search']['label_hide'] = array(
'#type' => 'checkbox',
'#title' => t('Hide the search box label'),
'#default_value' => $search_settings['label_hide'],
);
$form['search']['placeholder'] = array(
'#type' => 'textfield',
'#title' => t('Placeholder text'),
'#default_value' => check_plain(trim($search_settings['placeholder'])),
'#description' => t('This text will appear in the search box until text is entered.'),
);
$form['search']['button_text'] = array(
'#type' => 'textfield',
'#title' => t('Button text'),
'#default_value' => check_plain(trim($search_settings['button_text'])),
'#description' => t('Leave this field empty to hide the submit button.'),
);
}
return $form;
}