mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 08:23:52 +00:00
9f5692cf85
Bug: T333242 Depends-On: Ieba1631ca3c0562b784aa07d2b26c418448e70a1 Change-Id: I98f67216936846005f2fe1482b18c863da7e0bc7
60 lines
1.3 KiB
PHP
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->requireLogin();
|
|
|
|
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' )->text();
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
protected function getGroupName() {
|
|
return 'login';
|
|
}
|
|
}
|