| 1 |
<?php |
| 2 |
|
| 3 |
namespace MediaWiki\Extension\DiscussionTools; |
| 4 |
|
| 5 |
use ErrorPageError; |
| 6 |
use MediaWiki\Cache\LinkBatchFactory; |
| 7 |
use MediaWiki\Linker\LinkRenderer; |
| 8 |
use MediaWiki\SpecialPage\SpecialPage; |
| 9 |
|
| 10 |
class SpecialTopicSubscriptions extends SpecialPage { |
| 11 |
|
| 12 |
private LinkRenderer $linkRenderer; |
| 13 |
private LinkBatchFactory $linkBatchFactory; |
| 14 |
private ThreadItemStore $threadItemStore; |
| 15 |
private ThreadItemFormatter $threadItemFormatter; |
| 16 |
|
| 17 |
public function __construct( |
| 18 |
LinkRenderer $linkRenderer, |
| 19 |
LinkBatchFactory $linkBatchFactory, |
| 20 |
ThreadItemStore $threadItemStore, |
| 21 |
ThreadItemFormatter $threadItemFormatter |
| 22 |
) { |
| 23 |
parent::__construct( 'TopicSubscriptions' ); |
| 24 |
$this->linkRenderer = $linkRenderer; |
| 25 |
$this->linkBatchFactory = $linkBatchFactory; |
| 26 |
$this->threadItemStore = $threadItemStore; |
| 27 |
$this->threadItemFormatter = $threadItemFormatter; |
| 28 |
} |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
public function execute( $subpage ) { |
| 35 |
$this->requireNamedUser(); |
| 36 |
|
| 37 |
parent::execute( $subpage ); |
| 38 |
|
| 39 |
$this->getOutput()->addModules( [ 'ext.discussionTools.init' ] ); |
| 40 |
|
| 41 |
$this->getOutput()->addHtml( $this->msg( 'discussiontools-topicsubscription-special-intro' )->parseAsBlock() ); |
| 42 |
|
| 43 |
$this->getOutput()->enableOOUI(); |
| 44 |
$pager = new TopicSubscriptionsPager( |
| 45 |
$this->getContext(), |
| 46 |
$this->linkRenderer, |
| 47 |
$this->linkBatchFactory, |
| 48 |
$this->threadItemStore, |
| 49 |
$this->threadItemFormatter |
| 50 |
); |
| 51 |
$this->getOutput()->addParserOutputContent( $pager->getFullOutput() ); |
| 52 |
} |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
public function getDescription() { |
| 58 |
return $this->msg( 'discussiontools-topicsubscription-special-title' ); |
| 59 |
} |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
protected function getGroupName() { |
| 65 |
return 'login'; |
| 66 |
} |
| 67 |
} |