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

List of all members.

Public Member Functions

 EditPage ($article)
 getArticle ()
 getContent ($def_text= '')
 Fetch initial editing page content.
 setPreloadedText ($text)
 Use this method before edit() to preload some text into the edit box.
 submit ()
 edit ()
 This is the function that gets called for "action=edit".
 readOnlyPage ($source=null, $protected=false, $reasons=array(), $action=null)
 Show a read-only error Parameters are the same as OutputPage:readOnlyPage() Redirect to the article page if redlink=1.
 importFormData (&$request)
 tokenOk (&$request)
 Make sure the form isn't faking a user's credentials.
 internalAttemptSave (&$result, $bot=false)
 Attempt submission (no UI).
 initialiseForm ()
 Initialise form fields in the object Called on the first invocation, e.g.
 setHeaders ()
 showEditForm ($formCallback=null)
 Send the edit form and related headers to $wgOut.
 getSummaryInput ($summary="", $labelText=null, $inputAttrs=null, $spanLabelAttrs=null)
 Standard summary input and label (wgSummary), abstracted so EditPage subclasses may reorganize the form.
 getPreviewText ()
 Get the rendered text for previewing.
 getTemplates ()
 blockedPage ()
 Call the stock "user is blocked" page.
 userNotLoggedInPage ()
 Produce the stock "please login to edit pages" page.
 noSuchSectionPage ()
 Creates a basic error page which informs the user that they have attempted to edit a nonexistent section.
 spamPage ($match=false)
 Produce the stock "your edit contains spam" page.
 pseudoParseSectionAnchor ($text)
 sectionAnchor ($text)
 Format an anchor fragment as it would appear for a given section name.
 getCheckboxes (&$tabindex, $skin, $checked)
 Returns an array of html code of the following checkboxes: minor and watch.
 getEditButtons (&$tabindex)
 Returns an array of html code of the following buttons: save, diff, preview and live.
 livePreview ()
 Output preview text only.
 getCancelLink ()
 showDiff ()
 Get a diff between the current contents of the edit box and the version of the page we're editing from.
 safeUnicodeInput ($request, $field)
 Filter an input field through a Unicode de-armoring process if it came from an old browser with known broken Unicode editing issues.
 safeUnicodeText ($request, $text)
 safeUnicodeOutput ($text)
 Filter an output field through a Unicode armoring process if it is going to an old browser with known broken Unicode editing issues.
 makesafe ($invalue)
 A number of web browsers are known to corrupt non-ASCII characters in a UTF-8 text editing environment.
 unmakesafe ($invalue)
 Reverse the previously applied transliteration of non-ASCII characters back to UTF-8.
 noCreatePermission ()
 attemptSave ()
 Attempt submission.
 getBaseRevision ()

Static Public Member Functions

static matchSpamRegex ($text)
 Check given input text against $wgSpamRegex, and return the text of the first match.
static matchSummarySpamRegex ($text)
 Check given input text against $wgSpamRegex, and return the text of the first match.
static getEditToolbar ()
 Shows a bulletin board style toolbar for common editing functions.

Public Attributes

const AS_SUCCESS_UPDATE = 200
const AS_SUCCESS_NEW_ARTICLE = 201
const AS_HOOK_ERROR = 210
const AS_FILTERING = 211
const AS_HOOK_ERROR_EXPECTED = 212
const AS_BLOCKED_PAGE_FOR_USER = 215
const AS_CONTENT_TOO_BIG = 216
const AS_USER_CANNOT_EDIT = 217
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_OK = 230
const AS_END = 231
const AS_SPAM_ERROR = 232
const AS_IMAGE_REDIRECT_ANON = 233
const AS_IMAGE_REDIRECT_LOGGED = 234
 $mArticle
 $mTitle
 $action
 $isConflict = false
 $isCssJsSubpage = false
 $isCssSubpage = false
 $isJsSubpage = false
 $deletedSinceEdit = false
 $formtype
 $firsttime
 $lastDelete
 $mTokenOk = false
 $mTokenOkExceptSuffix = false
 $mTriedSave = false
 $tooBig = false
 $kblength = false
 $missingComment = false
 $missingSummary = false
 $allowBlankSummary = false
 $autoSumm = ''
 $hookError = ''
 $mParserOutput
 $mBaseRevision = false
 $mShowSummaryField = true
 $save = false
 $preview = false
 $diff = false
 $minoredit = false
 $watchthis = false
 $recreate = false
 $textbox1 = ''
 $textbox2 = ''
 $summary = ''
 $nosummary = false
 $edittime = ''
 $section = ''
 $starttime = ''
 $oldid = 0
 $editintro = ''
 $scrolltop = null
 $bot = true
 $editFormPageTop
 $editFormTextTop
 $editFormTextBeforeContent
 $editFormTextAfterWarn
 $editFormTextAfterTools
 $editFormTextBottom
 $editFormTextAfterContent
 $previewTextAfterContent
 $didSave = false
 $undidRev = 0
 $suppressIntro = false

