You are here

function top_searches_admin_form in Top Searches 6

Same name and namespace in other branches
  1. 5 top_searches.module \top_searches_admin_form()
  2. 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.admin.inc, line 11
Admin options for top_searches module

Code

function top_searches_admin_form() {
  $form = array();
  $form['stats'] = array(
    '#type' => 'markup',
    '#value' => t('There are currently @rows items in the Top Searches tables.', array(
      '@rows' => top_searches_count_rows(),
    )),
  );
  $form['top_searches_block'] = array(
    '#type' => 'fieldset',
    '#title' => t('Top Searches block configuration'),
  );
  $form['top_searches_block']['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['top_searches_block']['top_searches_show_counters'] = array(
    '#type' => 'radios',
    '#title' => t('Should counters be presented next to the items in the block?'),
    '#default_value' => variable_get('top_searches_show_counters', 0),
    '#options' => array(
      t('No'),
      t('Yes'),
    ),
  );
  $form['clear_searches'] = array(
    '#type' => 'submit',
    '#value' => t('Reset search counters'),
    '#weight' => 10,
  );
  return system_settings_form($form);
}