Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
317
Merge Requests
317
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
1a88d134
Commit
1a88d134
authored
Jul 27, 2006
by
drumm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#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
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
CHANGELOG.txt
CHANGELOG.txt
+2
-0
modules/user/user.module
modules/user/user.module
+12
-3
No files found.
CHANGELOG.txt
View file @
1a88d134
...
@@ -27,6 +27,8 @@ Drupal x.x.x, xxxx-xx-xx (development version)
...
@@ -27,6 +27,8 @@ Drupal x.x.x, xxxx-xx-xx (development version)
* added db_table_exists().
* added db_table_exists().
- blogapi module:
- blogapi module:
* 'blogapi new' and 'blogapi edit' nodeapi operations.
* 'blogapi new' and 'blogapi edit' nodeapi operations.
- user module:
* added hook_profile_alter().
Drupal 4.7.0, 2006-05-01
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) {
...
@@ -445,7 +445,7 @@ function user_search($op = 'search', $keys = NULL) {
*/
*/
function
user_user
(
$type
,
&
$edit
,
&
$user
,
$category
=
NULL
)
{
function
user_user
(
$type
,
&
$edit
,
&
$user
,
$category
=
NULL
)
{
if
(
$type
==
'view'
)
{
if
(
$type
==
'view'
)
{
$items
[]
=
array
(
'title'
=>
t
(
'Member for'
),
$items
[
'history'
]
=
array
(
'title'
=>
t
(
'Member for'
),
'value'
=>
format_interval
(
time
()
-
$user
->
created
),
'value'
=>
format_interval
(
time
()
-
$user
->
created
),
'class'
=>
'member'
,
'class'
=>
'member'
,
);
);
...
@@ -1428,13 +1428,22 @@ function user_view($uid = 0) {
...
@@ -1428,13 +1428,22 @@ function user_view($uid = 0) {
foreach
(
module_list
()
as
$module
)
{
foreach
(
module_list
()
as
$module
)
{
if
(
$data
=
module_invoke
(
$module
,
'user'
,
'view'
,
''
,
$account
))
{
if
(
$data
=
module_invoke
(
$module
,
'user'
,
'view'
,
''
,
$account
))
{
foreach
(
$data
as
$category
=>
$items
)
{
foreach
(
$data
as
$category
=>
$items
)
{
foreach
(
$items
as
$item
)
{
foreach
(
$items
as
$
key
=>
$
item
)
{
$item
[
'class'
]
=
"
$module
-"
.
$item
[
'class'
];
$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
);
drupal_set_title
(
$account
->
name
);
return
theme
(
'user_profile'
,
$account
,
$fields
);
return
theme
(
'user_profile'
,
$account
,
$fields
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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