context = $context; $this->user = $user; $this->definitions = $definitions; $this->sandbox = $sandbox; } /** * @inheritDoc * @return Group */ public function getGroup(): Group { $group = new Group(); $group->insertEntry( new ProfileMenuEntry( $this->user ) ); $group->insertEntry( new SingleMenuEntry( 'userTalk', $this->context->msg( 'mobile-frontend-user-page-talk' )->escaped(), $this->user->getUserPage()->getTalkPage()->getLocalURL(), true, null, 'before', 'wikimedia-ui-userTalk-base20' ) ); if ( $this->sandbox ) { $group->insertEntry( new SingleMenuEntry( 'userSandbox', $this->sandbox['text'], $this->sandbox['href'] ) ); } $this->definitions->insertWatchlistMenuItem( $group ); $this->definitions->insertContributionsMenuItem( $group ); if ( $this->user->isAnon() ) { $this->definitions->insertLogInMenuItem( $group ); } else { $this->definitions->insertLogOutMenuItem( $group ); } return $group; } }