* @ingroup Pager
*/
+use MediaWiki\MediaWikiServices;
+use Wikimedia\Rdbms\FakeResultWrapper;
+
/**
* Use TablePager for prettified output. We have to pretend that we're
* getting data from a table when in fact not all of it comes from the database.
$this->mDefaultDirection = IndexPager::DIR_DESCENDING;
$this->mLimitsShown = [ 20, 50, 100, 250, 500, 5000 ];
- global $wgContLang;
-
$this->talk = $this->msg( 'talkpagelinktext' )->escaped();
- $this->lang = ( $langObj ? $langObj : $wgContLang );
+ $contLang = MediaWikiServices::getInstance()->getContentLanguage();
+ $this->lang = $langObj ?: $contLang;
$this->langcode = $this->lang->getCode();
- $this->foreign = !$this->lang->equals( $wgContLang );
+ $this->foreign = !$this->lang->equals( $contLang );
$request = $this->getRequest();
}
function formatValue( $field, $value ) {
+ $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
switch ( $field ) {
case 'am_title' :
$title = Title::makeTitle( NS_MEDIAWIKI, $value . $this->suffix );
);
if ( $this->mCurrentRow->am_customised ) {
- $title = Linker::linkKnown( $title, $this->getLanguage()->lcfirst( $value ) );
+ $title = $linkRenderer->makeKnownLink( $title, $this->getLanguage()->lcfirst( $value ) );
} else {
- $title = Linker::link(
+ $title = $linkRenderer->makeBrokenLink(
$title,
- $this->getLanguage()->lcfirst( $value ),
- [],
- [],
- [ 'broken' ]
+ $this->getLanguage()->lcfirst( $value )
);
}
if ( $this->mCurrentRow->am_talk_exists ) {
- $talk = Linker::linkKnown( $talk, $this->talk );
+ $talk = $linkRenderer->makeKnownLink( $talk, $this->talk );
} else {
- $talk = Linker::link(
+ $talk = $linkRenderer->makeBrokenLink(
$talk,
- $this->talk,
- [],
- [],
- [ 'broken' ]
+ $this->talk
);
}
$formatted = strval( $this->formatValue( 'am_actual', $row->am_actual ) );
if ( $formatted === '' ) {
- $formatted = ' ';
+ $formatted = "\u{00A0}";
}
$s .= Xml::tags( 'td', $this->getCellAttrs( 'am_actual', $row->am_actual ), $formatted )
}
if ( !$isSecond ) {
- $arr['id'] = Sanitizer::escapeId( 'msg_' . $this->getLanguage()->lcfirst( $row->am_title ) );
+ $arr['id'] = Sanitizer::escapeIdForAttribute(
+ 'msg_' . $this->getLanguage()->lcfirst( $row->am_title )
+ );
}
return $arr;