From 34afaf8f2892d5188a72e200b198fa8b9a2ef247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Thu, 27 Dec 2007 14:03:37 +0000 Subject: #176748 follow up by pwolanin: fix bad breadcrumbs and missing/wrong titles --- modules/user/user.module | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'modules/user') 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', @@ -1151,6 +1153,16 @@ function user_current_to_arg($arg) { return empty($arg) || $arg == '%' ? $GLOBALS['user']->uid : $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. -- cgit v1.2.3