56 parent::__construct(
'Protectedpages' );
57 $this->linkBatchFactory = $linkBatchFactory;
58 $this->dbProvider = $dbProvider;
59 $this->commentStore = $commentStore;
60 $this->rowCommentFormatter = $rowCommentFormatter;
61 $this->restrictionStore = $restrictionStore;
67 $this->
getOutput()->addModuleStyles(
'mediawiki.special' );
71 $type = $request->getVal(
'type' );
72 $level = $request->getVal(
'level' );
73 $sizetype = $request->getVal(
'size-mode' );
74 $size = $request->getIntOrNull(
'size' );
75 $ns = $request->getIntOrNull(
'namespace' );
77 $filters = $request->getArray(
'wpfilters', [] );
78 $indefOnly = in_array(
'indefonly', $filters );
79 $cascadeOnly = in_array(
'cascadeonly', $filters );
80 $noRedirect = in_array(
'noredirect', $filters );
85 $this->linkBatchFactory,
88 $this->rowCommentFormatter,
105 if ( $pager->getNumRows() ) {
106 $this->
getOutput()->addModuleStyles(
'mediawiki.interface.helpers.styles' );
107 $this->
getOutput()->addParserOutputContent(
108 $pager->getFullOutput(),
109 ParserOptions::newFromContext( $this->getContext() )
112 $this->
getOutput()->addWikiMsg(
'protectedpagesempty' );
126 'class' => HTMLSelectNamespace::class,
127 'name' =>
'namespace',
129 'cssclass' =>
'namespaceselector',
131 'label' => $this->
msg(
'namespace' )->text(),
136 'class' => HTMLMultiSelectField::class,
137 'label' => $this->
msg(
'protectedpages-filters' )->text(),
139 'options-messages' => [
140 'protectedpages-indef' =>
'indefonly',
141 'protectedpages-cascade' =>
'cascadeonly',
142 'protectedpages-noredirect' =>
'noredirect',
144 'default' => $filters,
147 'class' => HTMLSizeFilterField::class,
151 $htmlForm = HTMLForm::factory(
'ooui', $formDescriptor, $this->
getContext() )
153 ->setWrapperLegendMsg(
'protectedpages' )
154 ->setSubmitTextMsg(
'protectedpages-submit' );
156 return $htmlForm->prepareForm()->getHTML(
false );
169 foreach ( $this->restrictionStore->listAllRestrictionTypes(
true ) as $type ) {
171 $text = $this->
msg(
"restriction-$type" )->text();
176 foreach ( $m as $text => $type ) {
177 $options[$text] = $type;
182 'options' => $options,
183 'label' => $this->
msg(
'restriction-type' )->text(),
195 $options = [
'restriction-level-all' => 0 ];
199 if ( $type !=
'' && $type !=
'*' ) {
201 $options[
"restriction-level-$type"] = $type;
207 'options-messages' => $options,
208 'label-message' =>
'restriction-level',
215 return 'maintenance';
223class_alias( SpecialProtectedPages::class,
'SpecialProtectedpages' );
A class containing constants representing the names of configuration variables.
const RestrictionLevels
Name constant for the RestrictionLevels setting, for use with Config::get()
Parent class for all special pages.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getConfig()
Shortcut to get main config object.
getContext()
Gets the context this SpecialPage is executed in.
getRequest()
Get the WebRequest being used for this instance.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for 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.
A special page that lists protected pages.
getTypeMenu( $pr_type)
Creates the input label of the restriction type.
showOptions( $type, $level, $filters)
__construct(LinkBatchFactory $linkBatchFactory, IConnectionProvider $dbProvider, CommentStore $commentStore, RowCommentFormatter $rowCommentFormatter, RestrictionStore $restrictionStore)
getLevelMenu( $pr_level)
Creates the input label of the restriction level.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
execute( $par)
Default execute method Checks user permissions.