diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-11-15 11:45:04 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-11-15 11:45:04 +0000 |
commit | 97fdc491917f6f12d734cb13bf2101cfc12096fd (patch) | |
tree | 6705139d65bdbbfd0c7ccb7c59f9442bd6a5cd7d /modules/user/user.module | |
parent | 10104ba94ac7a70b2be3594cb769034582533e1f (diff) | |
download | brdo-97fdc491917f6f12d734cb13bf2101cfc12096fd.tar.gz brdo-97fdc491917f6f12d734cb13bf2101cfc12096fd.tar.bz2 |
- Patch #334030 by justinrandell: replace module_list with module_implements when calling a hook.
Diffstat (limited to 'modules/user/user.module')
-rw-r--r-- | modules/user/user.module | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index 224d44d41..f1a8593b7 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -23,11 +23,9 @@ define('EMAIL_MAX_LENGTH', 64); * be passed by reference. */ function user_module_invoke($type, &$array, &$user, $category = NULL) { - foreach (module_list() as $module) { + foreach (module_implements('user_' . $type) as $module) { $function = $module . '_user_' . $type; - if (function_exists($function)) { - $function($array, $user, $category); - } + $function($array, $user, $category); } } @@ -1952,8 +1950,9 @@ function user_filters() { } $options = array(); - foreach (module_list() as $module) { - if ($permissions = module_invoke($module, 'perm')) { + foreach (module_implements('perm') as $module) { + $function = $module . '_perm'; + if ($permissions = $function('perm')) { asort($permissions); foreach ($permissions as $permission => $description) { $options[t('@module module', array('@module' => $module))][$permission] = t($permission); @@ -2437,8 +2436,9 @@ function user_register_validate($form, &$form_state) { */ function _user_forms(&$edit, $account, $category, $hook = 'form') { $groups = array(); - foreach (module_list() as $module) { - if ($data = module_invoke($module, 'user_' . $hook, $edit, $account, $category)) { + foreach (module_implements('user_' . $hook) as $module) { + $function = $module . '_user_' . $hook; + if ($data = $function($edit, $account, $category)) { $groups = array_merge_recursive($data, $groups); } } |