BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
EditPage Class Reference

Public Member Functions

 __construct (Article $article)
 
 getArticle ()
 
 getTitle ()
 
 setContextTitle ($title)
 
 getContextTitle ()
 
 isSupportedContentModel ($modelId)
 
 setApiEditOverride ($enableOverride)
 
 submit ()
 
 edit ()
 
 importFormData (&$request)
 
 initialiseForm ()
 
 getParentRevId ()
 
 setPreloadedContent (Content $content)
 
 attemptSave (&$resultDetails=false)
 
 internalAttemptSave (&$result, $bot=false)
 
 getBaseRevision ()
 
 setHeaders ()
 
 showEditForm ($formCallback=null)
 
 getSummaryInput ($summary="", $labelText=null, $inputAttrs=null, $spanLabelAttrs=null)
 
 showDiff ()
 
 getCancelLink ()
 
 getPreviewText ()
 
 getTemplates ()
 
 getCheckboxes (&$tabindex, $checked)
 
 getEditButtons (&$tabindex)
 
 noSuchSectionPage ()
 
 spamPageWithContent ($match=false)
 

Static Public Member Functions

static matchSpamRegex ($text)
 
static matchSummarySpamRegex ($text)
 
static extractSectionTitle ($text)
 
static getCopyrightWarning ($title, $format= 'plain')
 
static getPreviewLimitReport ($output)
 
static getEditToolbar ($title=null)
 

Public Attributes

const AS_SUCCESS_UPDATE = 200
 
const AS_SUCCESS_NEW_ARTICLE = 201
 
const AS_HOOK_ERROR = 210
 
const AS_HOOK_ERROR_EXPECTED = 212
 
const AS_BLOCKED_PAGE_FOR_USER = 215
 
const AS_CONTENT_TOO_BIG = 216
 
const AS_READ_ONLY_PAGE_ANON = 218
 
const AS_READ_ONLY_PAGE_LOGGED = 219
 
const AS_READ_ONLY_PAGE = 220
 
const AS_RATE_LIMITED = 221
 
const AS_ARTICLE_WAS_DELETED = 222
 
const AS_NO_CREATE_PERMISSION = 223
 
const AS_BLANK_ARTICLE = 224
 
const AS_CONFLICT_DETECTED = 225
 
const AS_SUMMARY_NEEDED = 226
 
const AS_TEXTBOX_EMPTY = 228
 
const AS_MAX_ARTICLE_SIZE_EXCEEDED = 229
 
const AS_END = 231
 
const AS_SPAM_ERROR = 232
 
const AS_IMAGE_REDIRECT_ANON = 233
 
const AS_IMAGE_REDIRECT_LOGGED = 234
 
const AS_NO_CHANGE_CONTENT_MODEL = 235
 
const AS_SELF_REDIRECT = 236
 
const AS_CHANGE_TAG_ERROR = 237
 
const AS_PARSE_ERROR = 240
 
const AS_CANNOT_USE_CUSTOM_MODEL = 241
 
const EDITFORM_ID = 'editform'
 
const POST_EDIT_COOKIE_KEY_PREFIX = 'PostEditRevision'
 
