Merge "Prepare Vector for temporary user accounts"

This commit is contained in:
jenkins-bot 2022-04-07 17:35:15 +00:00 committed by Gerrit Code Review
commit 125a8641e5

View file

@ -222,11 +222,17 @@ class Hooks {
*/ */
private static function updateUserLinksDropdownItems( $sk, &$content_navigation ) { private static function updateUserLinksDropdownItems( $sk, &$content_navigation ) {
// For logged-in users in modern Vector, rearrange some links in the personal toolbar. // For logged-in users in modern Vector, rearrange some links in the personal toolbar.
if ( $sk->getUser()->isRegistered() ) { $user = $sk->getUser();
if ( $user->isRegistered() ) {
// Remove user page from personal menu dropdown for logged in use // Remove user page from personal menu dropdown for logged in use
self::makeMenuItemCollapsible( // Note we need to check for userpage, as a registered user in
$content_navigation['user-menu']['userpage'] // future may be an anonymous user who has been assigned a temporary
); // account.
if ( isset( $content_navigation['user-menu']['userpage'] ) ) {
self::makeMenuItemCollapsible(
$content_navigation['user-menu']['userpage']
);
}
// watchlist may be disabled if $wgGroupPermissions['*']['viewmywatchlist'] = false; // watchlist may be disabled if $wgGroupPermissions['*']['viewmywatchlist'] = false;
// See [[phab:T299671]] // See [[phab:T299671]]
if ( isset( $content_navigation['user-menu']['watchlist'] ) ) { if ( isset( $content_navigation['user-menu']['watchlist'] ) ) {