51 parent::__construct(
'Protectedtitles' );
62 $type = $request->getVal( $this->IdType );
63 $level = $request->getVal( $this->IdLevel );
64 $sizetype = $request->getVal(
'sizetype' );
65 $size = $request->getIntOrNull(
'size' );
66 $NS = $request->getIntOrNull(
'namespace' );
70 $this->linkBatchFactory,
82 if ( $pager->getNumRows() ) {
84 $pager->getNavigationBar() .
85 '<ul>' . $pager->getBody() .
'</ul>' .
86 $pager->getNavigationBar()
89 $this->
getOutput()->addWikiMsg(
'protectedtitlesempty' );
107 [
'class' =>
'mw-invalidtitle' ],
119 $description = $this->
msg(
'restriction-level-' . $row->pt_create_perm )->escaped();
121 $expiry = strlen( $row->pt_expiry ) ?
122 $lang->formatExpiry( $row->pt_expiry, TS_MW ) :
125 if ( $expiry !==
'infinity' ) {
127 $description .= $this->
msg(
'comma-separator' )->escaped() . $this->
msg(
128 'protect-expiring-local',
129 $lang->userTimeAndDate( $expiry, $user ),
130 $lang->userDate( $expiry, $user ),
131 $lang->userTime( $expiry, $user )
135 return '<li>' .
$lang->specialList( $link, $description ) .
"</li>\n";
148 'class' => HTMLSelectNamespace::class,
149 'name' =>
'namespace',
151 'cssclass' =>
'namespaceselector',
153 'label' => $this->
msg(
'namespace' )->text()
160 ->setWrapperLegendMsg(
'protectedtitles' )
161 ->setSubmitTextMsg(
'protectedtitles-submit' );
163 return $htmlForm->prepareForm()->getHTML(
false );
173 $m = [ $this->
msg(
'restriction-level-all' )->text() => 0 ];
177 foreach ( $this->
getConfig()->
get( MainConfigNames::RestrictionLevels ) as
$type ) {
180 $text = $this->
msg(
"restriction-level-$type" )->text();
186 if ( count( $m ) <= 2 ) {
190 foreach ( $m as $text =>
$type ) {
191 $options[ $text ] =
$type;
196 'options' => $options,
197 'label' => $this->
msg(
'restriction-level' )->text(),
204 return 'maintenance';
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
static getInvalidTitleDescription(IContextSource $context, $namespace, $title)
Get a message saying that an invalid title was encountered.
A class containing constants representing the names of configuration variables.
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)
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
if(!isset( $args[0])) $lang