MediaWiki master
MediaWiki\EditPage Namespace Reference

Namespaces

namespace  Constraint
 

Classes

class  EditPage
 The HTML user interface for page editing. More...
 
interface  IEditObject
 Serves as a common repository of constants for EditPage edit status results. More...
 
class  IntroMessageBuilder
 Provides the intro messages (edit notices and others) to be displayed before an edit form. More...
 
class  IntroMessageList
 Encapsulates a list of edit form intro messages (as HTML) with their identifiers. More...
 
class  NotDirectlyEditableException
 
class  PageEditingHelper
 Provides helper methods used by EditPage and a future editing backend (T157658). More...
 
class  PreloadedContentBuilder
 Provides the initial content of the edit box displayed in an edit form when creating a new page or a new section. More...
 
class  SpamChecker
 Service to check if text (either content or a summary) qualifies as spam. More...
 
class  TemplatesOnThisPageFormatter
 Handles formatting for the "templates used on this page" lists. More...
 
class  TextboxBuilder
 Helps EditPage build textboxes. More...
 
class  TextConflictHelper
 Helper for displaying edit conflicts in text content models to users. More...
 

Functions

 destroyStashedData ()
 
 doReauthRedirect (PermissionStatus $status, array $queryParams, ?string $subaction=null)
 Redirect to the reauth flow on Special:UserLogin.
 
 enableReauthPopup (string $jsPopupModule, ?string $operation, bool $currentlyRequired=true)
 
 getContext ()
 
 getReauthLockButtonAttribs ()
 Return [ 'icon' => 'lock' ] to merge into a hand-built OOUI ButtonInputWidget's attribs.
 
 getReauthLockOOUIIcon ()
 Return a standalone OOUI lock IconWidget (not attached to a button).
 
 getTitle ()
 
 handleRetrievedData (array $data)
 Apply retrieved stashed user data to a page form.
 
 retrieveStashedData ()
 
 setStashKey (string $keyValue)
 
 stashDataOnPost ()
 

Variables

trait DataStashTrait
 Securely stash user-posted data in the session, modeled on AuthManagerSpecialPage::handleReauthBeforeExecute().
 

Function Documentation

◆ destroyStashedData()

MediaWiki\EditPage\destroyStashedData ( )
protected

Definition at line 99 of file DataStashTrait.php.

Referenced by MediaWiki\EditPage\EditPage\edit().

◆ doReauthRedirect()

MediaWiki\EditPage\doReauthRedirect ( PermissionStatus $status,
array $queryParams,
?string $subaction = null )
protected

Redirect to the reauth flow on Special:UserLogin.

Pass an optional $subaction so the reauth banner can pick an action-specific message (userlogin-reauth-banner-<operation>-<subaction>).

Definition at line 158 of file DataStashTrait.php.

Referenced by MediaWiki\EditPage\EditPage\edit().

◆ enableReauthPopup()

MediaWiki\EditPage\enableReauthPopup ( string $jsPopupModule,
?string $operation,
bool $currentlyRequired = true )
protected

Definition at line 108 of file DataStashTrait.php.

Referenced by MediaWiki\EditPage\EditPage\edit().

◆ getContext()

MediaWiki\EditPage\getContext ( )
abstractprotected
Returns
IContextSource

◆ getReauthLockButtonAttribs()

MediaWiki\EditPage\getReauthLockButtonAttribs ( )
protected

Return [ 'icon' => 'lock' ] to merge into a hand-built OOUI ButtonInputWidget's attribs.

Loads the icons-moderation styles module. Guard the call with your own reauth-required state.

For an HTMLForm submit button, see HTMLForm::setSubmitLockIcon(). For a standalone icon not on a button, see getReauthLockOOUIIcon().

Returns
array

Definition at line 134 of file DataStashTrait.php.

◆ getReauthLockOOUIIcon()

MediaWiki\EditPage\getReauthLockOOUIIcon ( )
protected

Return a standalone OOUI lock IconWidget (not attached to a button).

Loads the icons-moderation styles module. Guard the call with your own reauth-required state.

To attach a lock icon to a button instead, see getReauthLockButtonAttribs() (hand-built OOUI button) or HTMLForm::setSubmitLockIcon() (HTMLForm submit).

Returns
IconWidget

Definition at line 149 of file DataStashTrait.php.

◆ getTitle()

◆ handleRetrievedData()

MediaWiki\EditPage\handleRetrievedData ( array $data)
protected

Apply retrieved stashed user data to a page form.

Called from retrieveStashedData() once the stashed data has been retrieved. The default is a no-op; the exhibiting class overrides it to act on the data, typically by setting form state such as $this->textbox1.

Parameters
array<string,mixed>$data Retrieved stashed POST data (field => value)

Definition at line 52 of file DataStashTrait.php.

◆ retrieveStashedData()

MediaWiki\EditPage\retrieveStashedData ( )
protected

Definition at line 76 of file DataStashTrait.php.

Referenced by MediaWiki\EditPage\EditPage\edit().

◆ setStashKey()

MediaWiki\EditPage\setStashKey ( string $keyValue)
protected

Definition at line 33 of file DataStashTrait.php.

Referenced by MediaWiki\EditPage\EditPage\edit().

◆ stashDataOnPost()

MediaWiki\EditPage\stashDataOnPost ( )
protected

Definition at line 55 of file DataStashTrait.php.

References $request.

Referenced by MediaWiki\EditPage\EditPage\edit().

Variable Documentation

◆ DataStashTrait

trait MediaWiki::EditPage\DataStashTrait
Initial value:
{
private const int STASH_TTL = 600

Securely stash user-posted data in the session, modeled on AuthManagerSpecialPage::handleReauthBeforeExecute().

Since
1.47

Definition at line 18 of file DataStashTrait.php.