MediaWiki REL1_39
EditPage Class Reference

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. More...

Inheritance diagram for EditPage:
Collaboration diagram for EditPage:

Public Member Functions

 __construct (Article $article)
 
 attemptSave (&$resultDetails=false)
 Attempt submission.
 
 edit ()
 This is the function that gets called for "action=edit".
 
 getArticle ()
 
 getCheckboxesDefinition ( $checked)
 Return an array of checkbox definitions.
 
 getCheckboxesWidget (&$tabindex, $checked)
 Returns an array of checkboxes for the edit form, including 'minor' and 'watch' checkboxes and any other added by extensions.
 
 getContext ()
 
 getContextTitle ()
 
 getEditButtons (&$tabindex)
 Returns an array of html code of the following buttons: save, diff and preview.
 
 getExpectedParentRevision ()
 Returns the RevisionRecord corresponding to the revision that was current at the time editing was initiated on the client even if the edit was based on an old revision.
 
 getPreviewText ()
 Get the rendered text for previewing.
 
 getTemplates ()
 
 getTitle ()
 
 importFormData (&$request)
 This function collects the form data and uses it to populate various member variables.
 
 internalAttemptSave (&$result, $markAsBot=false, $markAsMinor=false)
 Attempt submission (no UI)
 
 makeTemplatesOnThisPageList (array $templates)
 Wrapper around TemplatesOnThisPageFormatter to make a "templates on this page" list.
 
 maybeActivateTempUserCreate ( $doAcquire)
 Check the configuration and current user and enable automatic temporary user creation if possible.
 
 setApiEditOverride ( $enableOverride)
 Allow editing of content that supports API direct editing, but not general direct editing.
 
 setContextTitle ( $title)
 
 setEditConflictHelperFactory (callable $factory)
 Set a factory function to create an EditConflictHelper.
 
 setHeaders ()
 
 showDiff ()
 Get a diff between the current contents of the edit box and the version of the page we're editing from.
 
 showEditForm ( $formCallback=null)
 Send the edit form and related headers to OutputPage.
 
 spamPageWithContent ( $match=false)
 Show "your edit contains spam" page with your diff and text.
 

Static Public Member Functions

static getCopyrightWarning ( $page, $format='plain', $localizer=null)
 Get the copyright warning, by default returns wikitext.
 
static getEditToolbar ()
 Allow extensions to provide a toolbar.
 
static getPreviewLimitReport (ParserOutput $output=null)
 Get the Limit report for page previews.
 

Public Attributes

string $action = 'submit'
 
null string $contentFormat = null
 
string $contentModel
 
 $didSave = false
 
string $editFormPageTop = ''
 Before even the preview.
 
 $editFormTextAfterContent = ''
 
 $editFormTextAfterTools = ''
 
 $editFormTextAfterWarn = ''
 
 $editFormTextBeforeContent = ''
 
 $editFormTextBottom = ''
 
 $editFormTextTop = ''
 
string null $edittime = ''
 Timestamp of the latest revision of the page when editing was initiated on the client.
 
bool $firsttime
 True the first time the edit form is rendered, false after re-rendering with diff, save prompts, etc.
 
string $formtype
 
bool $isConflict = false
 Whether an edit conflict needs to be resolved.
 
bool $mShowSummaryField = true
 
int $oldid = 0
 Revision ID the edit is based on, or 0 if it's the current revision.
 
bool $preview = false
 
 $previewTextAfterContent = ''
 
bool $save = false
 
string $section = ''
 
string null $sectiontitle = null
 
string null $starttime = ''
 Timestamp from the first time the edit form was rendered.
 
string $summary = ''
 
 $suppressIntro = false
 
string $textbox1 = ''
 Page content input field.
 
string $textbox2 = ''
 
 $undidRev = 0
 
const EDITFORM_ID = 'editform'
 HTML id and name for the beginning of the edit form.
 
const POST_EDIT_COOKIE_DURATION = 1200
 Duration of PostEdit cookie, in seconds.
 
const POST_EDIT_COOKIE_KEY_PREFIX = 'PostEditRevision'
 Prefix of key for cookie used to pass post-edit state.
 
