You are here

function ctools_menu_get_active_help in Chaos Tool Suite (ctools) 6

CTools' replacement for ctools_menu_get_active_help()

1 call to ctools_menu_get_active_help()
ctools_menu_help in includes/menu.inc
Theme override to use CTools to call help instead of the basic call.

File

includes/menu.inc, line 443
General menu helper functions.

Code

function ctools_menu_get_active_help() {
  $output = '';
  $router_path = ctools_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;
}