You are here

function acquia_search_form_apachesolr_settings_alter in Acquia Search 6.3

Same name and namespace in other branches
  1. 6 acquia_search.module \acquia_search_form_apachesolr_settings_alter()

Implementation of hook_form_[form_id]_alter().

File

./acquia_search.module, line 196
Integration between Acquia Drupal and Acquia's hosted solr search service.

Code

function acquia_search_form_apachesolr_settings_alter(&$form, $form_state) {

  // Don't alter the form if there is no subscription.
  if (acquia_agent_subscription_is_active()) {

    // Don't show delete operation for the Default AS environment. This means
    // that cloned acquia search environments can be deleted
    $delete_link = '<a href="/admin/settings/apachesolr/settings/' . ACQUIA_SEARCH_ENVIRONMENT_ID . '/delete">Delete</a>';
    $form['apachesolr_host_settings']['table']['#value'] = str_replace($delete_link, '', $form['apachesolr_host_settings']['table']['#value']);
    $form['advanced']['acquia_search_edismax_default'] = array(
      '#type' => 'radios',
      '#title' => t('Always allow advanced syntax for Acquia Search'),
      '#default_value' => variable_get('acquia_search_edismax_default', 0),
      '#options' => array(
        0 => t('Disabled'),
        1 => t('Enabled'),
      ),
      '#description' => t('If enabled, all Acquia Search keyword searches may use advanced <a href="@url">Lucene syntax</a> such as wildcard searches, fuzzy searches, proximity searches, boolean operators and more via the Extended Dismax parser. If not enabled, this syntax wll only be used when needed to enable wildcard searches.', array(
        '@url' => 'http://lucene.apache.org/java/2_9_3/queryparsersyntax.html',
      )),
      '#weight' => 10,
    );
  }
}