26use HTMLSelectNamespace;
54 parent::__construct(
'Protectedtitles' );
55 $this->linkBatchFactory = $linkBatchFactory;
56 $this->dbProvider = $dbProvider;
65 $type = $request->getVal( $this->IdType );
66 $level = $request->getVal( $this->IdLevel );
67 $sizetype = $request->getVal(
'sizetype' );
68 $size = $request->getIntOrNull(
'size' );
69 $NS = $request->getIntOrNull(
'namespace' );
74 $this->linkBatchFactory,
84 $this->
getOutput()->addHTML( $this->showOptions() );
86 if ( $pager->getNumRows() ) {
88 $pager->getNavigationBar() .
89 '<ul>' . $pager->getBody() .
'</ul>' .
90 $pager->getNavigationBar()
93 $this->
getOutput()->addWikiMsg(
'protectedtitlesempty' );
100 private function showOptions() {
103 'class' => HTMLSelectNamespace::class,
104 'name' =>
'namespace',
106 'cssclass' =>
'namespaceselector',
108 'label' => $this->
msg(
'namespace' )->text()
110 'levelmenu' => $this->getLevelMenu()
113 $htmlForm = HTMLForm::factory(
'ooui', $formDescriptor, $this->
getContext() )
115 ->setWrapperLegendMsg(
'protectedtitles' )
116 ->setSubmitTextMsg(
'protectedtitles-submit' );
118 return $htmlForm->prepareForm()->getHTML(
false );
124 private function getLevelMenu() {
125 $options = [
'restriction-level-all' => 0 ];
129 if ( $type !=
'' && $type !=
'*' ) {
131 $options[
"restriction-level-$type"] = $type;
136 if ( count( $options ) <= 2 ) {
142 'options-messages' => $options,
143 'label-message' =>
'restriction-level',
150 return 'maintenance';
158class_alias( SpecialProtectedTitles::class,
'SpecialProtectedtitles' );
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.