You are here

function apachesolr_set_stats_message in Apache Solr Search 6

Same name and namespace in other branches
  1. 8 apachesolr.module \apachesolr_set_stats_message()
  2. 5.2 apachesolr.module \apachesolr_set_stats_message()
  3. 6.3 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.

2 calls to apachesolr_set_stats_message()
_apachesolr_nodeapi_delete in ./apachesolr.module
Helper function for hook_nodeapi().
_apachesolr_nodeapi_update in ./apachesolr.module
Helper function for hook_nodeapi().

File

./apachesolr.module, line 687
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(t($text, $stats_summary), $type, FALSE);
  } catch (Exception $e) {
    watchdog('Apache Solr', nl2br(check_plain($e
      ->getMessage())), NULL, WATCHDOG_ERROR);
  }
}