Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
1a88d134
Commit
1a88d134
authored
Jul 27, 2006
by
Neil Drumm
Browse files
#74395
by moshe, add hook_profile_alter() to let modules alter the profile page
parent
a43f3aef
Changes
2
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.txt
View file @
1a88d134
...
...
@@ -27,6 +27,8 @@ Drupal x.x.x, xxxx-xx-xx (development version)
* added db_table_exists().
- blogapi module:
* 'blogapi new' and 'blogapi edit' nodeapi operations.
- user module:
* added hook_profile_alter().
Drupal 4.7.0, 2006-05-01
------------------------
...
...
modules/user/user.module
View file @
1a88d134
...
...
@@ -445,7 +445,7 @@ function user_search($op = 'search', $keys = NULL) {
*/
function
user_user
(
$type
,
&
$edit
,
&
$user
,
$category
=
NULL
)
{
if
(
$type
==
'view'
)
{
$items
[]
=
array
(
'title'
=>
t
(
'Member for'
),
$items
[
'history'
]
=
array
(
'title'
=>
t
(
'Member for'
),
'value'
=>
format_interval
(
time
()
-
$user
->
created
),
'class'
=>
'member'
,
);
...
...
@@ -1428,13 +1428,22 @@ function user_view($uid = 0) {
foreach
(
module_list
()
as
$module
)
{
if
(
$data
=
module_invoke
(
$module
,
'user'
,
'view'
,
''
,
$account
))
{
foreach
(
$data
as
$category
=>
$items
)
{
foreach
(
$items
as
$item
)
{
foreach
(
$items
as
$key
=>
$item
)
{
$item
[
'class'
]
=
"
$module
-"
.
$item
[
'class'
];
$fields
[
$category
][]
=
$item
;
$fields
[
$category
][
$key
]
=
$item
;
}
}
}
}
// Let modules change the returned fields - useful for personal privacy
// controls. Since modules communicate changes by reference, we cannot use
// module_invoke_all().
foreach
(
module_implements
(
'profile_alter'
)
as
$module
)
{
$function
=
$module
.
'_profile_alter'
;
$function
(
$account
,
$fields
);
}
drupal_set_title
(
$account
->
name
);
return
theme
(
'user_profile'
,
$account
,
$fields
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment