You are here

function search_service_admin in Services 6.2

Same name and namespace in other branches
  1. 7 services/search_service/search_service_admin.inc \search_service_admin()

Menu callback to set content search service settings.

1 string reference to 'search_service_admin'
search_service_menu in services/search_service/search_service.module
Implementation of hook_menu().

File

services/search_service/search_service_admin.inc, line 11
Search Service settings

Code

function search_service_admin() {

  // For each enabled module, look for hook_search
  foreach (module_list() as $name) {
    if (function_exists($name . '_search')) {
      $options[$name] = $name;
    }
  }

  // If search_service_options not initialized, then make sure that it is an array
  $default_value = variable_get('search_service_options', 'node');
  if (!is_array($default_value)) {
    $default_value = array(
      $default_value,
    );
  }
  $form['search_service_message'] = array(
    '#type' => 'markup',
    '#value' => t('Choose search hooks that return local results. Do not choose aggregated or distributed results, as this may cause recursion.'),
  );

  // Display checkboxes of list of hook_search()
  $form['search_service_options'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Search content services, returns searches results using'),
    '#options' => $options,
    '#default_value' => $default_value,
  );
  return system_settings_form($form);
}