45 parent::__construct(
'Protectedtitles' );
46 $this->linkBatchFactory = $linkBatchFactory;
47 $this->dbProvider = $dbProvider;
56 $level = $request->getVal(
'level' );
57 $NS = $request->getIntOrNull(
'namespace' );
62 $this->linkBatchFactory,
68 $this->
getOutput()->addHTML( $this->showOptions() );
70 if ( $pager->getNumRows() ) {
72 $pager->getNavigationBar() .
73 '<ul>' . $pager->getBody() .
'</ul>' .
74 $pager->getNavigationBar()
77 $this->
getOutput()->addWikiMsg(
'protectedtitlesempty' );
84 private function showOptions() {
87 'class' => HTMLSelectNamespace::class,
88 'name' =>
'namespace',
90 'cssclass' =>
'namespaceselector',
92 'label' => $this->
msg(
'namespace' )->text()
94 'levelmenu' => $this->getLevelMenu()
97 $htmlForm = HTMLForm::factory(
'ooui', $formDescriptor, $this->
getContext() )
99 ->setWrapperLegendMsg(
'protectedtitles' )
100 ->setSubmitTextMsg(
'protectedtitles-submit' );
102 return $htmlForm->prepareForm()->getHTML(
false );
108 private function getLevelMenu() {
109 $options = [
'restriction-level-all' => 0 ];
113 if ( $type !=
'' && $type !=
'*' ) {
115 $options[
"restriction-level-$type"] = $type;
120 if ( count( $options ) <= 2 ) {
126 'options-messages' => $options,
127 'label-message' =>
'restriction-level',
134 return 'maintenance';
142class_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.