112 return strtolower( $this->
getName() );
131 $onSubmit = [ $this,
'onSubmit' ];
133 if ( $this->reauthPostData ) {
138 $oldRequest, $this->reauthPostData + $oldRequest->getQueryValues(),
true
143 $onSubmit =
static function () {
148 $form = HTMLForm::factory(
155 $form->setMethod(
'get' );
157 $form->setSubmitCallback( $onSubmit );
165 if ( !$headerMsg->isDisabled() ) {
166 $form->addHeaderHtml( $headerMsg->parseAsBlock() );
171 $form->addPreHtml( MWDebug::detectDeprecatedOverride( $this, __CLASS__,
'preText',
'1.38' )
175 $form->addPostHtml( MWDebug::detectDeprecatedOverride( $this, __CLASS__,
'postText',
'1.38' )
183 if ( strval( $this->par ) !==
'' && $field ) {
184 $this->
getRequest()->setVal( $form->getField( $field )->getName(), $this->par );
188 if ( $form->getMethod() ==
'post' ) {
191 $this->
getRequest()->getQueryValues(), [
'title' =>
null ] );
241 $result = $this->
getShowAlways() ? $form->showAlways() : $form->show();
243 $result = $form->prepareForm()->tryAuthorizedSubmit();
245 if ( $result ===
true || ( $result instanceof
Status && $result->
isGood() ) ) {
287 if ( $block && $block->isSitewide() ) {
334 $this->reauthPostData = $data;
339class_alias( FormSpecialPage::class,
'FormSpecialPage' );
wfArrayToCgi( $array1, $array2=null, $prefix='')
This function takes one or two arrays as input, and returns a CGI-style string, e....
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Logs a warning that a deprecated feature was used.
array $params
The job parameters.
An IContextSource implementation which will inherit context from another source but allow individual ...
Special page which uses an HTMLForm to handle processing.
getMessagePrefix()
Get message prefix for HTMLForm.
requiresUnblock()
Whether this action cannot be executed by a blocked user, default to requiresPost()
onSuccess()
Do something exciting on successful processing of the form, most likely to show a confirmation messag...
requiresPost()
Whether this action should using POST method to submit, default to true.
getShowAlways()
Whether the form should always be shown despite the success of submission.
getForm()
Get the HTMLForm to control behavior.
postText()
Add post-text to the form.
setParameter( $par)
Maybe do something interesting with the subpage parameter.
execute( $par)
Basic SpecialPage workflow: get a form, send it to the user; get some data back,.
requiresWrite()
Whether this action requires the wiki not to be locked, default to requiresPost()
alterForm(HTMLForm $form)
Play with the HTMLForm if you need to more substantially.
setReauthPostData(array $data)
Preserve POST data across reauthentication.
string null $par
The subpage of the special page.
array null $reauthPostData
POST data preserved across re-authentication.
getSubpageField()
Override this function to set the field name used in the subpage syntax.
preText()
Add pre-text to the form.
checkExecutePermissions(User $user)
Called from execute() to check if the given user can perform this action.
getFormFields()
Get an HTMLForm descriptor array.
preHtml()
Add pre-HTML to the form.
onSubmit(array $data)
Process the form on submission.
getDisplayFormat()
Get display format for the form.
postHtml()
Add post-HTML to the form.
Parent class for all special pages.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getUser()
Shortcut to get the User executing this instance.
getPageTitle( $subpage=false)
Get a self-referential title object.
checkPermissions()
Checks if userCanExecute, and if not throws a PermissionsError.
checkReadOnly()
If the wiki is currently in readonly mode, throws a ReadOnlyError.
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.
getLoginSecurityLevel()
Tells if the special page does something security-sensitive and needs extra defense against a stolen ...
including( $x=null)
Whether the special page is being evaluated via transclusion.
getLanguage()
Shortcut to get user's language.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages By default the message key is the canonical name of...
getName()
Get the canonical, unlocalized name of this special page without namespace.
checkLoginSecurityLevel( $level=null)
Verifies that the user meets the security level, possibly reauthenticating them in the process.
isGood()
Returns whether the operation completed and didn't have any error or warnings.
Show an error when the user tries to do something whilst blocked.