function _accountmenu_get_name_and_realname in Account menu 7
Same name and namespace in other branches
- 6 accountmenu.module \_accountmenu_get_name_and_realname()
Retrieve the user's name and realname
Return value
a two-element array, first element is the user login name, the second element is user's real name if the realname module is installed. If not, it is the same as the first element.
3 calls to _accountmenu_get_name_and_realname()
- accountmenu_preprocess_block in ./
accountmenu.module - Substitue tokens @name and @realname with login name and realname. @realname is same as @name if realname module is not install.
- accountmenu_preprocess_links in ./
accountmenu.module - Apply the @name and @realname tokens to the user/self menu item in a menus embedded in a theme.
- accountmenu_preprocess_menu_link in ./
accountmenu.module - Apply the @name and @realname tokens to the user/self menu item in a menu block
File
- ./
accountmenu.module, line 268 - accountmenu.module Provide a dynamic Log in/My account/Log out account menu
Code
function _accountmenu_get_name_and_realname() {
global $user;
// initialize elements [0] and [1], the second will be set to real name if the
// realname module is installed
$result = array(
'@name' => empty($user->name) ? '' : $user->name,
'@realname' => format_username($user),
);
// Allow other modules to muck about with the tokens.
drupal_alter('accountmenu_name_realname', $result);
return $result;
}