* @ingroup SpecialPage
*/
-use MediaWiki\MediaWikiServices;
use MediaWiki\Widget\DateInputWidget;
/**
$out = $this->getOutput();
// Modules required for viewing the list of contributions (also when included on other pages)
$out->addModuleStyles( [
+ 'mediawiki.interface.helpers.styles',
'mediawiki.special',
'mediawiki.special.changeslist',
] );
}
$this->opts = ContribsPager::processDateFilter( $this->opts );
+ if ( $this->opts['namespace'] < NS_MAIN ) {
+ $this->getOutput()->wrapWikiMsg(
+ "<div class=\"mw-negative-namespace-not-supported error\">\n\$1\n</div>",
+ [ 'negative-namespace-not-supported' ]
+ );
+ $out->addHTML( $this->getForm() );
+ return;
+ }
+
$feedType = $request->getVal( 'feed' );
$feedParams = [
$out->addWikiMsg( 'nocontribs', $target );
} else {
# Show a message about replica DB lag, if applicable
- $lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
- $lag = $lb->safeGetLag( $pager->getDatabase() );
+ $lag = $pager->getDatabase()->getSessionLagStatus()['lag'];
if ( $lag > 0 ) {
$out->showLagWarning( $lag );
}
''
) . "\u{00A0}" .
Html::namespaceSelector(
- [ 'selected' => $this->opts['namespace'], 'all' => '' ],
+ [ 'selected' => $this->opts['namespace'], 'all' => '', 'in-user-lang' => true ],
[
'name' => 'namespace',
'id' => 'namespace',
$explain = $this->msg( 'sp-contributions-explain' );
if ( !$explain->isBlank() ) {
- $form .= "<p id='mw-sp-contributions-explain'>{$explain->parse()}</p>";
+ $form .= Html::rawElement(
+ 'p', [ 'id' => 'mw-sp-contributions-explain' ], $explain->parse()
+ );
}
$form .= Xml::closeElement( 'form' );