You are here

function search_api_solr_help in Search API Solr 4.x

Same name and namespace in other branches
  1. 8.3 search_api_solr.module \search_api_solr_help()
  2. 8 search_api_solr.module \search_api_solr_help()
  3. 8.2 search_api_solr.module \search_api_solr_help()
  4. 7 search_api_solr.module \search_api_solr_help()

Implements hook_help().

File

./search_api_solr.module, line 25

Code

function search_api_solr_help($route_name, RouteMatchInterface $route_match) {
  if ($route_name === 'search_api.overview') {

    // Included because we need the REQUIREMENT_* constants.
    include_once DRUPAL_ROOT . '/core/includes/install.inc';
    module_load_include('install', 'search_api_solr');
    $reqs = search_api_solr_requirements('runtime');
    foreach ($reqs as $req) {
      if (isset($req['description'])) {
        $type = $req['severity'] == REQUIREMENT_ERROR ? MessengerInterface::TYPE_ERROR : ($req['severity'] == REQUIREMENT_WARNING ? MessengerInterface::TYPE_WARNING : MessengerInterface::TYPE_STATUS);
        \Drupal::messenger()
          ->addMessage($req['description'], $type);
      }
    }
  }
}