*/
use MediaWiki\MediaWikiServices;
+use MediaWiki\Linker\LinkRenderer;
use Wikimedia\Rdbms\FakeResultWrapper;
/**
*/
protected $prefix;
+ /**
+ * @var string
+ */
+ protected $suffix;
+
/**
* @var Language
*/
/**
* @param IContextSource|null $context
* @param FormOptions $opts
+ * @param LinkRenderer $linkRenderer
*/
- public function __construct( IContextSource $context = null, FormOptions $opts ) {
- parent::__construct( $context );
+ public function __construct( IContextSource $context = null, FormOptions $opts,
+ LinkRenderer $linkRenderer
+ ) {
+ parent::__construct( $context, $linkRenderer );
$this->mIndexField = 'am_title';
// FIXME: Why does this need to be set to DIR_DESCENDING to produce ascending ordering?
}
function formatValue( $field, $value ) {
- $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
+ $linkRenderer = $this->getLinkRenderer();
switch ( $field ) {
case 'am_title' :
$title = Title::makeTitle( NS_MEDIAWIKI, $value . $this->suffix );
$title = $linkRenderer->makeKnownLink( $title, $this->getLanguage()->lcfirst( $value ) );
} else {
$title = $linkRenderer->makeBrokenLink(
- $title,
- $this->getLanguage()->lcfirst( $value )
+ $title, $this->getLanguage()->lcfirst( $value )
);
}
if ( $this->mCurrentRow->am_talk_exists ) {
}
function getQueryInfo() {
- return '';
+ return [];
}
}