$this->opts = [];
$request = $this->getRequest();
- if ( $par !== null ) {
- $target = $par;
- } else {
- $target = $request->getVal( 'target' );
- }
+ $target = $par ?? $request->getVal( 'target' );
if ( $request->getVal( 'contribs' ) == 'newbie' || $par === 'newbies' ) {
$target = 'newbies';
$this->opts['newOnly'] = $request->getBool( 'newOnly' );
$this->opts['hideMinor'] = $request->getBool( 'hideMinor' );
- $nt = Title::makeTitleSafe( NS_USER, $target );
- if ( !$nt ) {
- $out->addHTML( $this->getForm() );
-
- return;
- }
- $userObj = User::newFromName( $nt->getText(), false );
- if ( !$userObj ) {
- $out->addHTML( $this->getForm() );
+ $id = 0;
+ if ( $this->opts['contribs'] === 'newbie' ) {
+ $userObj = User::newFromName( $target ); // hysterical raisins
+ $out->addSubtitle( $this->msg( 'sp-contributions-newbies-sub' ) );
+ $out->setHTMLTitle( $this->msg(
+ 'pagetitle',
+ $this->msg( 'sp-contributions-newbies-title' )->plain()
+ )->inContentLanguage() );
+ } elseif ( ExternalUserNames::isExternal( $target ) ) {
+ $userObj = User::newFromName( $target, false );
+ if ( !$userObj ) {
+ $out->addHTML( $this->getForm() );
+ return;
+ }
- return;
- }
- $id = $userObj->getId();
+ $out->addSubtitle( $this->contributionsSub( $userObj ) );
+ $out->setHTMLTitle( $this->msg(
+ 'pagetitle',
+ $this->msg( 'contributions-title', $target )->plain()
+ )->inContentLanguage() );
+ } else {
+ $nt = Title::makeTitleSafe( NS_USER, $target );
+ if ( !$nt ) {
+ $out->addHTML( $this->getForm() );
+ return;
+ }
+ $userObj = User::newFromName( $nt->getText(), false );
+ if ( !$userObj ) {
+ $out->addHTML( $this->getForm() );
+ return;
+ }
+ $id = $userObj->getId();
- if ( $this->opts['contribs'] != 'newbie' ) {
$target = $nt->getText();
$out->addSubtitle( $this->contributionsSub( $userObj ) );
$out->setHTMLTitle( $this->msg(
if ( !IP::isValidRange( $target ) ) {
$this->getSkin()->setRelevantUser( $userObj );
}
- } else {
- $out->addSubtitle( $this->msg( 'sp-contributions-newbies-sub' ) );
- $out->setHTMLTitle( $this->msg(
- 'pagetitle',
- $this->msg( 'sp-contributions-newbies-title' )->plain()
- )->inContentLanguage() );
}
$ns = $request->getVal( 'namespace', null );
$filterSelection = Html::rawElement(
'div',
[],
- implode( ' ', $tagFilter )
+ implode( "\u{00A0}", $tagFilter )
);
} else {
$filterSelection = Html::rawElement( 'div', [], '' );
$this->msg( 'namespace' )->text(),
'namespace',
''
- ) . ' ' .
+ ) . "\u{00A0}" .
Html::namespaceSelector(
[ 'selected' => $this->opts['namespace'], 'all' => '' ],
[
'id' => 'namespace',
'class' => 'namespaceselector',
]
- ) . ' ' .
+ ) . "\u{00A0}" .
Html::rawElement(
'span',
[ 'class' => 'mw-input-with-label' ],
'title' => $this->msg( 'tooltip-invert' )->text(),
'class' => 'mw-input'
]
- ) . ' '
+ ) . "\u{00A0}"
) .
Html::rawElement( 'span', [ 'class' => 'mw-input-with-label' ],
Xml::checkLabel(
'title' => $this->msg( 'tooltip-namespace_association' )->text(),
'class' => 'mw-input'
]
- ) . ' '
+ ) . "\u{00A0}"
)
);