13use MediaWiki\Cache\LinkBatchFactory;
18use MediaWiki\Pager\BlockListPager;
31 private LinkBatchFactory $linkBatchFactory;
41 LinkBatchFactory $linkBatchFactory,
50 parent::__construct(
'AutoblockList' );
52 $this->linkBatchFactory = $linkBatchFactory;
53 $this->blockRestrictionStore = $blockRestrictionStore;
54 $this->dbProvider = $dbProvider;
55 $this->commentStore = $commentStore;
56 $this->blockTargetFactory = $blockTargetFactory;
57 $this->hideUserUtils = $hideUserUtils;
58 $this->blockActionInfo = $blockActionInfo;
59 $this->rowCommentFormatter = $rowCommentFormatter;
69 $out->setPageTitleMsg( $this->
msg(
'autoblocklist' ) );
71 $out->addModuleStyles( [
'mediawiki.special' ] );
73 # setup BlockListPager here to get the actual default Limit
76 # Just show the block list
79 'type' =>
'limitselect',
80 'label-message' =>
'table_pager_limit_label',
81 'options' => $pager->getLimitSelectList(),
83 'default' => $pager->getLimit(),
87 $form = HTMLForm::factory(
'ooui', $fields, $this->
getContext() );
88 $form->setMethod(
'get' )
90 ->setFormIdentifier(
'blocklist' )
91 ->setWrapperLegendMsg(
'autoblocklist-legend' )
92 ->setSubmitTextMsg(
'autoblocklist-submit' )
94 ->displayForm(
false );
105 $this->dbProvider->getReplicaDatabase()->expr(
'bl_parent_block_id',
'!=',
null ),
107 # Is the user allowed to see hidden blocks?
108 if ( !$this->
getAuthority()->isAllowed(
'hideuser' ) ) {
109 $conds[
'bl_deleted'] = 0;
112 return new BlockListPager(
114 $this->blockActionInfo,
115 $this->blockRestrictionStore,
116 $this->blockTargetFactory,
117 $this->hideUserUtils,
119 $this->linkBatchFactory,
122 $this->rowCommentFormatter,
132 protected function showList( BlockListPager $pager ) {
135 # Check for other blocks, i.e. global/tor blocks
136 $otherAutoblockLink = [];
137 $this->
getHookRunner()->onOtherAutoblockLogLink( $otherAutoblockLink );
139 # Show additional header for the local block only when other blocks exists.
140 # Not necessary in a standard installation without such extensions enabled
141 if ( count( $otherAutoblockLink ) ) {
143 Html::rawElement(
'h2', [], $this->
msg(
'autoblocklist-localblocks',
144 $pager->getNumRows() )->parse() )
149 if ( $pager->getNumRows() ) {
150 $out->addParserOutputContent(
151 $pager->getFullOutput(),
152 ParserOptions::newFromContext( $this->getContext() )
155 $out->addWikiMsg(
'autoblocklist-empty' );
158 if ( count( $otherAutoblockLink ) ) {
163 $this->
msg(
'autoblocklist-otherblocks', count( $otherAutoblockLink ) )->parse()
167 foreach ( $otherAutoblockLink as $link ) {
168 $list .= Html::rawElement(
'li', [], $link ) .
"\n";
173 [
'class' =>
'mw-autoblocklist-otherblocks' ],
187class_alias( SpecialAutoblockList::class,
'SpecialAutoblockList' );
Parent class for all special pages.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getPageTitle( $subpage=false)
Get a self-referential title object.
getContext()
Gets the context this SpecialPage is executed in.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
getAuthority()
Shortcut to get the Authority executing this instance.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages By default the message key is the canonical name of...
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.