You are here

function sarnia_help in Sarnia 7

Implements hook_help().

Provide help text on the Sarnia local task under the Search API server administration pages.

File

./sarnia.module, line 353

Code

function sarnia_help($path, $arg) {
  if ($path == 'admin/config/search/search_api/server/%/sarnia') {
    return t("Sarnia can provide an entity type based on data that already exists in this Solr core. This is most useful for Solr cores that contain non-Drupal data that is indexed by an external process, since it allows you to use data stored in Solr within Drupal. In combination with a read-only Search API index, you can also build Views based on the Solr data.");
  }
  if ($path == 'admin/help#sarnia') {
    $filepath = dirname(__FILE__) . '/README.md';
    if (file_exists($filepath)) {
      $readme = file_get_contents($filepath);
    }
    else {
      $filepath = dirname(__FILE__) . '/README.txt';
      if (file_exists($filepath)) {
        $readme = file_get_contents($filepath);
      }
    }
    if (!isset($readme)) {
      return NULL;
    }
    if (module_exists('markdown')) {
      $filters = module_invoke('markdown', 'filter_info');
      $info = $filters['filter_markdown'];
      if (function_exists($info['process callback'])) {
        $output = $info['process callback']($readme, NULL);
      }
      else {
        $output = '<pre>' . $readme . '</pre>';
      }
    }
    else {
      $output = '<pre>' . $readme . '</pre>';
    }
    return $output;
  }
}