const UNICODE_CHECK = UnicodeConstraint::VALID_UNICODE
 Used for Unicode support checks.
 
- Public Attributes inherited from MediaWiki\EditPage\IEditObject
const AS_ARTICLE_WAS_DELETED = 222
 Status: article was deleted while editing and wpRecreate == false or form was not posted.
 
const AS_BLANK_ARTICLE = 224
 Status: user tried to create a blank page and wpIgnoreBlankArticle == false.
 
const AS_BLOCKED_PAGE_FOR_USER = 215
 Status: User is blocked from editing this page.
 
const AS_CHANGE_TAG_ERROR = 237
 Status: an error relating to change tagging.
 
const AS_CONFLICT_DETECTED = 225
 Status: (non-resolvable) edit conflict.
 
const AS_CONTENT_TOO_BIG = 216
 Status: Content too big (> $wgMaxArticleSize)
 
const AS_END = 231
 Status: WikiPage::doEdit() was unsuccessful.
 
const AS_HOOK_ERROR = 210
 Status: Article update aborted by a hook function.
 
const AS_HOOK_ERROR_EXPECTED = 212
 Status: A hook function returned an error.
 
const AS_IMAGE_REDIRECT_ANON = 233
 Status: anonymous user is not allowed to upload (User::isAllowed('upload') == false)
 
const AS_IMAGE_REDIRECT_LOGGED = 234
 Status: logged in user is not allowed to upload (User::isAllowed('upload') == false)
 
const AS_MAX_ARTICLE_SIZE_EXCEEDED = 229
 Status: article is too big (> $wgMaxArticleSize), after merging in the new section.
 
const 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 AS_NO_CREATE_PERMISSION = 223
 Status: user tried to create this page, but is not allowed to do that.
 
const AS_PARSE_ERROR = 240
 Status: can't parse content.
 
const AS_RATE_LIMITED = 221
 Status: rate limiter for action 'edit' was tripped.
 
const AS_READ_ONLY_PAGE = 220
 Status: wiki is in readonly mode (ReadOnlyMode::isReadOnly() == true)
 
const AS_READ_ONLY_PAGE_ANON = 218
 Status: this anonymous user is not allowed to edit this page.
 
const AS_READ_ONLY_PAGE_LOGGED = 219
 Status: this logged in user is not allowed to edit this page.
 
const AS_SELF_REDIRECT = 236
 Status: user tried to create self-redirect and wpIgnoreSelfRedirect is false.
 
const AS_SPAM_ERROR = 232
 Status: summary contained spam according to one of the regexes in $wgSummarySpamRegex.
 
const AS_SUCCESS_NEW_ARTICLE = 201
 Status: Article successfully created.
 
const AS_SUCCESS_UPDATE = 200
 Status: Article successfully updated.
 
const 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 AS_TEXTBOX_EMPTY = 228
 Status: user tried to create a new section without content.
 
const AS_UNICODE_NOT_SUPPORTED = 242
 Status: edit rejected because browser doesn't support Unicode.
 

Protected Member Functions

 addNewLineAtEnd ( $wikitext)
 
 doPreviewParse (Content $content)
 Parse the page for a preview.
 
 getActionURL (Title $title)
 Returns the URL to use in the form's action attribute.
 
 getContentObject ( $def_content=null)
 
 getCopywarn ()
 Get the copyright warning.
 
 getCurrentContent ()
 Get the current content of the page.
 
 getPreviewParserOptions ()
 Get parser options for a preview.
 
 importContentFormData (&$request)
 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...
 
 previewOnOpen ()
 Should we show a preview when the edit form is first shown?
 
 showContentForm ()
 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.
 
 showFormAfterText ()
 
 showStandardInputs (&$tabindex=2)
 
 showTextbox ( $text, $name, $customAttribs=[])
 
 toEditContent ( $text)
 Turns the given text into a Content object by unserializing it.
 

Protected Attributes

bool $blankArticle = false
 
IContextSource $context
 

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.

Stability: newable
Note
marked as newable in 1.35 for lack of a better alternative, but should be split up into service objects and command objects in the future (T157658).

Definition at line 103 of file EditPage.php.

Constructor & Destructor Documentation

◆ __construct()

