diff options
Diffstat (limited to 'modules/user/user.module')
-rw-r--r-- | modules/user/user.module | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index 47ac64273..0e074d97b 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -187,7 +187,7 @@ function user_entity_info() { } /** - * Entity uri callback. + * Entity URI callback. */ function user_uri($user) { return array( @@ -1873,7 +1873,7 @@ function user_menu_link_alter(&$link) { */ function user_translated_menu_link_alter(&$link) { // Hide the "User account" link for anonymous users. - if ($link['link_path'] == 'user' && $link['module'] == 'system' && user_is_anonymous()) { + if ($link['link_path'] == 'user' && $link['module'] == 'system' && !$GLOBALS['user']->uid) { $link['hidden'] = 1; } } @@ -2574,6 +2574,14 @@ function user_build_content($account, $view_mode = 'full', $langcode = NULL) { // Remove previously built content, if exists. $account->content = array(); + // Allow modules to change the view mode. + $context = array( + 'entity_type' => 'user', + 'entity' => $account, + 'langcode' => $langcode, + ); + drupal_alter('entity_view_mode', $view_mode, $context); + // Build fields content. field_attach_prepare_view('user', array($account->uid => $account), $view_mode, $langcode); entity_prepare_view('user', array($account->uid => $account), $langcode); |