Protected Member Functions

 getPreloadedText ($preload)
 Get the contents of a page from its title and remove includeonly tags.
 wasDeletedSinceLastEdit ()
 getEditPermissionErrors ()
 previewOnOpen ()
 Should we show a preview when the edit form is first shown?
 isSectionEditSupported ()
 Does this EditPage class support section editing? This is used by EditPage subclasses to indicate their ui cannot handle section edits.
 getActionURL (Title $title)
 Returns the URL to use in the form's action attribute.
 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 overrided and return the page text that will be used for saving, preview parsing and so on.
 showIntro ()
 Show all applicable editing introductions.
 showCustomIntro ()
 Attempt to show a custom editing introduction, if supplied.
 userWasLastToEdit ($id, $edittime)
 Check if no edits were made by other users since the time a user started editing the page.
 showHeader ()
 showSummaryInput ($isSubjectPreview, $summary="")
 getSummaryPreview ($isSubjectPreview, $summary="")
 showFormBeforeText ()
 showFormAfterText ()
 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.
 showTextbox1 ($customAttribs=null, $textoverride=null)
 Method to output wpTextbox1 The $textoverride method can be used by subclasses overriding showContentForm to pass back to this method.
 showTextbox2 ()
 showTextbox ($content, $name, $customAttribs=array())
 displayPreviewArea ($previewOutput, $isOnTop=false)
 showPreview ($text)
 Append preview output to $wgOut.
 showTosSummary ()
 showEditTools ()
 getCopywarn ()
 showStandardInputs (&$tabindex=2)
 showConflict ()
 getLastDelete ()

Static Protected Member Functions

static matchSpamRegexInternal ($text, $regexes)

Private Member Functions

 mergeChangesInto (&$editText)
 checkUnicodeCompliantBrowser ()
 Check if the browser is on a blacklist of user-agents known to mangle UTF-8 data on form submission.


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: $wgTitle 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.

Definition at line 19 of file EditPage.php.


Member Function Documentation

EditPage::attemptSave (  ) 

Attempt submission.

Returns:
bool false if output is done, true if the rest of the form should be displayed

Definition at line 2546 of file EditPage.php.

References $bot, $wgOut, $wgTitle, $wgUser, blockedPage(), internalAttemptSave(), noCreatePermission(), spamPage(), and userNotLoggedInPage().

Referenced by edit().

EditPage::blockedPage (  ) 

Call the stock "user is blocked" page.

Definition at line 1927 of file EditPage.php.

References $wgOut, and showTextbox1().

Referenced by attemptSave().

EditPage::checkUnicodeCompliantBrowser (  )  [private]

Check if the browser is on a blacklist of user-agents known to mangle UTF-8 data on form submission.

Returns true if Unicode should make it through, false if it's known to be a problem.

Returns:
bool

Definition at line 2054 of file EditPage.php.

References $wgBrowserBlackList.

Referenced by safeUnicodeOutput(), showFormBeforeText(), and showHeader().

EditPage::displayPreviewArea ( previewOutput,
isOnTop = false 
) [protected]

Definition at line 1654 of file EditPage.php.

References $classes, $wgOut, Xml::openElement(), showDiff(), and showPreview().

Referenced by showEditForm().

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 285 of file EditPage.php.

References $wgOut, $wgRequest, $wgUser, attemptSave(), getContent(), getEditPermissionErrors(), MWNamespace::hasSubpages(), importFormData(), initialiseForm(), livePreview(), noSuchSectionPage(), previewOnOpen(), readOnlyPage(), showEditForm(), showIntro(), wfDebug(), wfEmptyMsg(), wfMsgForContent(), wfProfileIn(), wfProfileOut(), wfReadOnly(), and wfRunHooks().

