18use MediaWiki\Pager\BlockListPager;
41 parent::__construct(
'AutoblockList' );
51 $out->setPageTitleMsg( $this->
msg(
'autoblocklist' ) );
53 $out->addModuleStyles( [
'mediawiki.special' ] );
55 # setup BlockListPager here to get the actual default Limit
58 # Just show the block list
61 'type' =>
'limitselect',
62 'label-message' =>
'table_pager_limit_label',
63 'options' => $pager->getLimitSelectList(),
65 'default' => $pager->getLimit(),
69 $form = HTMLForm::factory(
'ooui', $fields, $this->
getContext() );
70 $form->setMethod(
'get' )
72 ->setFormIdentifier(
'blocklist' )
73 ->setWrapperLegendMsg(
'autoblocklist-legend' )
74 ->setSubmitTextMsg(
'autoblocklist-submit' )
76 ->displayForm(
false );
87 $this->dbProvider->getReplicaDatabase()->expr(
'bl_parent_block_id',
'!=',
null ),
89 # Is the user allowed to see hidden blocks?
91 $conds[
'bl_deleted'] = 0;
94 return new BlockListPager(
96 $this->blockActionInfo,
97 $this->blockRestrictionStore,
98 $this->blockTargetFactory,
101 $this->linkBatchFactory,
104 $this->rowCommentFormatter,
114 protected function showList( BlockListPager $pager ) {
117 # Check for other blocks, i.e. global/tor blocks
118 $otherAutoblockLink = [];
119 $this->
getHookRunner()->onOtherAutoblockLogLink( $otherAutoblockLink );
121 # Show additional header for the local block only when other blocks exists.
122 # Not necessary in a standard installation without such extensions enabled
123 if ( count( $otherAutoblockLink ) ) {
125 Html::rawElement(
'h2', [], $this->
msg(
'autoblocklist-localblocks',
126 $pager->getNumRows() )->parse() )
131 if ( $pager->getNumRows() ) {
132 $out->addParserOutputContent(
133 $pager->getFullOutput(),
134 ParserOptions::newFromContext( $this->getContext() )
137 $out->addWikiMsg(
'autoblocklist-empty' );
140 if ( count( $otherAutoblockLink ) ) {
145 $this->
msg(
'autoblocklist-otherblocks', count( $otherAutoblockLink ) )->parse()
149 foreach ( $otherAutoblockLink as $link ) {
150 $list .= Html::rawElement(
'li', [], $link ) .
"\n";
155 [
'class' =>
'mw-autoblocklist-otherblocks' ],
169class_alias( SpecialAutoblockList::class,
'SpecialAutoblockList' );
Factory for LinkBatch objects to batch query page metadata.
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.