You are here

function help_page in Drupal 5

Same name and namespace in other branches
  1. 4 modules/help.module \help_page()
  2. 6 modules/help/help.admin.inc \help_page()
  3. 7 modules/help/help.admin.inc \help_page()

Menu callback; prints a page listing general help for all modules.

1 string reference to 'help_page'
help_menu in modules/help/help.module
Implementation of hook_menu().

File

modules/help/help.module, line 113
Manages displaying online help.

Code

function help_page() {
  $name = arg(2);
  $output = '';
  if (module_hook($name, 'help')) {
    $module = _module_parse_info_file(drupal_get_path('module', $name) . '/' . $name . '.info');
    drupal_set_title($module['name']);
    $temp = module_invoke($name, 'help', "admin/help#{$name}");
    if (empty($temp)) {
      $output .= t("No help is available for module %module.", array(
        '%module' => $module['name'],
      ));
    }
    else {
      $output .= $temp;
    }

    // Only print list of administration pages if the module in question has
    // any such pages associated to it.
    $admin_tasks = system_get_module_admin_tasks($name);
    if (!empty($admin_tasks)) {
      ksort($admin_tasks);
      $output .= theme('item_list', $admin_tasks, t('@module administration pages', array(
        '@module' => $module['name'],
      )));
    }
  }
  return $output;
}