Referenced by importFormData(), and submit().

EditPage::EditPage ( article  ) 

Todo:
document
Parameters:
$article 

Definition at line 99 of file EditPage.php.

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 $title The title for which is being edited (where we go to for &action= links)
Returns:
string

Definition at line 503 of file EditPage.php.

References Title::getLocalURL().

Referenced by showEditForm().

EditPage::getArticle (  ) 

Definition at line 116 of file EditPage.php.

EditPage::getBaseRevision (  ) 

Definition at line 2614 of file EditPage.php.

References Revision::loadFromTimestamp(), and wfGetDB().

Referenced by mergeChangesInto().

EditPage::getCancelLink (  ) 

Definition at line 2367 of file EditPage.php.

References $wgTitle, $wgUser, and wfMsgExt().

Referenced by showStandardInputs().

EditPage::getCheckboxes ( &$  tabindex,
skin,
checked 
)

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

Parameters:
$tabindex Current tabindex
$skin Skin object
$checked Array of checkbox => bool, where bool indicates the checked status of the checkbox
Returns:
array

Definition at line 2252 of file EditPage.php.

References $wgUser, Xml::check(), wfMsg(), wfMsgExt(), and wfRunHooks().

Referenced by showStandardInputs().

EditPage::getContent ( def_text = ''  ) 

Fetch initial editing page content.

Returns:
mixed string on success, $def_text for invalid sections
Access:
private

Definition at line 126 of file EditPage.php.

References $section, $wgContLang, $wgMessageCache, $wgOut, $wgParser, $wgRequest, Revision::DELETED_TEXT, getPreloadedText(), Revision::newFromId(), wfEmptyMsg(), wfMsgForContent(), wfMsgGetKey(), wfMsgNoTrans(), wfProfileIn(), and wfProfileOut().

Referenced by edit(), initialiseForm(), showConflict(), and showEditForm().

EditPage::getCopywarn (  )  [protected]

Definition at line 1723 of file EditPage.php.

References $wgRightsText, wfMsgForContent(), and wfRunHooks().

Referenced by showEditForm().

EditPage::getEditButtons ( &$  tabindex  ) 

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

Parameters:
$tabindex Current tabindex
Returns:
array

Definition at line 2294 of file EditPage.php.

References Xml::element(), wfMsg(), and wfRunHooks().

Referenced by showStandardInputs().

EditPage::getEditPermissionErrors (  )  [protected]

Definition at line 416 of file EditPage.php.

References $wgUser, and wfArrayDiff2().

Referenced by edit().

static EditPage::getEditToolbar (  )  [static]

Shows a bulletin board style toolbar for common editing functions.

It can be disabled in the user preferences. The necessary JavaScript code can be found in skins/common/edit.js.

Returns:
string

Definition at line 2095 of file EditPage.php.

References $script, $wgContLang, $wgLang, $wgStylePath, Html::inlineScript(), wfMsg(), and wfRunHooks().

Referenced by showEditForm().

EditPage::getLastDelete (  )  [protected]

EditPage::getPreloadedText ( preload  )  [protected]

Get the contents of a page from its title and remove includeonly tags.

Parameters:
$preload String: the title of the page.
Returns:
string The contents of the page.

Definition at line 228 of file EditPage.php.

References Title::newFromText(), and Revision::newFromTitle().

Referenced by getContent().

EditPage::getPreviewText (  ) 

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:
$summary The value of the summary input
$labelText The html to place inside the label
$userInputAttrs An array of attrs to use on the input
$userSpanAttrs An array of attrs to use on the span inside the label
Returns:
array An array in the format array( $label, $input )

Definition at line 1474 of file EditPage.php.

References $input, $summary, Html::input(), and Xml::tags().

Referenced by showSummaryInput().

EditPage::getSummaryPreview ( isSubjectPreview,
summary = "" 
) [protected]

Parameters:
bool $isSubjectPreview true if this is the section subject/title up top, or false if this is the comment summary down below the textarea
string $summary The text of the summary to display
Returns:
string