EditPage::__construct ( Article $article)
Stability: stable
to call
Parameters
Article$article

Definition at line 481 of file EditPage.php.

References deprecatePublicProperty(), Config\get(), getContext(), Article\getContext(), Article\getPage(), and Article\getTitle().

Member Function Documentation

◆ addNewLineAtEnd()

EditPage::addNewLineAtEnd ( $wikitext)
protected
Parameters
string$wikitext
Returns
string
Since
1.29
Deprecated
since 1.38 Use TextboxBuilder::addNewLineAtEnd instead.

Definition at line 5005 of file EditPage.php.

References wfDeprecated().

◆ attemptSave()

EditPage::attemptSave ( & $resultDetails = false)

Attempt submission.

Parameters
array | bool&$resultDetailsSee docs for $result in internalAttemptSave
Exceptions
UserBlockedError|ReadOnlyError|ThrottledError|PermissionsError
Returns
Status

Definition at line 1896 of file EditPage.php.

References getAuthority().

◆ doPreviewParse()

EditPage::doPreviewParse ( Content $content)
protected

Parse the page for a preview.

Subclasses may override this class, in order to parse with different options, or to otherwise modify the preview HTML.

Parameters
Content$contentThe page content
Returns
array with keys:
  • parserOutput: The ParserOutput object
  • html: The HTML to be displayed

Definition at line 4522 of file EditPage.php.

References $content.

◆ edit()

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.

Definition at line 609 of file EditPage.php.

References wfDebug().

◆ getActionURL()

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

Definition at line 4259 of file EditPage.php.

References $title.

◆ getArticle()

EditPage::getArticle ( )
Returns
Article

Definition at line 536 of file EditPage.php.

◆ getCheckboxesDefinition()

EditPage::getCheckboxesDefinition ( $checked)

Return an array of checkbox definitions.

Array keys correspond to the <input> 'name' attribute to use for each checkbox.

Array values are associative arrays with the following keys:

  • 'label-message' (required): message for label text
  • 'id' (required): 'id' attribute for the <input>
  • 'default' (required): default checkedness (true or false)
  • 'title-message' (optional): used to generate 'title' attribute for the <label>
  • 'tooltip' (optional): used to generate 'title' and 'accesskey' attributes from messages like 'tooltip-foo', 'accesskey-foo'
  • 'label-id' (optional): 'id' attribute for the <label>
  • 'legacy-name' (optional): short name for backwards-compatibility
  • 'class' (optional): PHP class name of the OOUI widget to use. Defaults to CheckboxInputWidget.
  • 'options' (optional): options to use for DropdownInputWidget, ComboBoxInputWidget, etc. following the structure as given in the documentation for those classes.
  • 'value-attr' (optional): name of the widget config option for the "current value" of the widget. Defaults to 'selected'; for some widget types it should be 'value'.
    Parameters
    array$checkedArray of checkbox name (matching the 'legacy-name') => bool, where bool indicates the checked status of the checkbox
    Returns
    array[]

Definition at line 4610 of file EditPage.php.

◆ getCheckboxesWidget()

EditPage::getCheckboxesWidget ( & $tabindex,
$checked )

Returns an array of checkboxes for the edit form, including 'minor' and 'watch' checkboxes and any other added by extensions.

Parameters
int&$tabindexCurrent tabindex
array$checkedArray of checkbox => bool, where bool indicates the checked status of the checkbox
Returns
\OOUI\Element[] Associative array of string keys to \OOUI\Widget or \OOUI\Layout instances

Definition at line 4699 of file EditPage.php.

References $title, and Linker\titleAttrib().

◆ getContentObject()

EditPage::getContentObject ( $def_content = null)
protected
Parameters
Content | null$def_contentThe default value to return
Returns
Content|false|null Content on success, $def_content for invalid sections
Since
1.21

Definition at line 1455 of file EditPage.php.

References $content, getAuthority(), Content\getSection(), and NS_MEDIAWIKI.

◆ getContext()

EditPage::getContext ( )
Since
1.28
Returns
IContextSource

Definition at line 544 of file EditPage.php.

References $context.

Referenced by __construct().

◆ getContextTitle()

