You are here

function acquia_search_form_apachesolr_settings_alter in Acquia Connector 7.2

Same name and namespace in other branches
  1. 7.3 acquia_search/acquia_search.module \acquia_search_form_apachesolr_settings_alter()
  2. 7 acquia_search/acquia_search.module \acquia_search_form_apachesolr_settings_alter()

Implementation of hook_form_[form_id]_alter().

File

acquia_search/acquia_search.module, line 477
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
    foreach ($form['apachesolr_host_settings']['table']['#rows'] as &$row) {
      if (isset($row['data']['delete']['data']) && strpos($row['data']['delete']['data'], ACQUIA_SEARCH_ENVIRONMENT_ID . '/delete') !== FALSE) {
        $row['data']['delete']['data'] = '';
        break;
      }
    }
    $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,
    );
  }
}