const POST_EDIT_COOKIE_DURATION = 1200
 
 $mArticle
 
 $mTitle
 
 $action = 'submit'
 
 $isConflict = false
 
 $isCssJsSubpage = false
 
 $isCssSubpage = false
 
 $isJsSubpage = false
 
 $isWrongCaseCssJsPage = false
 
 $isNew = false
 
 $deletedSinceEdit
 
 $formtype
 
 $firsttime
 
 $lastDelete
 
 $mTokenOk = false
 
 $mTokenOkExceptSuffix = false
 
 $mTriedSave = false
 
 $incompleteForm = false
 
 $tooBig = false
 
 $kblength = false
 
 $missingComment = false
 
 $missingSummary = false
 
 $allowBlankSummary = false
 
 $autoSumm = ''
 
 $hookError = ''
 
 $mParserOutput
 
 $hasPresetSummary = false
 
 $mBaseRevision = false
 
 $mShowSummaryField = true
 
 $save = false
 
 $preview = false
 
 $diff = false
 
 $minoredit = false
 
 $watchthis = false
 
 $recreate = false
 
 $textbox1 = ''
 
 $textbox2 = ''
 
 $summary = ''
 
 $nosummary = false
 
 $edittime = ''
 
 $section = ''
 
 $sectiontitle = ''
 
 $starttime = ''
 
 $oldid = 0
 
 $parentRevId = 0
 
 $editintro = ''
 
 $scrolltop = null
 
 $bot = true
 
 $contentModel = null
 
 $contentFormat = null
 
 $editFormPageTop = ''
 
 $editFormTextTop = ''
 
 $editFormTextBeforeContent = ''
 
 $editFormTextAfterWarn = ''
 
 $editFormTextAfterTools = ''
 
 $editFormTextBottom = ''
 
 $editFormTextAfterContent = ''
 
 $previewTextAfterContent = ''
 
 $mPreloadContent = null
 
 $didSave = false
 
 $undidRev = 0
 
 $suppressIntro = false
 

Protected Member Functions

 getEditPermissionErrors ($rigor= 'secure')
 
 displayPermissionsError (array $permErrors)
 
 displayViewSourcePage (Content $content, $errorMessage= '')
 
 previewOnOpen ()
 
 isWrongCaseCssJsPage ()
 
 isSectionEditSupported ()
 
 importContentFormData (&$request)
 
 getContentObject ($def_content=null)
 
 getCurrentContent ()
 
 getPreloadedContent ($preload, $params=[])
 
 setPostEditCookie ($statusValue)
 
 runPostMergeFilters (Content $content, Status $status, User $user)
 
 addContentModelChangeLogEntry (User $user, $oldModel, $newModel, $reason)
 
 updateWatchlist ()
 
 showIntro ()
 
 showCustomIntro ()
 
 toEditText ($content)
 
 toEditContent ($text)
 
 showSummaryInput ($isSubjectPreview, $summary="")
 
 getSummaryPreview ($isSubjectPreview, $summary="")
 
 showFormBeforeText ()
 
 showFormAfterText ()
 
 showContentForm ()
 
 showTextbox1 ($customAttribs=null, $textoverride=null)
 
 showTextbox2 ()
 
 showTextbox ($text, $name, $customAttribs=[])
 
 displayPreviewArea ($previewOutput, $isOnTop=false)
 
 showPreview ($text)
 
 showHeaderCopyrightWarning ()
 
 showTosSummary ()
 
 showEditTools ()
 
 getCopywarn ()
 
 showStandardInputs (&$tabindex=2)
 
 showConflict ()
 
 getActionURL (Title $title)
 
 wasDeletedSinceLastEdit ()
 
 getLastDelete ()
 
 safeUnicodeInput ($request, $field)
 
 safeUnicodeOutput ($text)
 

Static Protected Member Functions

static matchSpamRegexInternal ($text, $regexes)
 

Protected Attributes

 $blankArticle = false
 
 $allowBlankArticle = false
 
 $selfRedirect = false
 
 $allowSelfRedirect = false
 
 $edit
 

Detailed Description

The edit page/HTML interface (split from Article) The actual database and text munging is still in Article, but it should get easier to call those from alternate interfaces.

EditPage cares about two distinct titles: $this->mContextTitle is the page that forms submit to, links point to, redirects go to, etc. $this->mTitle (as well as $mArticle) is the page in the database that is actually being edited. These are usually the same, but they are now allowed to be different.

Surgeon General's Warning: prolonged exposure to this class is known to cause headaches, which may be fatal.

Constructor & Destructor Documentation

EditPage::__construct ( Article  $article)
Parameters
Article$article

Member Function Documentation

