diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-27 14:03:37 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-27 14:03:37 +0000 |
commit | 34afaf8f2892d5188a72e200b198fa8b9a2ef247 (patch) | |
tree | 18188a7cacc77536a12bfec7ba9d350810b42415 /modules/user | |
parent | 2d128fc080f4729e93698e8865b7940d208dd8b5 (diff) | |
download | brdo-34afaf8f2892d5188a72e200b198fa8b9a2ef247.tar.gz brdo-34afaf8f2892d5188a72e200b198fa8b9a2ef247.tar.bz2 |
#176748 follow up by pwolanin: fix bad breadcrumbs and missing/wrong titles
Diffstat (limited to 'modules/user')
-rw-r--r-- | modules/user/user.module | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index 786443e12..fcc8af2f3 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1029,6 +1029,8 @@ function user_menu() { $items['user/%user_current'] = array( 'title' => 'My account', + 'title callback' => 'user_page_title', + 'title arguments' => array(1), 'page callback' => 'user_view', 'page arguments' => array(1), 'access callback' => 'user_view_access', @@ -1152,6 +1154,16 @@ function user_current_to_arg($arg) { } /** + * Menu item title callback - use the user name if it's not the current user. + */ +function user_page_title($account) { + if ($account->uid == $GLOBALS['user']->uid) { + return t('My account'); + } + return $account->name; +} + +/** * Accepts an user object, $account, or a DA name and returns an associative * array of modules and DA names. Called at external login. */ |