EditPage::getContextTitle ( )
Exceptions
RuntimeExceptionif no context title was set
Returns
Title

Definition at line 567 of file EditPage.php.

◆ getCopyrightWarning()

static EditPage::getCopyrightWarning ( $page,
$format = 'plain',
$localizer = null )
static

Get the copyright warning, by default returns wikitext.

Parameters
PageReference$page
string$formatOutput format, valid values are any function of a Message object
MessageLocalizer | Language | string | null$localizerA MessageLocalizer. For backwards-compatibility, a Language object, or a string language code, or omitting the parameter is also allowed, but emits deprecation warnings since 1.38.
Returns
string

Definition at line 4079 of file EditPage.php.

References $title, and wfDeprecated().

◆ getCopywarn()

EditPage::getCopywarn ( )
protected

Get the copyright warning.

Deprecated
since 1.38 Use getCopyrightWarning() instead.
Returns
string

Definition at line 4064 of file EditPage.php.

References getContext(), and wfDeprecated().

◆ getCurrentContent()

EditPage::getCurrentContent ( )
protected

Get the current content of the page.

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

Since
1.21
Returns
Content

Definition at line 1734 of file EditPage.php.

References $content.

◆ getEditButtons()

EditPage::getEditButtons ( & $tabindex)

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

Parameters
int&$tabindexCurrent tabindex
Returns
string[] Strings or objects with a __toString() implementation. Usually an array of {
See also
ButtonInputWidget}, but EditPageBeforeEditButtons hook handlers might inject something else.

Definition at line 4774 of file EditPage.php.

References Linker\accesskey(), and Linker\titleAttrib().

◆ getEditToolbar()

static EditPage::getEditToolbar ( )
static

Allow extensions to provide a toolbar.

Returns
string|null

Definition at line 4574 of file EditPage.php.

◆ getExpectedParentRevision()

EditPage::getExpectedParentRevision ( )

Returns the RevisionRecord corresponding to the revision that was current at the time editing was initiated on the client even if the edit was based on an old revision.

Since
1.35
Returns
RevisionRecord|null Current revision when editing was initiated on the client

Definition at line 2826 of file EditPage.php.

References getTitle().

◆ getPreviewLimitReport()

static EditPage::getPreviewLimitReport ( ParserOutput $output = null)
static

Get the Limit report for page previews.

Since
1.22
Parameters
ParserOutput | null$outputParserOutput object from the parse
Returns
string HTML

Definition at line 4117 of file EditPage.php.

References wfMessage().

Referenced by ApiParse\execute().

◆ getPreviewParserOptions()

EditPage::getPreviewParserOptions ( )
protected

Get parser options for a preview.

Returns
ParserOptions

Definition at line 4500 of file EditPage.php.

◆ getPreviewText()

EditPage::getPreviewText ( )

Get the rendered text for previewing.

Exceptions
MWException
Returns
string

Definition at line 4342 of file EditPage.php.

References $content, CONTENT_MODEL_CSS, CONTENT_MODEL_JAVASCRIPT, CONTENT_MODEL_JSON, and getTitle().

◆ getTemplates()

EditPage::getTemplates ( )
Returns
Title[]

Definition at line 4552 of file EditPage.php.

◆ getTitle()

EditPage::getTitle ( )
Since
1.19
Returns
Title

Definition at line 552 of file EditPage.php.

◆ importContentFormData()

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

Definition at line 1377 of file EditPage.php.

◆ importFormData()

EditPage::importFormData ( & $request)

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

Parameters
WebRequest&$request
Exceptions
ErrorPageError

Definition at line 1114 of file EditPage.php.

References NS_USER, NS_USER_TALK, wfDebug(), wfEscapeWikiText(), and wfTimestampNow().

◆ internalAttemptSave()

