2021-03-05 20:43:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace MediaWiki\Extension\DiscussionTools;
|
|
|
|
|
2022-10-28 18:24:02 +00:00
|
|
|
use ErrorPageError;
|
2021-03-05 20:43:49 +00:00
|
|
|
use MediaWiki\Cache\LinkBatchFactory;
|
|
|
|
use MediaWiki\Linker\LinkRenderer;
|
2023-12-11 15:38:02 +00:00
|
|
|
use MediaWiki\SpecialPage\SpecialPage;
|
2021-03-05 20:43:49 +00:00
|
|
|
|
|
|
|
class SpecialTopicSubscriptions extends SpecialPage {
|
|
|
|
|
2022-10-21 19:34:18 +00:00
|
|
|
private LinkRenderer $linkRenderer;
|
|
|
|
private LinkBatchFactory $linkBatchFactory;
|
2024-03-29 00:35:32 +00:00
|
|
|
private ThreadItemStore $threadItemStore;
|
|
|
|
private ThreadItemFormatter $threadItemFormatter;
|
2021-03-05 20:43:49 +00:00
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
LinkRenderer $linkRenderer,
|
2024-03-29 00:35:32 +00:00
|
|
|
LinkBatchFactory $linkBatchFactory,
|
|
|
|
ThreadItemStore $threadItemStore,
|
|
|
|
ThreadItemFormatter $threadItemFormatter
|
2021-03-05 20:43:49 +00:00
|
|
|
) {
|
|
|
|
parent::__construct( 'TopicSubscriptions' );
|
|
|
|
$this->linkRenderer = $linkRenderer;
|
|
|
|
$this->linkBatchFactory = $linkBatchFactory;
|
2024-03-29 00:35:32 +00:00
|
|
|
$this->threadItemStore = $threadItemStore;
|
|
|
|
$this->threadItemFormatter = $threadItemFormatter;
|
2021-03-05 20:43:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritDoc
|
2022-10-28 18:24:02 +00:00
|
|
|
* @throws ErrorPageError
|
2021-03-05 20:43:49 +00:00
|
|
|
*/
|
|
|
|
public function execute( $subpage ) {
|
2023-06-02 19:11:36 +00:00
|
|
|
$this->requireNamedUser();
|
2021-03-05 20:43:49 +00:00
|
|
|
|
|
|
|
parent::execute( $subpage );
|
|
|
|
|
2023-02-04 14:30:14 +00:00
|
|
|
$this->getOutput()->addModules( [ 'ext.discussionTools.init' ] );
|
|
|
|
|
2021-03-05 20:43:49 +00:00
|
|
|
$this->getOutput()->addHtml( $this->msg( 'discussiontools-topicsubscription-special-intro' )->parseAsBlock() );
|
|
|
|
|
|
|
|
$this->getOutput()->enableOOUI();
|
|
|
|
$pager = new TopicSubscriptionsPager(
|
|
|
|
$this->getContext(),
|
|
|
|
$this->linkRenderer,
|
2024-03-29 00:35:32 +00:00
|
|
|
$this->linkBatchFactory,
|
|
|
|
$this->threadItemStore,
|
|
|
|
$this->threadItemFormatter
|
2021-03-05 20:43:49 +00:00
|
|
|
);
|
|
|
|
$this->getOutput()->addParserOutputContent( $pager->getFullOutput() );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritDoc
|
|
|
|
*/
|
|
|
|
public function getDescription() {
|
2023-09-21 20:10:57 +00:00
|
|
|
return $this->msg( 'discussiontools-topicsubscription-special-title' );
|
2021-03-05 20:43:49 +00:00
|
|
|
}
|
|
|
|
|
2023-03-24 19:07:17 +00:00
|
|
|
/**
|
|
|
|
* @inheritDoc
|
|
|
|
*/
|
|
|
|
protected function getGroupName() {
|
|
|
|
return 'login';
|
|
|
|
}
|
2021-03-05 20:43:49 +00:00
|
|
|
}
|