You are here

function menu_get_active_help in Drupal 6

Same name and namespace in other branches
  1. 4 includes/menu.inc \menu_get_active_help()
  2. 5 includes/menu.inc \menu_get_active_help()
  3. 7 includes/menu.inc \menu_get_active_help()

Returns the help associated with the active menu item.

Related topics

2 calls to menu_get_active_help()
chameleon_help in themes/chameleon/chameleon.theme
theme_help in includes/theme.inc
Return a themed help message.

File

includes/menu.inc, line 1182
API for the Drupal menu system.

Code

function menu_get_active_help() {
  $output = '';
  $router_path = menu_tab_root_path();

  // We will always have a path unless we are on a 403 or 404.
  if (!$router_path) {
    return '';
  }
  $arg = drupal_help_arg(arg(NULL));
  $empty_arg = drupal_help_arg();
  foreach (module_list() as $name) {
    if (module_hook($name, 'help')) {

      // Lookup help for this path.
      if ($help = module_invoke($name, 'help', $router_path, $arg)) {
        $output .= $help . "\n";
      }

      // Add "more help" link on admin pages if the module provides a
      // standalone help page.
      if ($arg[0] == "admin" && module_exists('help') && module_invoke($name, 'help', 'admin/help#' . $arg[2], $empty_arg) && $help) {
        $output .= theme("more_help_link", url('admin/help/' . $arg[2]));
      }
    }
  }
  return $output;
}