$target = $par ?? $request->getVal( 'target' );
- if ( $request->getVal( 'contribs' ) == 'newbie' || $par === 'newbies' ) {
- $target = 'newbies';
- $this->opts['contribs'] = 'newbie';
- } else {
- $this->opts['contribs'] = 'user';
- }
-
$this->opts['deletedOnly'] = $request->getBool( 'deletedOnly' );
if ( !strlen( $target ) ) {
$this->opts['hideMinor'] = $request->getBool( 'hideMinor' );
$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 ) ) {
+ if ( ExternalUserNames::isExternal( $target ) ) {
$userObj = User::newFromName( $target, false );
if ( !$userObj ) {
$out->addHTML( $this->getForm() );
}
$pager = new ContribsPager( $this->getContext(), [
'target' => $target,
- 'contribs' => $this->opts['contribs'],
'namespace' => $this->opts['namespace'],
'tagfilter' => $this->opts['tagfilter'],
'start' => $this->opts['start'],
'hideMinor' => $this->opts['hideMinor'],
'nsInvert' => $this->opts['nsInvert'],
'associated' => $this->opts['associated'],
- ] );
+ ], $this->getLinkRenderer() );
if ( IP::isValidRange( $target ) && !$pager->isQueryableRange( $target ) ) {
// Valid range, but outside CIDR limit.
$out->preventClickjacking( $pager->getPreventClickjacking() );
# Show the appropriate "footer" message - WHOIS tools, etc.
- if ( $this->opts['contribs'] == 'newbie' ) {
- $message = 'sp-contributions-footer-newbies';
- } elseif ( IP::isValidRange( $target ) ) {
+ if ( IP::isValidRange( $target ) ) {
$message = 'sp-contributions-footer-anon-range';
} elseif ( IP::isIPAddress( $target ) ) {
$message = 'sp-contributions-footer-anon';
$linkRenderer = $sp->getLinkRenderer();
+ $tools = [];
# No talk pages for IP ranges.
if ( !$isRange ) {
$tools['user-talk'] = $linkRenderer->makeLink(
$this->opts['associated'] = false;
}
- if ( !isset( $this->opts['contribs'] ) ) {
- $this->opts['contribs'] = 'user';
- }
-
if ( !isset( $this->opts['start'] ) ) {
$this->opts['start'] = '';
}
$this->opts['end'] = '';
}
- if ( $this->opts['contribs'] == 'newbie' ) {
- $this->opts['target'] = '';
- }
-
if ( !isset( $this->opts['tagfilter'] ) ) {
$this->opts['tagfilter'] = '';
}
$filterSelection = Html::rawElement( 'div', [], '' );
}
- $labelNewbies = Xml::radioLabel(
- $this->msg( 'sp-contributions-newbies' )->text(),
- 'contribs',
- 'newbie',
- 'newbie',
- $this->opts['contribs'] == 'newbie',
- [ 'class' => 'mw-input' ]
- );
- $labelUsername = Xml::radioLabel(
+ $labelUsername = Xml::label(
$this->msg( 'sp-contributions-username' )->text(),
- 'contribs',
- 'user',
- 'user',
- $this->opts['contribs'] == 'user',
- [ 'class' => 'mw-input' ]
+ 'mw-target-user-or-ip'
);
$input = Html::input(
'target',
'mw-autocomplete-user', // used by mediawiki.userSuggest
],
] + (
- // Only autofocus if target hasn't been specified or in non-newbies mode
- ( $this->opts['contribs'] === 'newbie' || $this->opts['target'] )
- ? [] : [ 'autofocus' => true ]
- )
+ // Only autofocus if target hasn't been specified
+ $this->opts['target'] ? [] : [ 'autofocus' => true ]
+ )
);
$targetSelection = Html::rawElement(
'div',
[],
- $labelNewbies . '<br>' . $labelUsername . ' ' . $input . ' '
+ $labelUsername . ' ' . $input . ' '
);
$hidden = $this->opts['namespace'] === '' ? ' mw-input-hidden' : '';