You are here

function term_search_search_admin in Term Search 7

Implements hook_search_admin().

File

./term_search.module, line 37
Functions to index and search taxonomy terms.

Code

function term_search_search_admin() {

  // Generate options array from available vocabularies.
  $options = $default = array();
  $vocabularies = taxonomy_get_vocabularies();
  foreach ($vocabularies as $vid => $vocabulary) {
    $options[$vid] = check_plain($vocabulary->name);
  }

  // If the user has never saved which vocabularies to index, get the default.
  $default = variable_get('term_search_indexed_vocabularies', _term_search_default_vids());
  $form['term_search_fieldset'] = array(
    '#type' => 'fieldset',
    '#title' => t('Indexed Vocabularies'),
    '#description' => '<em>' . t('Choose which vocabularies should be indexed for search.') . '</em>',
  );
  $form['term_search_fieldset']['term_search_indexed_vocabularies'] = array(
    '#type' => 'checkboxes',
    '#options' => $options,
    '#default_value' => $default,
  );
  return $form;
}