You are here

function apachesolr_set_stats_message in Apache Solr Search 8

Same name and namespace in other branches
  1. 5.2 apachesolr.module \apachesolr_set_stats_message()
  2. 6.3 apachesolr.module \apachesolr_set_stats_message()
  3. 6 apachesolr.module \apachesolr_set_stats_message()
  4. 6.2 apachesolr.module \apachesolr_set_stats_message()
  5. 7 apachesolr.module \apachesolr_set_stats_message()

Call drupal_set_message() with the text.

The text is translated with t() and substituted using Solr stats. @todo This is not according to drupal code standards

File

./apachesolr.module, line 874
Integration with the Apache Solr search application.

Code

function apachesolr_set_stats_message($text, $type = 'status', $repeat = FALSE) {
  try {
    $solr = apachesolr_get_solr();
    $stats_summary = $solr
      ->getStatsSummary();
    drupal_set_message(check_plain(t($text, $stats_summary)), $type, FALSE);
  } catch (Exception $e) {
    watchdog('Apache Solr', nl2br(check_plain($e
      ->getMessage())), NULL, WATCHDOG_ERROR);
  }
}