summaryrefslogtreecommitdiff
path: root/modules/user.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-09-14 18:33:16 +0000
committerDries Buytaert <dries@buytaert.net>2003-09-14 18:33:16 +0000
commit9fbab016f937ce4c6e2d93e34b046f80c675fae6 (patch)
treecfb4de6b4a86ee61c6c783d82df99eedc85b7842 /modules/user.module
parentdf3afcbc449773f4768e5dc4b05e7fb2c1197283 (diff)
downloadbrdo-9fbab016f937ce4c6e2d93e34b046f80c675fae6.tar.gz
brdo-9fbab016f937ce4c6e2d93e34b046f80c675fae6.tar.bz2
- Tidied up the usage of module_invoke() and module_invoke_all(). Patch by
Jonathan Chaffer.
Diffstat (limited to 'modules/user.module')
-rw-r--r--modules/user.module30
1 files changed, 5 insertions, 25 deletions
diff --git a/modules/user.module b/modules/user.module
index 48189a39d..bf0643548 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -1052,11 +1052,7 @@ function user_edit($edit = array()) {
$output .= form_textfield(t("Username"), "name", $edit["name"], 30, 55, t("Your full name or your preferred username: only letters, numbers and spaces are allowed."));
$output .= form_textfield(t("E-mail address"), "mail", $edit["mail"], 30, 55, t("Insert a valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail."));
- foreach (module_list() as $module) {
- if (module_hook($module, "user")) {
- $output .= module_invoke($module, "user", "edit_form", $edit, $user);
- }
- }
+ $output .= implode("\n", module_invoke_all ("user", "edit_form", $edit, $user));
$options = "<option value=\"\"". (("" == $key) ? " selected=\"selected\"" : "") .">". t("Default theme") ."</option>\n";
foreach (theme_list() as $key => $value) {
@@ -1101,11 +1097,7 @@ function user_view($uid = 0) {
$output = form_item(t("Name"), "$user->name ($user->init)");
$output .= form_item(t("E-mail address"), $user->mail, t("Please note that only you can see your own e-mail address - it is not publicly visible."));
- foreach (module_list() as $module) {
- if (module_hook($module, "user")) {
- $output .= module_invoke($module, "user", "view_private", "", $user);
- }
- }
+ $output .= implode("\n", module_invoke_all("user", "view_private", "", $user));
theme("header", $user->name);
theme("box", t("User account"), user_menu());
@@ -1115,11 +1107,7 @@ function user_view($uid = 0) {
else if ($uid && $account = user_load(array("uid" => $uid, "status" => 1))) {
$output = form_item(t("Name"), $account->name);
- foreach (module_list() as $module) {
- if (module_hook($module, "user")) {
- $output .= module_invoke($module, "user", "view_public", "", $account);
- }
- }
+ $output .= implode("\n", module_invoke_all("user", "view_public", "", $account));
if (user_access("administer users")) {
$output .= form_item(t("Administration"), l(t("edit account"), "admin/user/edit/$account->uid"));
@@ -1399,11 +1387,7 @@ function user_admin_perm($edit = array()) {
** Compile permission array:
*/
- foreach (module_list() as $name) {
- if (module_hook($name, "perm")) {
- $perms = array_merge($perms, module_invoke($name, "perm"));
- }
- }
+ $perms = module_invoke_all("perm");
asort($perms);
/*
@@ -1577,11 +1561,7 @@ function user_admin_edit($edit = array()) {
$output .= form_textfield(t("Username"), "name", $account->name, 30, 55, t("Your full name or your preferred username: only letters, numbers and spaces are allowed."));
$output .= form_textfield(t("E-mail address"), "mail", $account->mail, 30, 55, t("Insert a valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail."));
- foreach (module_list() as $module) {
- if (module_hook($module, "user")) {
- $output .= module_invoke($module, "user", "edit_form", $edit, $account);
- }
- }
+ $output .= implode("\n", module_invoke_all("user", "edit_form", $edit, $account));
$options = "<option value=\"\"". (("" == $key) ? " selected=\"selected\"" : "") .">". t("Default theme") ."</option>\n";
foreach (theme_list() as $key => $value) {