/[drupal]/drupal/modules/help/help.api.php
ViewVC logotype

Contents of /drupal/modules/help/help.api.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.7 - (show annotations) (download) (as text)
Fri Sep 11 07:08:23 2009 UTC (2 months, 2 weeks ago) by dries
Branch: MAIN
CVS Tags: DRUPAL-7-0-UNSTABLE-10, DRUPAL-7-0-UNSTABLE-9, HEAD
Changes since 1.6: +28 -31 lines
File MIME type: text/x-php
- Patch #529316 by jhodgdon: fixed and improved hook_help() documentation.
1 <?php
2 // $Id: help.api.php,v 1.6 2009/09/10 06:32:54 dries Exp $
3
4 /**
5 * @file
6 * Hooks provided by the Help module.
7 */
8
9 /**
10 * @addtogroup hooks
11 * @{
12 */
13
14 /**
15 * Provide online user help.
16 *
17 * By implementing hook_help(), a module can make documentation
18 * available to the user for the module as a whole, or for specific paths.
19 * Help for developers should usually be provided via function
20 * header comments in the code, or in special API example files.
21 *
22 * For a detailed usage example, see page_example.module.
23 *
24 * @param $path
25 * The router menu path, as defined in hook_menu(), for the help that
26 * is being requested; e.g., 'admin/node' or 'user/edit'. If the router path
27 * includes a % wildcard, then this will appear in $path; for example,
28 * node pages would have $path equal to 'node/%' or 'node/%/view'. Your hook
29 * implementation may also be called with special descriptors after a
30 * "#" sign. Some examples:
31 * - admin/help#modulename
32 * The main module help text, displayed on the admin/help/modulename
33 * page and linked to from the admin/help page.
34 * - user/help#modulename
35 * The help for a distributed authorization module (if applicable).
36 * @param $arg
37 * An array that corresponds to the return value of the arg() function, for
38 * modules that want to provide help that is specific to certain values
39 * of wildcards in $path. For example, you could provide help for the path
40 * 'user/1' by looking for the path 'user/%' and $arg[1] == '1'. This
41 * array should always be used rather than directly invoking arg(), because
42 * your hook implementation may be called for other purposes besides building
43 * the current page's help. Note that depending on which module is invoking
44 * hook_help, $arg may contain only empty strings. Regardless, $arg[0] to
45 * $arg[11] will always be set.
46 * @return
47 * A localized string containing the help text.
48 */
49 function hook_help($path, $arg) {
50 switch ($path) {
51 // Main module help for the block module
52 case 'admin/help#block':
53 return '<p>' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Garland, for example, implements the regions "left sidebar", "right sidebar", "content", "header", and "footer", and a block may appear in any one of these areas. The <a href="@blocks">blocks administration page</a> provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions.', array('@blocks' => url('admin/structure/block'))) . '</p>';
54
55 // Help for another path in the block module
56 case 'admin/structure/block':
57 return '<p>' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the <em>Save blocks</em> button at the bottom of the page.') . '</p>';
58 }
59 }
60
61 /**
62 * @} End of "addtogroup hooks".
63 */

  ViewVC Help
Powered by ViewVC 1.1.2