diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 43c06c9bfbf8ba11eb5b3e97cb047a1238c993fd..fbe25e80f44812aee766d35a5fbbcb9db897f14e 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -1342,6 +1342,7 @@ function bootstrap_hooks() { * more information, including recommendations on how to break up or not * break up strings for translation. * + * @section sec_translating_vars Translating Variables * You should never use t() to translate variables, such as calling * @code t($text); @endcode, unless the text that the variable holds has been * passed through t() elsewhere (e.g., $text is one of several translated @@ -1361,6 +1362,7 @@ function bootstrap_hooks() { * Translators can then rearrange the string as necessary for the language * (e.g., in Spanish, it might be "blog de @name"). * + * @section sec_alt_funcs_install Use During Installation Phase * During the Drupal installation phase, some resources used by t() wil not be * available to code that needs localization. See st() and get_t() for * alternatives. diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 009d07ed4036645421e964c5ffa4c71793b75858..6341a362cd949088e7417ebf968d7ac9db3b05dd 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -808,6 +808,7 @@ function drupal_find_base_themes($themes, $key, $used_keys = array()) { * @link themeable theme function or template @endlink, by checking the theme * registry. * + * @section sec_theme_hooks Theme Hooks * Most commonly, the first argument to this function is the name of the theme * hook. For instance, to theme a taxonomy term, the theme hook name is * 'taxonomy_term'. Modules register theme hooks within a hook_theme() @@ -819,6 +820,7 @@ function drupal_find_base_themes($themes, $key, $used_keys = array()) { * underscores changed to hyphens, so for the 'taxonomy_term' theme hook, the * default template is 'taxonomy-term.tpl.php'. * + * @subsection sub_overriding_theme_hooks Overriding Theme Hooks * Themes may also register new theme hooks within a hook_theme() * implementation, but it is more common for themes to override default * implementations provided by modules than to register entirely new theme @@ -831,6 +833,7 @@ function drupal_find_base_themes($themes, $key, $used_keys = array()) { * engine, it overrides the default implementation of the 'page' theme hook by * containing a 'page.html.twig' file within its folder structure). * + * @subsection sub_preprocess_templates Preprocessing for Template Files * If the implementation is a template file, several functions are called * before the template file is invoked, to modify the $variables array. These * fall into the "preprocessing" phase and the "processing" phase, and are @@ -879,12 +882,14 @@ function drupal_find_base_themes($themes, $key, $used_keys = array()) { * - THEME_process_HOOK(&$variables): Allows the theme to process the * variables specific to the theme hook. * + * @subsection sub_preprocess_theme_funcs Preprocessing for Theme Functions * If the implementation is a function, only the theme-hook-specific preprocess * and process functions (the ones ending in _HOOK) are called from the * list above. This is because theme hooks with function implementations * need to be fast, and calling the non-theme-hook-specific preprocess and * process functions for them would incur a noticeable performance penalty. * + * @subsection sub_alternate_suggestions Suggesting Alternate Hooks * There are two special variables that these preprocess and process functions * can set: 'theme_hook_suggestion' and 'theme_hook_suggestions'. These will be * merged together to form a list of 'suggested' alternate theme hooks to use, diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index 61f1844a5a2b9377993a9f3186df606cf5729a84..0be782188f208dd6e58fc1dde6dd73aed0758632 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -554,6 +554,7 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) { * paths and whose values are an associative array of properties for each * path. (The complete list of properties is in the return value section below.) * + * @section sec_callback_funcs Callback Functions * The definition for each path may include a page callback function, which is * invoked when the registered path is requested. If there is no other * registered path that fits the requested path better, any further path @@ -578,6 +579,7 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) { * $jkl will be 'foo'. Note that this automatic passing of optional path * arguments applies only to page and theme callback functions. * + * @subsection sub_callback_arguments Callback Arguments * In addition to optional path arguments, the page callback and other callback * functions may specify argument lists as arrays. These argument lists may * contain both fixed/hard-coded argument values and integers that correspond @@ -620,6 +622,8 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) { * @endcode * See @link form_api Form API documentation @endlink for details. * + * @section sec_path_wildcards Wildcards in Paths + * @subsection sub_simple_wildcards Simple Wildcards * Wildcards within paths also work with integer substitution. For example, * your module could register path 'my-module/%/edit': * @code @@ -632,6 +636,7 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) { * with 'foo' and passed to the callback function. Note that wildcards may not * be used as the first component. * + * @subsection sub_autoload_wildcards Auto-Loader Wildcards * Registered paths may also contain special "auto-loader" wildcard components * in the form of '%mymodule_abc', where the '%' part means that this path * component is a wildcard, and the 'mymodule_abc' part defines the prefix for a @@ -663,6 +668,7 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) { * return FALSE for the path 'node/999/edit' if a node with a node ID of 999 * does not exist. The menu routing system will return a 404 error in this case. * + * @subsection sub_argument_wildcards Argument Wildcards * You can also define a %wildcard_to_arg() function (for the example menu * entry above this would be 'mymodule_abc_to_arg()'). The _to_arg() function * is invoked to retrieve a value that is used in the path in place of the @@ -687,6 +693,7 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) { * are called when the menu system is generating links to related paths, such * as the tabs for a set of MENU_LOCAL_TASK items. * + * @section sec_render_tabs Rendering Menu Items As Tabs * You can also make groups of menu items to be rendered (by default) as tabs * on a page. To do that, first create one menu item of type MENU_NORMAL_ITEM, * with your chosen path, such as 'foo'. Then duplicate that menu item, using a