Definition at line 1530 of file EditPage.php.

References $summary, $wgParser, $wgUser, Xml::tags(), wfMsgExt(), and wfMsgForContent().

Referenced by showEditForm(), and showStandardInputs().

EditPage::getTemplates (  ) 

Definition at line 1909 of file EditPage.php.

References Title::makeTitle().

Referenced by showEditForm().

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 overrided and return the page text that will be used for saving, preview parsing and so on.

..

WebRequest $request

Definition at line 652 of file EditPage.php.

Referenced by importFormData().

EditPage::importFormData ( &$  request  ) 

Todo:
document
Parameters:
$request 

Definition at line 511 of file EditPage.php.

References $textbox1, $wgLang, $wgUser, edit(), importContentFormData(), safeUnicodeInput(), tokenOk(), wfDebug(), wfProfileIn(), wfProfileOut(), wfRunHooks(), and wfTimestampNow().

Referenced by edit().

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

Definition at line 1118 of file EditPage.php.

References $wgUser, getContent(), and wfProxyCheck().

Referenced by edit().

EditPage::internalAttemptSave ( &$  result,
bot = false 
)

EditPage::isSectionEditSupported (  )  [protected]

Does this EditPage class support section editing? This is used by EditPage subclasses to indicate their ui cannot handle section edits.

Returns:
bool

Definition at line 490 of file EditPage.php.

Referenced by showHeader().

EditPage::livePreview (  ) 

Output preview text only.

