You are here

function accountmenu_preprocess_links in Account menu 7

Apply the @name and @realname tokens to the user/self menu item in a menus embedded in a theme.

File

./accountmenu.module, line 241
accountmenu.module Provide a dynamic Log in/My account/Log out account menu

Code

function accountmenu_preprocess_links(&$vars) {
  if (array_key_exists('links', $vars) && is_array($vars['links'])) {
    foreach ($vars['links'] as $key => $link) {
      if (substr($key, 0, 5) === 'menu-' && $link['href'] == 'user/self') {
        $vars['links'][$key]['title'] = t($link['title'], _accountmenu_get_name_and_realname());
      }
    }
  }
}