EditPage::addContentModelChangeLogEntry ( User  $user,
  $oldModel,
  $newModel,
  $reason 
)
protected
Parameters
User$user
string | false$oldModelfalse if the page is being newly created
string$newModel
string$reason
EditPage::attemptSave ( $resultDetails = false)

Attempt submission

Parameters
array$resultDetailsSee docs for $result in internalAttemptSave
Exceptions
UserBlockedError|ReadOnlyError|ThrottledError|PermissionsError
Returns
Status The resulting status object.
EditPage::displayPermissionsError ( array  $permErrors)
protected

Display a permissions error page, like OutputPage::showPermissionsErrorPage(), but with the following differences:

  • If redlink=1, the user will be redirected to the page
  • If there is content to display or the error occurs while either saving, previewing or showing the difference, it will be a "View source for ..." page displaying the source code after the error message.
Since
1.19
Parameters
array$permErrorsArray of permissions errors, as returned by Title::getUserPermissionsErrors().
Exceptions
PermissionsError
EditPage::displayViewSourcePage ( Content  $content,
  $errorMessage = '' 
)
protected

Display a read-only View Source page

Parameters
Content$contentcontent object
string$errorMessageadditional wikitext error message to display
EditPage::edit ( )

This is the function that gets called for "action=edit". It sets up various member variables, then passes execution to another function, usually showEditForm()

The edit form is self-submitting, so that when things like preview and edit conflicts occur, we get the same form back with the extra stuff added. Only when the final submission is made and all is well do we actually save and redirect to the newly-edited page.

static EditPage::extractSectionTitle (   $text)
static

Extract the section title from current section text, if any.

Parameters
string$text
Returns
string|bool String or false
EditPage::getActionURL ( Title  $title)
protected

Returns the URL to use in the form's action attribute. This is used by EditPage subclasses when simply customizing the action variable in the constructor is not enough. This can be used when the EditPage lives inside of a Special page rather than a custom page action.

Parameters
Title$titleTitle object for which is being edited (where we go to for &action= links)
Returns
string
EditPage::getArticle ( )
Returns
Article
EditPage::getBaseRevision ( )
Note
: this method is very poorly named. If the user opened the form with ?oldid=X, one might think of X as the "base revision", which is NOT what this returns.
Returns
Revision Current version when the edit was started
EditPage::getCancelLink ( )
Returns
string
EditPage::getCheckboxes ( $tabindex,
  $checked 
)

Returns an array of html code of the following checkboxes: minor and watch

Parameters
int$tabindexCurrent tabindex
array$checkedArray of checkbox => bool, where bool indicates the checked status of the checkbox
Returns
array
EditPage::getContentObject (   $def_content = null)
protected
Parameters
Content | null$def_contentThe default value to return
Returns
Content|null Content on success, $def_content for invalid sections
Since
1.21
EditPage::getContextTitle ( )

Get the context title object. If not set, $wgTitle will be returned. This behavior might change in the future to return $this->mTitle instead.

Returns
Title
static EditPage::getCopyrightWarning (   $title,
  $format = 'plain' 
)
static

Get the copyright warning, by default returns wikitext

Parameters
Title$title
string$formatOutput format, valid values are any function of a Message object
Returns
string
EditPage::getCopywarn ( )
protected

Get the copyright warning

Renamed to getCopyrightWarning(), old name kept around for backwards compatibility

Returns
string
EditPage::getCurrentContent ( )
protected

Get the current content of the page. This is basically similar to WikiPage::getContent( Revision::RAW ) except that when the page doesn't exist an empty content object is returned instead of null.

Since
1.21
Returns
Content
EditPage::getEditButtons ( $tabindex)

Returns an array of html code of the following buttons: save, diff, preview and live

Parameters
int$tabindexCurrent tabindex
Returns
array
EditPage::getEditPermissionErrors (   $rigor = 'secure')
protected
Parameters
string$rigorSame format as Title::getUserPermissionErrors()
Returns
array
static EditPage::getEditToolbar (   $title = null)
static

Shows a bulletin board style toolbar for common editing functions. It can be disabled in the user preferences.