This can be sucked into the edit page via JavaScript, and saves the server time rendering the skin as well as theoretically being more robust on the client (doesn't disturb the edit box's undo history, won't eat your text on failure, etc).

Todo:
This doesn't include category or interlanguage links. Would need to enhance it a bit, <s>maybe wrap them in XML or something...</s> that might also require more skin initialization, so check whether that's a problem.

Definition at line 2348 of file EditPage.php.

References $s, $wgOut, Xml::element(), getPreviewText(), and Xml::tags().

Referenced by edit().

EditPage::makesafe ( invalue  ) 

A number of web browsers are known to corrupt non-ASCII characters in a UTF-8 text editing environment.

To protect against this, detected browsers will be served an armored version of the text, with non-ASCII chars converted to numeric HTML character references.

Preexisting such character references will have a 0 added to them to ensure that round-trips do not alter the original data.

Parameters:
string $invalue
Returns:
string
Access:
private

Definition at line 2466 of file EditPage.php.

References $i, and $result.

Referenced by safeUnicodeOutput().

static EditPage::matchSpamRegex ( text  )  [static]

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

Returns:
mixed -- matching string or false

Definition at line 1086 of file EditPage.php.

References $wgSpamRegex, and matchSpamRegexInternal().

Referenced by internalAttemptSave().

static EditPage::matchSpamRegexInternal ( text,
regexes 
) [static, protected]

Definition at line 1103 of file EditPage.php.

Referenced by matchSpamRegex(), and matchSummarySpamRegex().

static EditPage::matchSummarySpamRegex ( text  )  [static]

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

Returns:
mixed -- matching string or false

Definition at line 1097 of file EditPage.php.

References $wgSummarySpamRegex, and matchSpamRegexInternal().

Referenced by internalAttemptSave(), and Title::isValidMoveOperation().

EditPage::mergeChangesInto ( &$  editText  )  [private]

EditPage::noCreatePermission (  ) 

Definition at line 2536 of file EditPage.php.

References $wgOut, and wfMsg().

Referenced by attemptSave().

EditPage::noSuchSectionPage (  ) 

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

Definition at line 1976 of file EditPage.php.

References $res, $wgOut, wfMsg(), wfMsgExt(), and wfRunHooks().

Referenced by edit().

EditPage::previewOnOpen (  )  [protected]

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

Returns:
bool

Definition at line 459 of file EditPage.php.

References $wgPreviewOnOpenNamespaces, $wgRequest, and $wgUser.

Referenced by edit().

EditPage::pseudoParseSectionAnchor ( text  ) 

Deprecated:
use $wgParser->stripSectionName()

Definition at line 2072 of file EditPage.php.

References $wgParser.

EditPage::readOnlyPage ( source = null,
protected = false,
reasons = array(),
action = null 
)

Show a read-only error Parameters are the same as OutputPage:readOnlyPage() Redirect to the article page if redlink=1.

Definition at line 442 of file EditPage.php.

References $action, $wgOut, and $wgRequest.

Referenced by edit().

EditPage::safeUnicodeInput ( request,
field 
)

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
Access:
private

Definition at line 2423 of file EditPage.php.

References unmakesafe().

Referenced by importFormData().

EditPage::safeUnicodeOutput ( text  ) 

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
Access:
private

Definition at line 2445 of file EditPage.php.

References $wgContLang, checkUnicodeCompliantBrowser(), and makesafe().

Referenced by showTextbox().

EditPage::safeUnicodeText ( request,
text 
)

Definition at line 2430 of file EditPage.php.

References unmakesafe().

EditPage::sectionAnchor ( text  ) 

Format an anchor fragment as it would appear for a given section name.

Parameters:
string $text
Returns:
string
Access:
private

Definition at line 2083 of file EditPage.php.

References $wgParser.

EditPage::setHeaders (  ) 

Definition at line 1140 of file EditPage.php.

References $msg, $title, $wgOut, $wgTitle, and wfMsg().

Referenced by showEditForm().

EditPage::setPreloadedText ( text  ) 

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

Definition at line 218 of file EditPage.php.

EditPage::showConflict (  )  [protected]

Definition at line 1768 of file EditPage.php.

References $wgOut, getContent(), showTextbox2(), wfMsg(), and wfRunHooks().

Referenced by showEditForm().

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

WebRequest $request

Definition at line 1586 of file EditPage.php.

References showTextbox1().

Referenced by showEditForm().

EditPage::showCustomIntro (  )  [protected]

Attempt to show a custom editing introduction, if supplied.

Returns:
bool

Definition at line 738 of file EditPage.php.

References $title, $wgOut, Title::newFromText(), and Revision::newFromTitle().

Referenced by showIntro().

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 2391 of file EditPage.php.

References $wgOut, wfMsgExt(), and wfRunHooks().

Referenced by displayPreviewArea().

EditPage::showEditForm ( formCallback = null  ) 

Send the edit form and related headers to $wgOut.

Parameters:
$formCallback Optional callable that takes an OutputPage parameter; will be called during form output near the top, for captchas and the like.

Definition at line 1169 of file EditPage.php.

References $action, $wgOut, $wgTitle, $wgUser, Xml::checkLabel(), displayPreviewArea(), getActionURL(), getContent(), getCopywarn(), getEditToolbar(), getPreviewText(), getSummaryPreview(), getTemplates(), Xml::hidden(), setHeaders(), showConflict(), showContentForm(), showEditTools(), showFormAfterText(), showFormBeforeText(), showHeader(), showStandardInputs(), showSummaryInput(), showTextbox1(), showTosSummary(), wasDeletedSinceLastEdit(), wfMsg(), wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by edit().

EditPage::showEditTools (  )  [protected]

Definition at line 1716 of file EditPage.php.

References $wgOut.

Referenced by showEditForm().

EditPage::showFormAfterText (  )  [protected]

Definition at line 1559 of file EditPage.php.

References $wgOut, $wgUser, and Xml::hidden().

Referenced by showEditForm().

EditPage::showFormBeforeText (  )  [protected]

Definition at line 1544 of file EditPage.php.

References $section, $wgOut, checkUnicodeCompliantBrowser(), and Xml::hidden().

Referenced by showEditForm().

EditPage::showHeader (  )  [protected]

EditPage::showIntro (  )  [protected]

Show all applicable editing introductions.

Definition at line 674 of file EditPage.php.

References $wgOut, $wgUser, User::isIP(), User::newFromName(), showCustomIntro(), and LogEventsList::showLogExtract().

Referenced by edit().

EditPage::showPreview ( text  )  [protected]

Append preview output to $wgOut.

Includes category rendering if this is a category page.

Parameters:
string $text The HTML to be output for the preview.

Definition at line 1684 of file EditPage.php.

References $wgOut, and wfRunHooks().

Referenced by displayPreviewArea().

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

EditPage::showSummaryInput ( isSubjectPreview,
summary = "" 
) [protected]

Parameters:
bool $isSubjectPreview true if this is the section subject/title up top, or false if this is the comment summary down below the textarea
string $summary The text of the summary to display
Returns:
string

Definition at line 1506 of file EditPage.php.

References $input, $summary, $wgContLang, $wgOut, getSummaryInput(), and wfMsgExt().

Referenced by showEditForm(), and showStandardInputs().

EditPage::showTextbox ( content,
name,
customAttribs = array() 
) [protected]

Definition at line 1628 of file EditPage.php.

References $name, $wgOut, $wgUser, safeUnicodeOutput(), and Html::textarea().

Referenced by showTextbox1(), and showTextbox2().

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 $customAttribs An array of html attributes to use in the textarea
string $textoverride Optional text to override $this->textarea1 with

Definition at line 1598 of file EditPage.php.

References $classes, showTextbox(), and wasDeletedSinceLastEdit().

Referenced by blockedPage(), showContentForm(), and showEditForm().

EditPage::showTextbox2 (  )  [protected]

Definition at line 1624 of file EditPage.php.

References showTextbox().

Referenced by showConflict().

EditPage::showTosSummary (  )  [protected]

Definition at line 1698 of file EditPage.php.

References $msg, $wgOut, wfEmptyMsg(), wfMsg(), and wfRunHooks().

Referenced by showEditForm().

EditPage::spamPage ( match = false  ) 

Produce the stock "your edit contains spam" page.

Parameters:
$match Text which triggered one or more filters

Definition at line 1995 of file EditPage.php.

References $wgOut, $wgTitle, wfEscapeWikiText(), and wfMsg().

Referenced by attemptSave().

EditPage::submit (  ) 

Definition at line 270 of file EditPage.php.

References edit().

EditPage::tokenOk ( &$  request  ) 

Make sure the form isn't faking a user's credentials.

Parameters:
$request WebRequest
Returns:
bool
Access:
private

Definition at line 663 of file EditPage.php.

References $wgUser.

Referenced by importFormData().

EditPage::unmakesafe ( invalue  ) 

Reverse the previously applied transliteration of non-ASCII characters back to UTF-8.

Used to protect data from corruption by broken web browsers as listed in $wgBrowserBlackList.

Parameters:
string $invalue
Returns:
string
Access:
private

Definition at line 2508 of file EditPage.php.

References $i, $result, and codepointToUtf8().

Referenced by safeUnicodeInput(), and safeUnicodeText().

EditPage::userNotLoggedInPage (  ) 

Produce the stock "please login to edit pages" page.

Definition at line 1951 of file EditPage.php.

References $wgOut, $wgTitle, $wgUser, SpecialPage::getTitleFor(), wfMsg(), wfMsgHtml(), and wfMsgWikiHtml().

Referenced by attemptSave().

EditPage::userWasLastToEdit ( id,
edittime 
) [protected]

Check if no edits were made by other users since the time a user started editing the page.

Limit to 50 revisions for the sake of performance.

Definition at line 1063 of file EditPage.php.

References $dbw, $edittime, $res, and wfGetDB().

Referenced by internalAttemptSave().

EditPage::wasDeletedSinceLastEdit (  )  [protected]

Definition at line 255 of file EditPage.php.

References getLastDelete(), and wfTimestamp().

Referenced by internalAttemptSave(), showEditForm(), and showTextbox1().


Member Data Documentation

EditPage::$action

Definition at line 47 of file EditPage.php.

Referenced by readOnlyPage(), and showEditForm().

EditPage::$allowBlankSummary = false

Definition at line 63 of file EditPage.php.

EditPage::$autoSumm = ''

Definition at line 64 of file EditPage.php.

EditPage::$bot = true

Definition at line 76 of file EditPage.php.

Referenced by attemptSave(), and internalAttemptSave().

EditPage::$deletedSinceEdit = false

Definition at line 52 of file EditPage.php.

EditPage::$didSave = false

Definition at line 90 of file EditPage.php.

EditPage::$diff = false

Definition at line 72 of file EditPage.php.

EditPage::$editFormPageTop

Definition at line 80 of file EditPage.php.

EditPage::$editFormTextAfterContent

Definition at line 86 of file EditPage.php.

EditPage::$editFormTextAfterTools

Definition at line 84 of file EditPage.php.

EditPage::$editFormTextAfterWarn

Definition at line 83 of file EditPage.php.

EditPage::$editFormTextBeforeContent

Definition at line 82 of file EditPage.php.

EditPage::$editFormTextBottom

Definition at line 85 of file EditPage.php.

EditPage::$editFormTextTop

Definition at line 81 of file EditPage.php.

EditPage::$editintro = ''

Definition at line 76 of file EditPage.php.

EditPage::$edittime = ''

Definition at line 75 of file EditPage.php.

Referenced by userWasLastToEdit().

EditPage::$firsttime

Definition at line 54 of file EditPage.php.

EditPage::$formtype

Definition at line 53 of file EditPage.php.

EditPage::$hookError = ''

Definition at line 65 of file EditPage.php.

EditPage::$isConflict = false

Definition at line 48 of file EditPage.php.

EditPage::$isCssJsSubpage = false

Definition at line 49 of file EditPage.php.

EditPage::$isCssSubpage = false

Definition at line 50 of file EditPage.php.

EditPage::$isJsSubpage = false

Definition at line 51 of file EditPage.php.

EditPage::$kblength = false

Definition at line 60 of file EditPage.php.

EditPage::$lastDelete

Definition at line 55 of file EditPage.php.

EditPage::$mArticle

Definition at line 45 of file EditPage.php.

EditPage::$mBaseRevision = false

Definition at line 68 of file EditPage.php.

EditPage::$minoredit = false

Definition at line 73 of file EditPage.php.

EditPage::$missingComment = false

Definition at line 61 of file EditPage.php.

EditPage::$missingSummary = false

Definition at line 62 of file EditPage.php.

EditPage::$mParserOutput

Definition at line 67 of file EditPage.php.

EditPage::$mShowSummaryField = true

Definition at line 69 of file EditPage.php.

EditPage::$mTitle

Definition at line 46 of file EditPage.php.

EditPage::$mTokenOk = false

Definition at line 56 of file EditPage.php.

EditPage::$mTokenOkExceptSuffix = false

Definition at line 57 of file EditPage.php.

EditPage::$mTriedSave = false

Definition at line 58 of file EditPage.php.

EditPage::$nosummary = false

Definition at line 74 of file EditPage.php.

EditPage::$oldid = 0

Definition at line 76 of file EditPage.php.

EditPage::$preview = false

Definition at line 72 of file EditPage.php.

EditPage::$previewTextAfterContent

Definition at line 87 of file EditPage.php.

EditPage::$recreate = false

Definition at line 73 of file EditPage.php.

EditPage::$save = false

Definition at line 72 of file EditPage.php.

EditPage::$scrolltop = null

Definition at line 76 of file EditPage.php.

EditPage::$section = ''

Definition at line 75 of file EditPage.php.

Referenced by getContent(), and showFormBeforeText().

EditPage::$starttime = ''

Definition at line 75 of file EditPage.php.

EditPage::$summary = ''

Definition at line 74 of file EditPage.php.

Referenced by getSummaryInput(), getSummaryPreview(), and showSummaryInput().

EditPage::$suppressIntro = false

Definition at line 93 of file EditPage.php.

EditPage::$textbox1 = ''

Definition at line 74 of file EditPage.php.

Referenced by importFormData().

EditPage::$textbox2 = ''

Definition at line 74 of file EditPage.php.

EditPage::$tooBig = false

Definition at line 59 of file EditPage.php.

EditPage::$undidRev = 0

Definition at line 91 of file EditPage.php.

EditPage::$watchthis = false

Definition at line 73 of file EditPage.php.

Definition at line 32 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 34 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 25 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 35 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 26 of file EditPage.php.

Referenced by ApiEditPage::execute().

const EditPage::AS_END = 231

Definition at line 40 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 23 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 22 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 24 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 42 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 43 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 38 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 33 of file EditPage.php.

Referenced by ApiEditPage::execute().

const EditPage::AS_OK = 230

Definition at line 39 of file EditPage.php.

Definition at line 31 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 30 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 28 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 29 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 41 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 21 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 20 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 36 of file EditPage.php.

Definition at line 37 of file EditPage.php.

Referenced by ApiEditPage::execute().

Definition at line 27 of file EditPage.php.


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

Generated on Sat Apr 30 22:57:36 2011 for MediaWiki by  doxygen 1.5.9