Data Base Instruction

Go to front page

developer/hooks/core.php, string 823 Versions 5 hook_help ($section) 6 hook_help ($path, $arg) "Translation" the Pre-image Shows context-sensitive help for users. Calling hook_help (), the unit does accessible to a kernel or other units help. All user's help should be submitiven with usage of it хука; developer help should be provided with Doxygen/api.module comments. For detailed example of usage search in page_example.module unit. Parametres $path the Path in system of menu Drupal for which help, for example, admin/node or user/edit is requested. If the router path includes a % wildcard, then this will appear in the path - for example all node pages will have the path node / % or node / %/view. Also recognises special descriptors after a ' # ' sign. Some examples: * admin/help#modulename The module's help text, displayed on the admin/help page and through the module's individual help link. * user/help#modulename The help for a distributed authorisation module (if applicable). $arg An array that corresponds to the return of the arg () function - if a module needs to provide help for a page with additional parametres after the Drupal path or help for a specific value for a wildcard in the path, then the values in this array can be referenced. For example you could provide help for user/1 by looking for the path user / % and $arg [1] == ' 1 '. This array should always be used rather than directly invoking arg (). Note that depending on which module is invoking hook_help, $arg may contain only, empty strings. Regardless, $arg [0] to $arg [11] will always be set. Returned value The localised (translated) string containing the text of help. Every web link, l (), or url () must be replaced with %something and put into the final t () call: $output. = ' A role defines a group of users that have certain privileges as defined in %permission. '; $output = t ($output, array (' %permission ' => l (t (' user permissions'), ' admin/user/permission '))); Provide online user help. By implementing hook_help (), a module can make documentation available to the engine or to other modules. All user help should be returned using this hook; developer help should be provided with Doxygen/api.module comments. For a detailed usage example, see page_example.module. Parameters $path A Drupal menu router path the help is being requested for, e.g. admin/node or user/edit. If the router path includes a % wildcard, then this will appear in the path - for example all node pages will have the path node / % or node / %/view. Also recognises special descriptors after a "#" sign. Some examples: * admin/help#modulename The module's help text, displayed on the admin/help page and through the module's individual help link. * user/help#modulename The help for a distributed authorisation module (if applicable). $arg An array that corresponds to the return of the arg () function - if a module needs to provide help for a page with additional parametres after the Drupal path or help for a specific value for a wildcard in the path, then the values in this array can be referenced. For example you could provide help for user/1 by looking for the path user / % and $arg [1] == ' 1 '. This array should always be used rather than directly invoking arg (). Note that depending on which module is invoking hook_help, $arg may contain only, empty strings. Regardless, $arg [0] to $arg [11] will always be set. Return value A localised string containing the help text. Every web link, l (), or url () must be replaced with %something and put into the final t () call: $output. = ' A role defines a group of users that have certain privileges as defined in %permission. '; $output = t ($output, array (' %permission ' => l (t (' user permissions'), ' admin/user/permission '))); The linked subjects Хуки Allows units to co-operate with kernel Drupal. ? 2 functions call hook_help () Источник основного материала