Parameters
Title$titleTitle object for the page being edited (optional)
Returns
string

$toolarray is an array of arrays each of which includes the opening tag, the closing tag, optionally a sample text that is inserted between the two when no selection is highlighted and. The tip text is shown when the user moves the mouse over the button.

Images are defined in ResourceLoaderEditToolbarModule.

EditPage::getLastDelete ( )
protected
Returns
bool|stdClass
EditPage::getParentRevId ( )

Get the edit's parent revision ID

The "parent" revision is the ancestor that should be recorded in this page's revision history. It is either the revision ID of the in-memory article content, or in the case of a 3-way merge in order to rebase across a recoverable edit conflict, the ID of the newer revision to which we have rebased this page.

Since
1.27
Returns
int Revision ID
EditPage::getPreloadedContent (   $preload,
  $params = [] 
)
protected

Get the contents to be preloaded into the box, either set by an earlier setPreloadText() or by loading the given page.

Parameters
string$preloadRepresenting the title to preload from.
array$paramsParameters to use (interface-message style) in the preloaded text
Returns
Content
Since
1.21
static EditPage::getPreviewLimitReport (   $output)
static

Get the Limit report for page previews

Since
1.22
Parameters
ParserOutput$outputParserOutput object from the parse
Returns
string HTML
EditPage::getPreviewText ( )

Get the rendered text for previewing.

Exceptions
MWException
Returns
string
EditPage::getSummaryInput (   $summary = "",
  $labelText = null,
  $inputAttrs = null,
  $spanLabelAttrs = null 
)

Standard summary input and label (wgSummary), abstracted so EditPage subclasses may reorganize the form. Note that you do not need to worry about the label's for=, it will be inferred by the id given to the input. You can remove them both by passing array( 'id' => false ) to $userInputAttrs.

Parameters
string$summaryThe value of the summary input
string$labelTextThe html to place inside the label
array$inputAttrsArray of attrs to use on the input
array$spanLabelAttrsArray of attrs to use on the span inside the label
Returns
array An array in the format array( $label, $input )
EditPage::getSummaryPreview (   $isSubjectPreview,
  $summary = "" 
)
protected
Parameters
bool$isSubjectPreviewTrue if this is the section subject/title up top, or false if this is the comment summary down below the textarea
string$summaryThe text of the summary to display
Returns
string
EditPage::getTemplates ( )
Returns
array
EditPage::getTitle ( )
Since
1.19
Returns
Title
EditPage::importContentFormData ( $request)
protected

Subpage overridable method for extracting the page content data from the posted form to be placed in $this->textbox1, if using customized input this method should be overridden and return the page text that will be used for saving, preview parsing and so on...

Parameters
WebRequest$request
Returns
string|null
EditPage::importFormData ( $request)

This function collects the form data and uses it to populate various member variables.

Parameters
WebRequest$request
Exceptions
ErrorPageError
Todo:
Check if the desired model is allowed in this namespace, and if a transition from the page's current model to the new model is allowed.
EditPage::initialiseForm ( )

Initialise form fields in the object Called on the first invocation, e.g. when a user clicks an edit link

Returns
bool If the requested section is valid
EditPage::internalAttemptSave ( $result,
  $bot = false 
)

Attempt submission (no UI)

Parameters
array$resultArray to add statuses to, currently with the possible keys:
  • spam (string): Spam string from content if any spam is detected by matchSpamRegex.
  • sectionanchor (string): Section anchor for a section save.
  • nullEdit (boolean): Set if doEditContent is OK. True if null edit, false otherwise.
  • redirect (bool): Set if doEditContent is OK. True if resulting revision is a redirect.
bool$botTrue if edit is being made under the bot right.
Returns
Status Status object, possibly with a message, but always with one of the AS_* constants in $status->value,
Todo:
FIXME: This interface is TERRIBLE, but hard to get rid of due to various error display idiosyncrasies. There are also lots of cases where error metadata is set in the object and retrieved later instead of being returned, e.g. AS_CONTENT_TOO_BIG and AS_BLOCKED_PAGE_FOR_USER. All that stuff needs to be cleaned up some time.
EditPage::isSectionEditSupported ( )
protected

