Révision e33d3026
Ajouté par Julien Enselme il y a presque 10 ans
drupal7/modules/system/system.api.php | ||
---|---|---|
2109 | 2109 |
); |
2110 | 2110 |
} |
2111 | 2111 |
|
2112 |
/** |
|
2113 |
* Provide online user help. |
|
2114 |
* |
|
2115 |
* By implementing hook_help(), a module can make documentation available to |
|
2116 |
* the user for the module as a whole, or for specific paths. Help for |
|
2117 |
* developers should usually be provided via function header comments in the |
|
2118 |
* code, or in special API example files. |
|
2119 |
* |
|
2120 |
* The page-specific help information provided by this hook appears as a system |
|
2121 |
* help block on that page. The module overview help information is displayed |
|
2122 |
* by the Help module. It can be accessed from the page at admin/help or from |
|
2123 |
* the Modules page. |
|
2124 |
* |
|
2125 |
* For detailed usage examples of: |
|
2126 |
* - Module overview help, see node_help(). Module overview help should follow |
|
2127 |
* @link https://drupal.org/node/632280 the standard help template. @endlink |
|
2128 |
* - Page-specific help with simple paths, see dashboard_help(). |
|
2129 |
* - Page-specific help using wildcards in path and $arg, see node_help() |
|
2130 |
* and block_help(). |
|
2131 |
* |
|
2132 |
* @param $path |
|
2133 |
* The router menu path, as defined in hook_menu(), for the help that is |
|
2134 |
* being requested; e.g., 'admin/people' or 'user/register'. If the router |
|
2135 |
* path includes a wildcard, then this will appear in $path as %, even if it |
|
2136 |
* is a named %autoloader wildcard in the hook_menu() implementation; for |
|
2137 |
* example, node pages would have $path equal to 'node/%' or 'node/%/view'. |
|
2138 |
* For the help page for the module as a whole, $path will have the value |
|
2139 |
* 'admin/help#module_name', where 'module_name" is the machine name of your |
|
2140 |
* module. |
|
2141 |
* @param $arg |
|
2142 |
* An array that corresponds to the return value of the arg() function, for |
|
2143 |
* modules that want to provide help that is specific to certain values |
|
2144 |
* of wildcards in $path. For example, you could provide help for the path |
|
2145 |
* 'user/1' by looking for the path 'user/%' and $arg[1] == '1'. This given |
|
2146 |
* array should always be used rather than directly invoking arg(), because |
|
2147 |
* your hook implementation may be called for other purposes besides building |
|
2148 |
* the current page's help. Note that depending on which module is invoking |
|
2149 |
* hook_help, $arg may contain only empty strings. Regardless, $arg[0] to |
|
2150 |
* $arg[11] will always be set. |
|
2151 |
* |
|
2152 |
* @return |
|
2153 |
* A localized string containing the help text. |
|
2154 |
*/ |
|
2155 |
function hook_help($path, $arg) { |
|
2156 |
switch ($path) { |
|
2157 |
// Main module help for the block module |
|
2158 |
case 'admin/help#block': |
|
2159 |
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>'; |
|
2160 |
|
|
2161 |
// Help for another path in the block module |
|
2162 |
case 'admin/structure/block': |
|
2163 |
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>'; |
|
2164 |
} |
|
2165 |
} |
|
2166 |
|
|
2112 | 2167 |
/** |
2113 | 2168 |
* Register a module (or theme's) theme implementations. |
2114 | 2169 |
* |
... | ... | |
3371 | 3426 |
* hooks. See @link update_api Update versions of API functions @endlink for |
3372 | 3427 |
* details. |
3373 | 3428 |
* |
3374 |
* If your update task is potentially time-consuming, you'll need to implement a |
|
3375 |
* multipass update to avoid PHP timeouts. Multipass updates use the $sandbox |
|
3376 |
* parameter provided by the batch API (normally, $context['sandbox']) to store |
|
3377 |
* information between successive calls, and the $sandbox['#finished'] value |
|
3378 |
* to provide feedback regarding completion level. |
|
3379 |
* |
|
3380 |
* See the batch operations page for more information on how to use the |
|
3381 |
* @link http://drupal.org/node/180528 Batch API. @endlink |
|
3382 |
* |
|
3383 |
* @param $sandbox |
|
3429 |
* The $sandbox parameter should be used when a multipass update is needed, in |
|
3430 |
* circumstances where running the whole update at once could cause PHP to |
|
3431 |
* timeout. Each pass is run in a way that avoids PHP timeouts, provided each |
|
3432 |
* pass remains under the timeout limit. To signify that an update requires |
|
3433 |
* at least one more pass, set $sandbox['#finished'] to a number less than 1 |
|
3434 |
* (you need to do this each pass). The value of $sandbox['#finished'] will be |
|
3435 |
* unset between passes but all other data in $sandbox will be preserved. The |
|
3436 |
* system will stop iterating this update when $sandbox['#finished'] is left |
|
3437 |
* unset or set to a number higher than 1. It is recommended that |
|
3438 |
* $sandbox['#finished'] is initially set to 0, and then updated each pass to a |
|
3439 |
* number between 0 and 1 that represents the overall % completed for this |
|
3440 |
* update, finishing with 1. |
|
3441 |
* |
|
3442 |
* See the @link batch Batch operations topic @endlink for more information on |
|
3443 |
* how to use the Batch API. |
|
3444 |
* |
|
3445 |
* @param array $sandbox |
|
3384 | 3446 |
* Stores information for multipass updates. See above for more information. |
3385 | 3447 |
* |
3386 |
* @throws DrupalUpdateException, PDOException
|
|
3448 |
* @throws DrupalUpdateException|PDOException
|
|
3387 | 3449 |
* In case of error, update hooks should throw an instance of DrupalUpdateException |
3388 | 3450 |
* with a meaningful message for the user. If a database query fails for whatever |
3389 | 3451 |
* reason, it will throw a PDOException. |
3390 | 3452 |
* |
3391 |
* @return |
|
3453 |
* @return string|null
|
|
3392 | 3454 |
* Optionally, update hooks may return a translated string that will be |
3393 | 3455 |
* displayed to the user after the update has completed. If no message is |
3394 | 3456 |
* returned, no message will be presented to the user. |
Formats disponibles : Unified diff
Update drupal to 7.30