summaryrefslogtreecommitdiff
path: root/modules/help/help.module
blob: 0d0c28ca40b001b44dc8cef55b4633a3a4d64cf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
// $Id$

/**
 * @file
 * Manages displaying online help.
 */

/**
 * Implement hook_menu().
 */
function help_menu() {
  $items['admin/help'] = array(
    'title' => 'Help',
    'page callback' => 'help_main',
    'access arguments' => array('access administration pages'),
    'weight' => 9,
  );

  foreach (module_implements('help', TRUE) as $module) {
    $items['admin/help/' . $module] = array(
      'title' => $module,
      'page callback' => 'help_page',
      'page arguments' => array(2),
      'access arguments' => array('access administration pages'),
      'type' => MENU_CALLBACK,
    );
  }

  return $items;
}

/**
 * Implement hook_help().
 */
function help_help($path, $arg) {
  switch ($path) {
    case 'admin/help':
      $output = '<p>' . t('This guide provides context sensitive help on the use and configuration of <a href="@drupal">Drupal</a> and its modules, and is a supplement to the more extensive online <a href="@handbook">Drupal handbook</a>. The online handbook may contain more up-to-date information, is annotated with helpful user-contributed comments, and serves as the definitive reference point for all Drupal documentation.', array('@drupal' => 'http://drupal.org', '@handbook' => 'http://drupal.org/handbook')) . '</p>';
      return $output;
    case 'admin/help#help':
      $output = '<p>' . t('The help module provides context sensitive help on the use and configuration of <a href="@drupal">Drupal</a> and its modules, and is a supplement to the more extensive online <a href="@handbook">Drupal handbook</a>. The online handbook may contain more up-to-date information, is annotated with helpful user-contributed comments, and serves as the definitive reference point for all Drupal documentation.', array('@drupal' => 'http://drupal.org', '@handbook' => 'http://drupal.org/handbook')) . '</p>';
      $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@help">Help module</a>.', array('@help' => 'http://drupal.org/handbook/modules/help/')) . '</p>';
      return $output;
  }
}