function top_searches_admin_form in Top Searches 5
Same name and namespace in other branches
- 6 top_searches.admin.inc \top_searches_admin_form()
- 7 top_searches.admin.inc \top_searches_admin_form()
Admin UI. Allow to limit number of items in the results list and allow to clear the results
1 string reference to 'top_searches_admin_form'
- top_searches_menu in ./
top_searches.module - Implementation of hook_menu().
File
- ./
top_searches.module, line 32
Code
function top_searches_admin_form() {
$form = array();
$op = isset($_POST['op']) ? $_POST['op'] : '';
// In case we need to clear the DB table, redirect:
if ($op == t('Reset search counters')) {
drupal_goto('admin/settings/top_searches/clear');
}
$form['top_searches']['top_searches_block_items'] = array(
'#type' => 'textfield',
'#maxlength' => 2,
'#size' => 2,
'#title' => t('Maximum number of items to show in Top searches block'),
'#default_value' => variable_get('top_searches_block_items', 50),
);
$form['clear_searches'] = array(
'#type' => 'button',
'#value' => t('Reset search counters'),
'#description' => top_searches_count_rows() . ' values',
);
return system_settings_form($form);
}