mediawiki-extensions-Discus.../includes/SpecialTopicSubscriptions.php
Bartosz Dziewoński e825084546 SpecialPage::getDescription() should return a Message
Bug: T343994
Change-Id: I9902a7f0c2c74c34a887e4429f1de857bd087d28
2023-09-21 22:10:57 +02:00

60 lines
1.3 KiB
PHP

<?php
namespace MediaWiki\Extension\DiscussionTools;
use ErrorPageError;
use MediaWiki\Cache\LinkBatchFactory;
use MediaWiki\Linker\LinkRenderer;
use SpecialPage;
class SpecialTopicSubscriptions extends SpecialPage {
private LinkRenderer $linkRenderer;
private LinkBatchFactory $linkBatchFactory;
public function __construct(
LinkRenderer $linkRenderer,
LinkBatchFactory $linkBatchFactory
) {
parent::__construct( 'TopicSubscriptions' );
$this->linkRenderer = $linkRenderer;
$this->linkBatchFactory = $linkBatchFactory;
}
/**
* @inheritDoc
* @throws ErrorPageError
*/
public function execute( $subpage ) {
$this->requireNamedUser();
parent::execute( $subpage );
$this->getOutput()->addModules( [ 'ext.discussionTools.init' ] );
$this->getOutput()->addHtml( $this->msg( 'discussiontools-topicsubscription-special-intro' )->parseAsBlock() );
$this->getOutput()->enableOOUI();
$pager = new TopicSubscriptionsPager(
$this->getContext(),
$this->linkRenderer,
$this->linkBatchFactory
);
$this->getOutput()->addParserOutputContent( $pager->getFullOutput() );
}
/**
* @inheritDoc
*/
public function getDescription() {
return $this->msg( 'discussiontools-topicsubscription-special-title' );
}
/**
* @inheritDoc
*/
protected function getGroupName() {
return 'login';
}
}