50 parent::__construct(
'Protectedtitles' );
61 $type = $request->getVal( $this->IdType );
62 $level = $request->getVal( $this->IdLevel );
63 $sizetype = $request->getVal(
'sizetype' );
64 $size = $request->getIntOrNull(
'size' );
65 $NS = $request->getIntOrNull(
'namespace' );
75 $this->linkBatchFactory,
81 if ( $pager->getNumRows() ) {
83 $pager->getNavigationBar() .
84 '<ul>' . $pager->getBody() .
'</ul>' .
85 $pager->getNavigationBar()
88 $this->
getOutput()->addWikiMsg(
'protectedtitlesempty' );
99 $title = Title::makeTitleSafe( $row->pt_namespace, $row->pt_title );
101 return Html::rawElement(
106 [
'class' =>
'mw-invalidtitle' ],
118 $description = $this->
msg(
'restriction-level-' . $row->pt_create_perm )->escaped();
120 $expiry = strlen( $row->pt_expiry ) ?
121 $lang->formatExpiry( $row->pt_expiry, TS_MW ) :
124 if ( $expiry !==
'infinity' ) {
126 $description .= $this->
msg(
'comma-separator' )->escaped() . $this->
msg(
127 'protect-expiring-local',
128 $lang->userTimeAndDate( $expiry, $user ),
129 $lang->userDate( $expiry, $user ),
130 $lang->userTime( $expiry, $user )
134 return '<li>' .
$lang->specialList( $link, $description ) .
"</li>\n";
147 'class' => HTMLSelectNamespace::class,
148 'name' =>
'namespace',
150 'cssclass' =>
'namespaceselector',
152 'label' => $this->
msg(
'namespace' )->text()
157 $htmlForm = HTMLForm::factory(
'ooui', $formDescriptor, $this->
getContext() )
159 ->setWrapperLegendMsg(
'protectedtitles' )
160 ->setSubmitTextMsg(
'protectedtitles-submit' );
162 return $htmlForm->prepareForm()->getHTML(
false );
172 $m = [ $this->
msg(
'restriction-level-all' )->text() => 0 ];
176 foreach ( $this->
getConfig()->
get(
'RestrictionLevels' ) as
$type ) {
179 $text = $this->
msg(
"restriction-level-$type" )->text();
185 if ( count( $m ) <= 2 ) {
189 foreach ( $m as $text =>
$type ) {
190 $options[ $text ] =
$type;
195 'options' => $options,
196 'label' => $this->
msg(
'restriction-level' )->text(),
203 return 'maintenance';
static getInvalidTitleDescription(IContextSource $context, $namespace, $title)
Get a message saying that an invalid title was encountered.
Parent class for all special pages.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getOutput()
Get the OutputPage being used for this instance.
getUser()
Shortcut to get the User executing this instance.
getContext()
Gets the context this SpecialPage is executed in.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getConfig()
Shortcut to get main config object.
getRequest()
Get the WebRequest being used for this instance.
getLanguage()
Shortcut to get user's language.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
A special page that list protected titles from creation.
__construct(LinkBatchFactory $linkBatchFactory, ILoadBalancer $loadBalancer)
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
formatRow( $row)
Callback function to output a restriction.
execute( $par)
Default execute method Checks user permissions.
LinkBatchFactory $linkBatchFactory
ILoadBalancer $loadBalancer
showOptions( $namespace, $type, $level)
if(!isset( $args[0])) $lang