Commit 1a88d134 authored by drumm's avatar drumm

#74395 by moshe, add hook_profile_alter() to let modules alter the profile page

parent a43f3aef
......@@ -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
------------------------
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment