diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-06-30 19:46:58 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-06-30 19:46:58 +0000 |
commit | 9e6ef53c2c3f15ad580ebfe71b53899eb4683c11 (patch) | |
tree | 99f55c2dbe3537f9be7c8750424371f688e2f7b8 /modules/help/help.module | |
parent | 0995d62be320ced7c533d805fe887d78741bfbb8 (diff) | |
download | brdo-9e6ef53c2c3f15ad580ebfe71b53899eb4683c11.tar.gz brdo-9e6ef53c2c3f15ad580ebfe71b53899eb4683c11.tar.bz2 |
#154064 by pwolanin: get hook_help() up to speed to menu changes, allowing router path based lookups, and also full path argument lookup with a passed argument array
Diffstat (limited to 'modules/help/help.module')
-rw-r--r-- | modules/help/help.module | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/modules/help/help.module b/modules/help/help.module index 1333a7e89..3c66a69be 100644 --- a/modules/help/help.module +++ b/modules/help/help.module @@ -21,6 +21,7 @@ function help_menu() { $items['admin/help/'. $module] = array( 'title' => $module, 'page callback' => 'help_page', + 'page arguments' => array(2), 'type' => MENU_CALLBACK, ); } @@ -56,11 +57,12 @@ function help_main() { } function help_links_as_list() { + $empty_arg = drupal_help_arg(); $module_info = module_rebuild_cache(); $modules = array(); foreach (module_implements('help', TRUE) as $module) { - if (module_invoke($module, 'help', "admin/help#$module")) { + if (module_invoke($module, 'help', "admin/help#$module", $empty_arg)) { $modules[] = $module; } } @@ -83,8 +85,8 @@ function help_links_as_list() { /** * Implementation of hook_help(). */ -function help_help($section) { - switch ($section) { +function help_help($path, $arg) { + switch ($path) { case 'admin/help': $output = t('<p>This guide explains what the various modules in <a href="@Drupal">Drupal</a> do and how to configure them. Additionally, you will find a glossary of basic Drupal terminology to help get you started.</p> <p>It is not a substitute for the <a href="@handbook">Drupal handbook</a> available online and should be used in conjunction with it. The online reference handbook might be more up-to-date and has helpful user-contributed comments. It is your definitive reference point for all Drupal documentation.</p> @@ -105,16 +107,15 @@ function help_help($section) { } /** - * Menu callback; prints a page listing general help for all modules. + * Menu callback; prints a page listing general help for a module. */ -function help_page() { - $name = arg(2); +function help_page($name) { $output = ''; if (module_hook($name, 'help')) { $module = drupal_parse_info_file(drupal_get_path('module', $name) .'/'. $name .'.info'); drupal_set_title($module['name']); - $temp = module_invoke($name, 'help', "admin/help#$name"); + $temp = module_invoke($name, 'help', "admin/help#$name", drupal_help_arg()); if (empty($temp)) { $output .= t("No help is available for module %module.", array('%module' => $module['name'])); } |