Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 16
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
SpecialTopicSubscriptions
0.00% covered (danger)
0.00%
0 / 16
0.00% covered (danger)
0.00%
0 / 4
20
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 execute
0.00% covered (danger)
0.00%
0 / 11
0.00% covered (danger)
0.00%
0 / 1
2
 getDescription
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getGroupName
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace MediaWiki\Extension\DiscussionTools;
4
5use ErrorPageError;
6use MediaWiki\Cache\LinkBatchFactory;
7use MediaWiki\Linker\LinkRenderer;
8use SpecialPage;
9
10class SpecialTopicSubscriptions extends SpecialPage {
11
12    private LinkRenderer $linkRenderer;
13    private LinkBatchFactory $linkBatchFactory;
14
15    public function __construct(
16        LinkRenderer $linkRenderer,
17        LinkBatchFactory $linkBatchFactory
18    ) {
19        parent::__construct( 'TopicSubscriptions' );
20        $this->linkRenderer = $linkRenderer;
21        $this->linkBatchFactory = $linkBatchFactory;
22    }
23
24    /**
25     * @inheritDoc
26     * @throws ErrorPageError
27     */
28    public function execute( $subpage ) {
29        $this->requireNamedUser();
30
31        parent::execute( $subpage );
32
33        $this->getOutput()->addModules( [ 'ext.discussionTools.init' ] );
34
35        $this->getOutput()->addHtml( $this->msg( 'discussiontools-topicsubscription-special-intro' )->parseAsBlock() );
36
37        $this->getOutput()->enableOOUI();
38        $pager = new TopicSubscriptionsPager(
39            $this->getContext(),
40            $this->linkRenderer,
41            $this->linkBatchFactory
42        );
43        $this->getOutput()->addParserOutputContent( $pager->getFullOutput() );
44    }
45
46    /**
47     * @inheritDoc
48     */
49    public function getDescription() {
50        return $this->msg( 'discussiontools-topicsubscription-special-title' );
51    }
52
53    /**
54     * @inheritDoc
55     */
56    protected function getGroupName() {
57        return 'login';
58    }
59}