Returns whether section editing is supported for the current page. Subclasses may override this to replace the default behavior, which is to check ContentHandler::supportsSections.

Returns
bool True if this edit page supports sections, false otherwise.
EditPage::isSupportedContentModel (   $modelId)

Returns if the given content model is editable.

Parameters
string$modelIdThe ID of the content model to test. Use CONTENT_MODEL_XXX constants.
Returns
bool
Exceptions
MWExceptionIf $modelId has no known handler
EditPage::isWrongCaseCssJsPage ( )
protected

Checks whether the user entered a skin name in uppercase, e.g. "User:Example/Monobook.css" instead of "monobook.css"

Returns
bool
static EditPage::matchSpamRegex (   $text)
static

Check given input text against $wgSpamRegex, and return the text of the first match.

Parameters
string$text
Returns
string|bool Matching string or false
static EditPage::matchSpamRegexInternal (   $text,
  $regexes 
)
staticprotected
Parameters
string$text
array$regexes
Returns
bool|string
static EditPage::matchSummarySpamRegex (   $text)
static

Check given input text against $wgSummarySpamRegex, and return the text of the first match.

Parameters
string$text
Returns
string|bool Matching string or false
EditPage::noSuchSectionPage ( )

Creates a basic error page which informs the user that they have attempted to edit a nonexistent section.

EditPage::previewOnOpen ( )
protected

Should we show a preview when the edit form is first shown?

Returns
bool
EditPage::runPostMergeFilters ( Content  $content,
Status  $status,
User  $user 
)
protected

Run hooks that can filter edits just before they get saved.

Parameters
Content$contentThe Content to filter.
Status$statusFor reporting the outcome to the caller
User$userThe user performing the edit
Returns
bool
EditPage::safeUnicodeInput (   $request,
  $field 
)
protected

Filter an input field through a Unicode de-armoring process if it came from an old browser with known broken Unicode editing issues.

Parameters
WebRequest$request
string$field
Returns
string
EditPage::safeUnicodeOutput (   $text)
protected

Filter an output field through a Unicode armoring process if it is going to an old browser with known broken Unicode editing issues.

Parameters
string$text
Returns
string
EditPage::setApiEditOverride (   $enableOverride)

Allow editing of content that supports API direct editing, but not general direct editing. Set to false by default.

Parameters
bool$enableOverride
EditPage::setContextTitle (   $title)

Set the context Title object

Parameters
Title | null$titleTitle object or null
EditPage::setPostEditCookie (   $statusValue)
protected

Sets post-edit cookie indicating the user just saved a particular revision.

This uses a temporary cookie for each revision ID so separate saves will never interfere with each other.

The cookie is deleted in the mediawiki.action.view.postEdit JS module after the redirect. It must be clearable by JavaScript code, so it must not be marked HttpOnly. The JavaScript code converts the cookie to a wgPostEdit config variable.

If the variable were set on the server, it would be cached, which is unwanted since the post-edit state should only apply to the load right after the save.

Parameters
int$statusValueThe status value (to check for new article status)
EditPage::setPreloadedContent ( Content  $content)

Use this method before edit() to preload some content into the edit box

Parameters
Content$content
Since
1.21
EditPage::showConflict ( )
protected

Show an edit conflict. textbox1 is already shown in showEditForm(). If you want to use another entry point to this function, be careful.

EditPage::showContentForm ( )
protected

Subpage overridable method for printing the form for page content editing By default this simply outputs wpTextbox1 Subclasses can override this to provide a custom UI for editing; be it a form, or simply wpTextbox1 with a modified content that will be reverse modified when extracted from the post data. Note that this is basically the inverse for importContentFormData

EditPage::showCustomIntro ( )
protected

Attempt to show a custom editing introduction, if supplied

