102 return strtolower( $this->
getName() );
121 $onSubmit = [ $this,
'onSubmit' ];
123 if ( $this->reauthPostData ) {
128 $oldRequest, $this->reauthPostData + $oldRequest->getQueryValues(),
true
133 $onSubmit =
static function () {
145 $form->setMethod(
'get' );
147 $form->setSubmitCallback( $onSubmit );
155 if ( !$headerMsg->isDisabled() ) {
156 $form->addHeaderText( $headerMsg->parseAsBlock() );
161 $form->addPreText( $this->
preText() );
162 $form->addPostText( $this->
postText() );
166 if ( $this->par && $field ) {
167 $this->
getRequest()->setVal( $form->getField( $field )->getName(), $this->par );
171 if ( $form->getMethod() ==
'post' ) {
173 $params = array_diff_key(
174 $this->
getRequest()->getQueryValues(), [
'title' =>
null ] );
175 $form->addHiddenField(
'redirectparams',
wfArrayToCgi( $params ) );
224 $result = $this->
getShowAlways() ? $form->showAlways() : $form->show();
226 $result = $form->prepareForm()->tryAuthorizedSubmit();
228 if ( $result ===
true || ( $result instanceof
Status && $result->
isGood() ) ) {
270 if ( $block && $block->isSitewide() ) {
317 $this->reauthPostData = $data;
wfArrayToCgi( $array1, $array2=null, $prefix='')
This function takes one or two arrays as input, and returns a CGI-style string, e....
An IContextSource implementation which will inherit context from another source but allow individual ...
Special page which uses an HTMLForm to handle processing.
string null $par
The sub-page of the special page.
array null $reauthPostData
POST data preserved across re-authentication.
getMessagePrefix()
Get message prefix for HTMLForm.
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.
getForm()
Get the HTMLForm to control behavior.
preText()
Add pre-text to the form.
alterForm(HTMLForm $form)
Play with the HTMLForm if you need to more substantially.
postText()
Add post-text to the form.
getDisplayFormat()
Get display format for the form.
preHtml()
Add pre-HTML to the form.
onSubmit(array $data)
Process the form on submission.
setReauthPostData(array $data)
Preserve POST data across reauthentication.
checkExecutePermissions(User $user)
Called from execute() to check if the given user can perform this action.
getSubpageField()
Override this function to set the field name used in the subpage syntax.
requiresUnblock()
Whether this action cannot be executed by a blocked user, default to requiresPost()
getShowAlways()
Whether the form should always be shown despite the success of submission.
postHtml()
Add post-HTML to the form.
getFormFields()
Get an HTMLForm descriptor array.
setParameter( $par)
Maybe do something interesting with the subpage parameter.
requiresWrite()
Whether this action requires the wiki not to be locked, default to requiresPost()
execute( $par)
Basic SpecialPage workflow: get a form, send it to the user; get some data back,.
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...
getName()
Get the name of this Special Page.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
checkLoginSecurityLevel( $level=null)
Verifies that the user meets the security level, possibly reauthenticating them in the process.
getUser()
Shortcut to get the User executing this instance.
checkPermissions()
Checks if userCanExecute, and if not throws a PermissionsError.
getContext()
Gets the context this SpecialPage is executed in.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getRequest()
Get the WebRequest being used for this instance.
checkReadOnly()
If the wiki is currently in readonly mode, throws a ReadOnlyError.
getPageTitle( $subpage=false)
Get a self-referential title object.
getLanguage()
Shortcut to get user's language.
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.
isGood()
Returns whether the operation completed and didn't have any error or warnings.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Show an error when the user tries to do something whilst blocked.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
getBlock( $freshness=self::READ_NORMAL, $disableIpBlockExemptChecking=false)
Get the block affecting the user, or null if the user is not blocked.