diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-10-17 00:51:53 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-10-17 00:51:53 +0000 |
commit | a613c60fe1cb806d6db2493c5322a4fb08549724 (patch) | |
tree | b1785e2d8ae0a8a27ea055b37392e32f3c173c13 /modules/shortcut/shortcut.api.php | |
parent | a09822b363813158a6182057917080b22d3ca8f7 (diff) | |
download | brdo-a613c60fe1cb806d6db2493c5322a4fb08549724.tar.gz brdo-a613c60fe1cb806d6db2493c5322a4fb08549724.tar.bz2 |
- Patch #511286 by JacobSingh, David_Rothstein, dmitrig01, Gábor Hojtsy, ksenzee et al: add customizable shortcuts to the toolbar.
Diffstat (limited to 'modules/shortcut/shortcut.api.php')
-rw-r--r-- | modules/shortcut/shortcut.api.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/modules/shortcut/shortcut.api.php b/modules/shortcut/shortcut.api.php new file mode 100644 index 000000000..afdc7470b --- /dev/null +++ b/modules/shortcut/shortcut.api.php @@ -0,0 +1,43 @@ +<?php +// $Id$ + +/** + * @file + * Hooks provided by the Shortcut module. + */ + +/** + * @addtogroup hooks + * @{ + */ + +/** + * Return the name of a default shortcut set for the provided user account. + * + * This hook allows modules to define default shortcut sets for a particular + * user that differ from the site-wide default (for example, a module may want + * to define default shortcuts on a per-role basis). + * + * The default shortcut set is used only when the user does not have any other + * shortcut set explicitly assigned to them. + * + * Note that only one default shortcut set can exist per user, so when multiple + * modules implement this hook, the last (i.e., highest weighted) module which + * returns a valid shortcut set name will prevail. + * + * @param $account + * The user account whose default shortcut set is being requested. + * @return + * The name of the shortcut set that this module recommends for that user, if + * there is one. + */ +function hook_shortcut_default_set($account) { + // Use a special set of default shortcuts for administrators only. + if (in_array(variable_get('user_admin_role', 0), $account->roles)) { + return variable_get('mymodule_shortcut_admin_default_set'); + } +} + +/** + * @} End of "addtogroup hooks". + */ |