Returns
bool
EditPage::showDiff ( )

Get a diff between the current contents of the edit box and the version of the page we're editing from.

If this is a section edit, we'll replace the section as for final save and then make a comparison.

EditPage::showEditForm (   $formCallback = null)

Send the edit form and related headers to $wgOut

Parameters
callable | null$formCallbackThat takes an OutputPage parameter; will be called during form output near the top, for captchas and the like.

The $formCallback parameter is deprecated since MediaWiki 1.25. Please use the EditPage::showEditForm:fields hook instead.

EditPage::showFormAfterText ( )
protected

To make it harder for someone to slip a user a page which submits an edit form to the wiki without their knowledge, a random token is associated with the login session. If it's not passed back with the submission, we won't save the page, or render user JavaScript and CSS previews.

For anon editors, who may not have a session, we just include the constant suffix to prevent editing from broken text-mangling proxies.

EditPage::showHeaderCopyrightWarning ( )
protected

Show the header copyright warning.

EditPage::showIntro ( )
protected

Show all applicable editing introductions

EditPage::showPreview (   $text)
protected

Append preview output to $wgOut. Includes category rendering if this is a category page.

Parameters
string$textThe HTML to be output for the preview.
EditPage::showSummaryInput (   $isSubjectPreview,
  $summary = "" 
)
protected
Parameters
bool$isSubjectPreviewTrue if this is the section subject/title up top, or false if this is the comment summary down below the textarea
string$summaryThe text of the summary to display
EditPage::showTextbox1 (   $customAttribs = null,
  $textoverride = null 
)
protected

Method to output wpTextbox1 The $textoverride method can be used by subclasses overriding showContentForm to pass back to this method.

Parameters
array$customAttribsArray of html attributes to use in the textarea
string$textoverrideOptional text to override $this->textarea1 with
EditPage::showTosSummary ( )
protected

Give a chance for site and per-namespace customizations of terms of service summary link that might exist separately from the copyright notice.

This will display between the save button and the edit tools, so should remain short!

EditPage::spamPageWithContent (   $match = false)

Show "your edit contains spam" page with your diff and text

Parameters
string | array | bool$matchText (or array of texts) which triggered one or more filters
EditPage::toEditContent (   $text)
protected

Turns the given text into a Content object by unserializing it.

If the resulting Content object is not of a type that can be edited using the text base EditPage, an exception will be raised. Set $this->allowNonTextContent to true to allow editing of non-textual content.

Parameters
string | null | bool$textText to unserialize
Returns
Content The content object created from $text. If $text was false or null, false resp. null will be returned instead.
Exceptions
MWExceptionIf unserializing the text results in a Content object that is not an instance of TextContent and $this->allowNonTextContent is not true.
EditPage::toEditText (   $content)
protected

Gets an editable textual representation of $content. The textual representation can be turned by into a Content object by the toEditContent() method.

If $content is null or false or a string, $content is returned unchanged.

If the given Content object is not of a type that can be edited using the text base EditPage, an exception will be raised. Set $this->allowNonTextContent to true to allow editing of non-textual content.

Parameters
Content | null | bool | string$content
Returns
string The editable text form of the content.
Exceptions
MWExceptionIf $content is not an instance of TextContent and $this->allowNonTextContent is not true.
EditPage::updateWatchlist ( )
protected

Register the change of watch status

EditPage::wasDeletedSinceLastEdit ( )
protected

Check if a page was deleted while the user was editing it, before submit. Note that we rely on the logging table, which hasn't been always there, but that doesn't matter, because this only applies to brand new deletes.

Returns
bool

Member Data Documentation

const EditPage::AS_ARTICLE_WAS_DELETED = 222

Status: article was deleted while editing and param wpRecreate == false or form was not posted

const EditPage::AS_BLANK_ARTICLE = 224

Status: user tried to create a blank page and wpIgnoreBlankArticle == false

const EditPage::AS_BLOCKED_PAGE_FOR_USER = 215

Status: User is blocked from editing this page

