danielebarchiesi@0
|
1 <?php
|
danielebarchiesi@0
|
2
|
danielebarchiesi@0
|
3 /**
|
danielebarchiesi@0
|
4 * @file
|
danielebarchiesi@0
|
5 * Hooks provided by the Help module.
|
danielebarchiesi@0
|
6 */
|
danielebarchiesi@0
|
7
|
danielebarchiesi@0
|
8 /**
|
danielebarchiesi@0
|
9 * @addtogroup hooks
|
danielebarchiesi@0
|
10 * @{
|
danielebarchiesi@0
|
11 */
|
danielebarchiesi@0
|
12
|
danielebarchiesi@0
|
13 /**
|
danielebarchiesi@0
|
14 * Provide online user help.
|
danielebarchiesi@0
|
15 *
|
danielebarchiesi@0
|
16 * By implementing hook_help(), a module can make documentation available to
|
danielebarchiesi@0
|
17 * the user for the module as a whole, or for specific paths. Help for
|
danielebarchiesi@0
|
18 * developers should usually be provided via function header comments in the
|
danielebarchiesi@0
|
19 * code, or in special API example files.
|
danielebarchiesi@0
|
20 *
|
danielebarchiesi@0
|
21 * For a detailed usage example, see page_example.module.
|
danielebarchiesi@0
|
22 *
|
danielebarchiesi@0
|
23 * @param $path
|
danielebarchiesi@0
|
24 * The router menu path, as defined in hook_menu(), for the help that is
|
danielebarchiesi@0
|
25 * being requested; e.g., 'admin/people' or 'user/register'. If the router
|
danielebarchiesi@0
|
26 * path includes a wildcard, then this will appear in $path as %, even if it
|
danielebarchiesi@0
|
27 * is a named %autoloader wildcard in the hook_menu() implementation; for
|
danielebarchiesi@0
|
28 * example, node pages would have $path equal to 'node/%' or 'node/%/view'.
|
danielebarchiesi@0
|
29 * To provide a help page for a whole module with a listing on admin/help,
|
danielebarchiesi@0
|
30 * your hook implementation should match a path with a special descriptor
|
danielebarchiesi@0
|
31 * after a "#" sign:
|
danielebarchiesi@0
|
32 * 'admin/help#modulename'
|
danielebarchiesi@0
|
33 * The main module help text, displayed on the admin/help/modulename
|
danielebarchiesi@0
|
34 * page and linked to from the admin/help page.
|
danielebarchiesi@0
|
35 * @param $arg
|
danielebarchiesi@0
|
36 * An array that corresponds to the return value of the arg() function, for
|
danielebarchiesi@0
|
37 * modules that want to provide help that is specific to certain values
|
danielebarchiesi@0
|
38 * of wildcards in $path. For example, you could provide help for the path
|
danielebarchiesi@0
|
39 * 'user/1' by looking for the path 'user/%' and $arg[1] == '1'. This given
|
danielebarchiesi@0
|
40 * array should always be used rather than directly invoking arg(), because
|
danielebarchiesi@0
|
41 * your hook implementation may be called for other purposes besides building
|
danielebarchiesi@0
|
42 * the current page's help. Note that depending on which module is invoking
|
danielebarchiesi@0
|
43 * hook_help, $arg may contain only empty strings. Regardless, $arg[0] to
|
danielebarchiesi@0
|
44 * $arg[11] will always be set.
|
danielebarchiesi@0
|
45 *
|
danielebarchiesi@0
|
46 * @return
|
danielebarchiesi@0
|
47 * A localized string containing the help text.
|
danielebarchiesi@0
|
48 */
|
danielebarchiesi@0
|
49 function hook_help($path, $arg) {
|
danielebarchiesi@0
|
50 switch ($path) {
|
danielebarchiesi@0
|
51 // Main module help for the block module
|
danielebarchiesi@0
|
52 case 'admin/help#block':
|
danielebarchiesi@0
|
53 return '<p>' . t('Blocks are boxes of content rendered into an area, or region, of a web page. The default theme Bartik, for example, implements the regions "Sidebar first", "Sidebar second", "Featured", "Content", "Header", "Footer", etc., 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>';
|
danielebarchiesi@0
|
54
|
danielebarchiesi@0
|
55 // Help for another path in the block module
|
danielebarchiesi@0
|
56 case 'admin/structure/block':
|
danielebarchiesi@0
|
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>';
|
danielebarchiesi@0
|
58 }
|
danielebarchiesi@0
|
59 }
|
danielebarchiesi@0
|
60
|
danielebarchiesi@0
|
61 /**
|
danielebarchiesi@0
|
62 * @} End of "addtogroup hooks".
|
danielebarchiesi@0
|
63 */
|