diff options
Diffstat (limited to 'modules/system/system.api.php')
-rw-r--r-- | modules/system/system.api.php | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php index c7db6f1dd..400538900 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -947,8 +947,11 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) { * called, the corresponding path components will be substituted for the * integers. That is, the integer 0 in an argument list will be replaced with * the first path component, integer 1 with the second, and so on (path - * components are numbered starting from zero). This substitution feature allows - * you to re-use a callback function for several different paths. For example: + * components are numbered starting from zero). To pass an integer without it + * being replaced with its respective path component, use the string value of + * the integer (e.g., '1') as the argument value. This substitution feature + * allows you to re-use a callback function for several different paths. For + * example: * @code * function mymodule_menu() { * $items['abc/def'] = array( @@ -961,9 +964,12 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) { * When path 'abc/def' is requested, the page callback function will get 'def' * as the first argument and (always) 'foo' as the second argument. * - * Note that if a page or theme callback function has an argument list array, - * these arguments will be passed first to the function, followed by any - * any arguments generated by optional path arguments as described above. + * If a page callback function uses an argument list array, and its path is + * requested with optional path arguments, then the list array's arguments are + * passed to the callback function first, followed by the optional path + * arguments. Using the above example, when path 'abc/def/bar/baz' is requested, + * mymodule_abc_view() will be called with 'def', 'foo', 'bar' and 'baz' as + * arguments, in that order. * * Special care should be taken for the page callback drupal_get_form(), because * your specific form callback function will always receive $form and @@ -1295,7 +1301,7 @@ function hook_menu_link_insert($link) { */ function hook_menu_link_update($link) { // If the parent menu has changed, update our record. - $menu_name = db_result(db_query("SELECT mlid, menu_name, status FROM {menu_example} WHERE mlid = :mlid", array(':mlid' => $link['mlid']))); + $menu_name = db_query("SELECT menu_name FROM {menu_example} WHERE mlid = :mlid", array(':mlid' => $link['mlid']))->fetchField(); if ($menu_name != $link['menu_name']) { db_update('menu_example') ->fields(array('menu_name' => $link['menu_name'])) @@ -3264,6 +3270,14 @@ function hook_update_last_removed() { * module's database tables are removed, allowing your module to query its own * tables during this routine. * + * When hook_uninstall() is called, your module will already be disabled, so + * its .module file will not be automatically included. If you need to call API + * functions from your .module file in this hook, use drupal_load() to make + * them available. (Keep this usage to a minimum, though, especially when + * calling API functions that invoke hooks, or API functions from modules + * listed as dependencies, since these may not be available or work as expected + * when the module is disabled.) + * * @see hook_install() * @see hook_schema() * @see hook_disable() @@ -3924,7 +3938,11 @@ function hook_system_themes_page_alter(&$theme_groups) { foreach ($theme_groups as $state => &$group) { foreach ($theme_groups[$state] as &$theme) { // Add a foo link to each list of theme operations. - $theme->operations[] = l(t('Foo'), 'admin/appearance/foo', array('query' => array('theme' => $theme->name))); + $theme->operations[] = array( + 'title' => t('Foo'), + 'href' => 'admin/appearance/foo', + 'query' => array('theme' => $theme->name) + ); } } } |