EditPage::internalAttemptSave ( & $result,
$markAsBot = false,
$markAsMinor = 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 (bool): Set if doUserEditContent is OK. True if null edit, false otherwise.
  • redirect (bool): Set if doUserEditContent is OK. True if resulting revision is a redirect.
bool$markAsBotTrue if edit is being made under the bot right and the bot wishes the edit to be marked as such.
bool$markAsMinorTrue if edit should be marked as minor.
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.

Definition at line 2142 of file EditPage.php.

References $content, $matches, MediaWiki\Storage\PageUpdater\addTags(), DB_PRIMARY, EDIT_AUTOSUMMARY, EDIT_FORCE_BOT, EDIT_MINOR, EDIT_NEW, EDIT_UPDATE, getAuthority(), MediaWiki\Storage\PageUpdater\getStatus(), getTitle(), StatusValue\isOK(), MediaWiki\Storage\PageUpdater\prepareUpdate(), MediaWiki\Storage\PageUpdater\setContent(), MediaWiki\Storage\PageUpdater\setOriginalRevisionId(), MediaWiki\Storage\PageUpdater\setRcPatrolStatus(), wfDebug(), and wfGetDB().

◆ makeTemplatesOnThisPageList()

EditPage::makeTemplatesOnThisPageList ( array $templates)

Wrapper around TemplatesOnThisPageFormatter to make a "templates on this page" list.

Parameters
PageIdentity[]$templates
Returns
string HTML

Definition at line 3415 of file EditPage.php.

References $type.

◆ maybeActivateTempUserCreate()

EditPage::maybeActivateTempUserCreate ( $doAcquire)

Check the configuration and current user and enable automatic temporary user creation if possible.

Parameters
bool$doAcquireWhether to acquire a name for the temporary account
Since
1.39

Definition at line 790 of file EditPage.php.

◆ previewOnOpen()

EditPage::previewOnOpen ( )
protected

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

Returns
bool

Definition at line 1033 of file EditPage.php.

◆ setApiEditOverride()

EditPage::setApiEditOverride ( $enableOverride)

Allow editing of content that supports API direct editing, but not general direct editing.

Set to false by default.

Access: internal
Must only be used by ApiEditPage
Parameters
bool$enableOverride

Definition at line 594 of file EditPage.php.

◆ setContextTitle()

EditPage::setContextTitle ( $title)
Parameters
Title | null$title

Definition at line 559 of file EditPage.php.

References $title.

◆ setEditConflictHelperFactory()

EditPage::setEditConflictHelperFactory ( callable $factory)

Set a factory function to create an EditConflictHelper.

Parameters
callable$factoryFactory function
Since
1.31

Definition at line 5041 of file EditPage.php.

◆ setHeaders()

EditPage::setHeaders ( )

Definition at line 2846 of file EditPage.php.

References NS_MEDIAWIKI.

◆ showContentForm()

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

Definition at line 3842 of file EditPage.php.

◆ showDiff()

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.

Definition at line 3954 of file EditPage.php.

References NS_MEDIAWIKI.

◆ showEditForm()

EditPage::showEditForm ( $formCallback = null)

Send the edit form and related headers to OutputPage.

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 and hard-deprecated since 1.38. Please use the EditPage::showEditForm:fields hook instead.

Definition at line 3137 of file EditPage.php.

References Linker\formatHiddenCategories(), Linker\titleAttrib(), and wfDeprecated().

◆ showFormAfterText()

EditPage::showFormAfterText ( )
protected

Definition at line 3814 of file EditPage.php.

◆ showStandardInputs()

EditPage::showStandardInputs ( & $tabindex = 2)
protected

Definition at line 4164 of file EditPage.php.

References Skin\makeInternalOrExternalUrl().

◆ showTextbox()

EditPage::showTextbox ( $text,
$name,
$customAttribs = [] )
protected

Definition at line 3873 of file EditPage.php.

◆ spamPageWithContent()

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

Definition at line 4858 of file EditPage.php.

References wfEscapeWikiText().

◆ toEditContent()

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|bool|null The content object created from $text. If $text was false or null, then false or 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.

Definition at line 3114 of file EditPage.php.

References $content, and getTitle().

Member Data Documentation

◆ $action

string EditPage::$action = 'submit'
Deprecated
for public usage since 1.38 with no replacement

Definition at line 160 of file EditPage.php.

◆ $blankArticle

bool EditPage::$blankArticle = false
protected

Definition at line 208 of file EditPage.php.

◆ $contentFormat

null string EditPage::$contentFormat = null

Definition at line 345 of file EditPage.php.

◆ $contentModel

string EditPage::$contentModel

Definition at line 342 of file EditPage.php.

◆ $context

IContextSource EditPage::$context
protected

Definition at line 384 of file EditPage.php.

Referenced by getContext().

◆ $didSave

EditPage::$didSave = false

Definition at line 364 of file EditPage.php.

◆ $editFormPageTop

string EditPage::$editFormPageTop = ''

Before even the preview.

Definition at line 354 of file EditPage.php.

◆ $editFormTextAfterContent

EditPage::$editFormTextAfterContent = ''

Definition at line 360 of file EditPage.php.

◆ $editFormTextAfterTools

EditPage::$editFormTextAfterTools = ''

Definition at line 358 of file EditPage.php.

◆ $editFormTextAfterWarn

EditPage::$editFormTextAfterWarn = ''

Definition at line 357 of file EditPage.php.

◆ $editFormTextBeforeContent

EditPage::$editFormTextBeforeContent = ''

Definition at line 356 of file EditPage.php.

◆ $editFormTextBottom

EditPage::$editFormTextBottom = ''

Definition at line 359 of file EditPage.php.

◆ $editFormTextTop

EditPage::$editFormTextTop = ''

Definition at line 355 of file EditPage.php.

◆ $edittime

string null EditPage::$edittime = ''

Timestamp of the latest revision of the page when editing was initiated on the client.

Definition at line 288 of file EditPage.php.

◆ $firsttime

bool EditPage::$firsttime

True the first time the edit form is rendered, false after re-rendering with diff, save prompts, etc.

Definition at line 181 of file EditPage.php.

◆ $formtype

string EditPage::$formtype

Definition at line 175 of file EditPage.php.

◆ $isConflict

bool EditPage::$isConflict = false

Whether an edit conflict needs to be resolved.

Detected based on whether $editRevId is different than the latest revision. When a conflict has successfully been resolved by a 3-way-merge, this field is set to false.

Definition at line 166 of file EditPage.php.

◆ $mShowSummaryField

bool EditPage::$mShowSummaryField = true

Definition at line 236 of file EditPage.php.

◆ $oldid

int EditPage::$oldid = 0

Revision ID the edit is based on, or 0 if it's the current revision.

FIXME: This isn't used in conflict resolution–provide a better justification or merge with parentRevId.

See also
$editRevId

Definition at line 322 of file EditPage.php.

◆ $preview

bool EditPage::$preview = false

Definition at line 244 of file EditPage.php.

◆ $previewTextAfterContent

EditPage::$previewTextAfterContent = ''

Definition at line 361 of file EditPage.php.

◆ $save

bool EditPage::$save = false

Definition at line 241 of file EditPage.php.

◆ $section

string EditPage::$section = ''

Definition at line 304 of file EditPage.php.

◆ $sectiontitle

string null EditPage::$sectiontitle = null

Definition at line 307 of file EditPage.php.

◆ $starttime

string null EditPage::$starttime = ''

Timestamp from the first time the edit form was rendered.

Definition at line 315 of file EditPage.php.

◆ $summary

string EditPage::$summary = ''

Definition at line 276 of file EditPage.php.

◆ $suppressIntro

EditPage::$suppressIntro = false

Definition at line 368 of file EditPage.php.

◆ $textbox1

string EditPage::$textbox1 = ''

Page content input field.

Definition at line 270 of file EditPage.php.

◆ $textbox2

string EditPage::$textbox2 = ''

Definition at line 273 of file EditPage.php.

◆ $undidRev

EditPage::$undidRev = 0

Definition at line 365 of file EditPage.php.

◆ EDITFORM_ID

const EditPage::EDITFORM_ID = 'editform'

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

Definition at line 115 of file EditPage.php.

◆ POST_EDIT_COOKIE_DURATION

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.

Definition at line 136 of file EditPage.php.

◆ POST_EDIT_COOKIE_KEY_PREFIX

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

Definition at line 121 of file EditPage.php.

Referenced by Article\view().

◆ UNICODE_CHECK

const EditPage::UNICODE_CHECK = UnicodeConstraint::VALID_UNICODE

Used for Unicode support checks.

Definition at line 110 of file EditPage.php.

Referenced by ApiEditPage\execute().


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