You are here

function advanced_help_get_topic_file_info in Advanced Help 6

Same name and namespace in other branches
  1. 7 advanced_help.module \advanced_help_get_topic_file_info()

Load and render a help topic.

2 calls to advanced_help_get_topic_file_info()
advanced_help_get_topic_filename in ./advanced_help.module
Load and render a help topic.
advanced_help_view_topic in ./advanced_help.module
Load and render a help topic.

File

./advanced_help.module, line 509
Pluggable system to provide advanced help facilities for Drupal and modules.

Code

function advanced_help_get_topic_file_info($module, $topic) {
  init_theme();
  global $language;
  $info = advanced_help_get_topic($module, $topic);
  if (empty($info)) {
    return;
  }

  // Search paths:
  $paths = array(
    // Allow theme override.
    path_to_theme() . '/help',
    // Translations.
    drupal_get_path('module', $module) . "/translations/help/{$language->language}",
    // In same directory as .inc file.
    $info['path'],
  );
  foreach ($paths as $path) {
    if (file_exists("./{$path}/{$info['file']}")) {
      return array(
        'path' => $path,
        'file' => $info['file'],
      );
    }
  }
}