const EditPage::AS_CANNOT_USE_CUSTOM_MODEL = 241

Status: when changing the content model is disallowed due to $wgContentHandlerUseDB being false

const EditPage::AS_CHANGE_TAG_ERROR = 237

Status: an error relating to change tagging. Look at the message key for more details

const EditPage::AS_CONFLICT_DETECTED = 225

Status: (non-resolvable) edit conflict

const EditPage::AS_CONTENT_TOO_BIG = 216

Status: Content too big (> $wgMaxArticleSize)

const EditPage::AS_END = 231

Status: WikiPage::doEdit() was unsuccessful

const EditPage::AS_HOOK_ERROR = 210

Status: Article update aborted by a hook function

const EditPage::AS_HOOK_ERROR_EXPECTED = 212

Status: A hook function returned an error

const EditPage::AS_IMAGE_REDIRECT_ANON = 233

Status: anonymous user is not allowed to upload (User::isAllowed('upload') == false)

const EditPage::AS_IMAGE_REDIRECT_LOGGED = 234

Status: logged in user is not allowed to upload (User::isAllowed('upload') == false)

const EditPage::AS_MAX_ARTICLE_SIZE_EXCEEDED = 229

Status: article is too big (> $wgMaxArticleSize), after merging in the new section

const EditPage::AS_NO_CHANGE_CONTENT_MODEL = 235

Status: user tried to modify the content model, but is not allowed to do that ( User::isAllowed('editcontentmodel') == false )

const EditPage::AS_NO_CREATE_PERMISSION = 223

Status: user tried to create this page, but is not allowed to do that ( Title->userCan('create') == false )

const EditPage::AS_PARSE_ERROR = 240

Status: can't parse content

const EditPage::AS_RATE_LIMITED = 221

Status: rate limiter for action 'edit' was tripped

const EditPage::AS_READ_ONLY_PAGE = 220

Status: wiki is in readonly mode (wfReadOnly() == true)

const EditPage::AS_READ_ONLY_PAGE_ANON = 218

Status: this anonymous user is not allowed to edit this page

const EditPage::AS_READ_ONLY_PAGE_LOGGED = 219

Status: this logged in user is not allowed to edit this page

const EditPage::AS_SELF_REDIRECT = 236

Status: user tried to create self-redirect (redirect to the same article) and wpIgnoreSelfRedirect == false

const EditPage::AS_SPAM_ERROR = 232

Status: summary contained spam according to one of the regexes in $wgSummarySpamRegex

const EditPage::AS_SUCCESS_NEW_ARTICLE = 201

Status: Article successfully created

const EditPage::AS_SUCCESS_UPDATE = 200

Status: Article successfully updated

const EditPage::AS_SUMMARY_NEEDED = 226

Status: no edit summary given and the user has forceeditsummary set and the user is not editing in his own userspace or talkspace and wpIgnoreBlankSummary == false

const EditPage::AS_TEXTBOX_EMPTY = 228

Status: user tried to create a new section without content

const EditPage::EDITFORM_ID = 'editform'

HTML id and name for the beginning of the edit form.

const EditPage::POST_EDIT_COOKIE_DURATION = 1200

Duration of PostEdit cookie, in seconds. The cookie will be removed instantly if the JavaScript runs.

Otherwise, though, we don't want the cookies to accumulate. RFC 2109 ( https://www.ietf.org/rfc/rfc2109.txt ) specifies a possible limit of only 20 cookies per domain. This still applies at least to some versions of IE without full updates: https://blogs.msdn.com/b/ieinternals/archive/2009/08/20/wininet-ie-cookie-internals-faq.aspx

A value of 20 minutes should be enough to take into account slow loads and minor clock skew while still avoiding cookie accumulation when JavaScript is turned off.

const EditPage::POST_EDIT_COOKIE_KEY_PREFIX = 'PostEditRevision'

Prefix of key for cookie used to pass post-edit state. The revision id edited is added after this


The documentation for this class was generated from the following file: