You are here

function sarnia_form_search_api_admin_index_edit_alter in Sarnia 7

Implements HOOK_form_search_api_admin_index_edit_alter(). Implements HOOK_form_FORM_ID_alter().

Disable the 'server' select box on Search API index configuration forms.

File

./sarnia.module, line 808

Code

function sarnia_form_search_api_admin_index_edit_alter(&$form, &$form_state) {
  if (($index = menu_get_object('search_api_index', 5)) && ($sarnia_type = sarnia_entity_type_load_by_index($index->machine_name))) {
    $form['server']['#disabled'] = TRUE;
    $form['server']['#description'] = t('This index uses the search server as a data source. You can not change the server on this type of index after it has been created.');
  }
}