You are here

function acquia_search_preprocess_search_api_server in Acquia Search 3.x

Same name and namespace in other branches
  1. 2.x acquia_search.module \acquia_search_preprocess_search_api_server()

Theme override function for Search API server status page.

Parameters

array $variables: Variables.

Throws

\Drupal\Component\Plugin\Exception\PluginException

\Drupal\search_api\SearchApiException

File

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

Code

function acquia_search_preprocess_search_api_server(array &$variables) {

  /** @var \Drupal\search_api\Entity\Server $server */
  $server = $variables['server'];
  if (!Runtime::isAcquiaServer($server)) {
    return;
  }
  if (Runtime::shouldEnforceReadOnlyMode()) {
    Messages::showReadOnlyModeWarning();
  }
  $variables['acquia_search_info_box'] = [
    '#type' => 'fieldset',
    '#title' => t('Acquia Search status for this connection'),
    '#markup' => Messages::getSearchStatusMessage($server),
  ];
}