var $isCssJsSubpage = false;
var $isCssSubpage = false;
var $isJsSubpage = false;
+ var $isWrongCaseCssJsPage = false;
var $isNew = false; // new page or new section
var $deletedSinceEdit;
var $formtype;
public $editFormTextBottom;
public $editFormTextAfterContent;
public $previewTextAfterContent;
+ public $mPreloadText;
/* $didSave should be set to true whenever an article was succesfully altered. */
public $didSave = false;
/**
* Fetch initial editing page content.
+ *
+ * @param $def_text string
* @returns mixed string on success, $def_text for invalid sections
* @private
*/
return $text;
}
- /** Use this method before edit() to preload some text into the edit box */
+ /**
+ * Use this method before edit() to preload some text into the edit box
+ *
+ * @param $text string
+ */
public function setPreloadedText( $text ) {
$this->mPreloadText = $text;
}
/**
* Checks whether the user entered a skin name in uppercase,
* e.g. "User:Example/Monobook.css" instead of "monobook.css"
+ *
+ * @return bool
*/
protected function isWrongCaseCssJsPage() {
if( $this->mTitle->isCssJsSubpage() ) {
wfProfileOut( __METHOD__ );
}
+ /**
+ * @return array
+ */
protected function getEditPermissionErrors() {
global $wgUser;
$permErrors = $this->mTitle->getUserPermissionsErrors( 'edit', $wgUser );
/**
* @todo document
- * @param $request
+ * @param $request WebRequest
*/
function importFormData( &$request ) {
global $wgLang, $wgUser;
/**
* Attempt submission (no UI)
- * @return one of the constants describing the result
+ *
+ * @param $result
+ * @param $bot bool
+ *
+ * @return int one of the constants describing the result
*/
function internalAttemptSave( &$result, $bot = false ) {
global $wgFilterCallback, $wgUser, $wgParser;
* 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.
+ *
+ * @param $id int
+ * @param $edittime string
+ *
+ * @return bool
*/
protected function userWasLastToEdit( $id, $edittime ) {
if( !$id ) return false;
/**
* Check given input text against $wgSpamRegex, and return the text of the first match.
- * @return mixed -- matching string or false
+ *
+ * @param $text string
+ *
+ * @return string|false matching string or false
*/
public static function matchSpamRegex( $text ) {
global $wgSpamRegex;
/**
* Check given input text against $wgSpamRegex, and return the text of the first match.
- * @return mixed -- matching string or false
+ *
+ * @parma $text string
+ *
+ * @return string|false matching string or false
*/
public static function matchSummarySpamRegex( $text ) {
global $wgSummarySpamRegex;
return self::matchSpamRegexInternal( $text, $regexes );
}
+ /**
+ * @param $text string
+ * @param $regexes array
+ * @return bool|string
+ */
protected static function matchSpamRegexInternal( $text, $regexes ) {
foreach( $regexes as $regex ) {
$matches = array();
/**
* 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
+ * @return bool -- if the requested section is valid
*/
function initialiseForm() {
global $wgUser;
# Already watched
$this->watchthis = true;
}
- if ( $wgUser->getOption( 'minordefault' ) && !$this->isNew ) $this->minoredit = true;
- if ( $this->textbox1 === false ) return false;
+ if ( $wgUser->getOption( 'minordefault' ) && !$this->isNew ) {
+ $this->minoredit = true;
+ }
+ if ( $this->textbox1 === false ) {
+ return false;
+ }
wfProxyCheck();
return true;
}
* inferred by the id given to the input. You can remove them both by
* passing array( 'id' => false ) to $userInputAttrs.
*
- * @param $summary The value of the summary input
- * @param $labelText The html to place inside the label
- * @param $inputAttrs An array of attrs to use on the input
- * @param $spanLabelAttrs An array of attrs to use on the span inside the label
+ * @param $summary string The value of the summary input
+ * @param $labelText string The html to place inside the label
+ * @param $inputAttrs array of attrs to use on the input
+ * @param $spanLabelAttrs array of attrs to use on the span inside the label
*
* @return array An array in the format array( $label, $input )
*/
# Add a class if 'missingsummary' is triggered to allow styling of the summary line
$summaryClass = $this->missingSummary ? 'mw-summarymissed' : 'mw-summary';
if ( $isSubjectPreview ) {
- if ( $this->nosummary )
+ if ( $this->nosummary ) {
return;
+ }
} else {
- if ( !$this->mShowSummaryField )
+ if ( !$this->mShowSummaryField ) {
return;
+ }
}
$summary = $wgContLang->recodeForEdit( $summary );
$labelText = wfMsgExt( $isSubjectPreview ? 'subject' : 'summary', 'parseinline' );
/**
* @private
* @todo document
+ *
+ * @parma $editText string
+ *
+ * @return bool
*/
function mergeChangesInto( &$editText ){
wfProfileIn( __METHOD__ );
echo $s;
}
-
+ /**
+ * @return string
+ */
public function getCancelLink() {
global $wgUser;
case self::AS_NO_CREATE_PERMISSION:
$this->noCreatePermission();
- return;
+ return false;
case self::AS_BLANK_ARTICLE:
$wgOut->redirect( $this->getContextTitle()->getFullURL() );
}
}
+ /**
+ * @return Revision
+ */
function getBaseRevision() {
if ( !$this->mBaseRevision ) {
$db = wfGetDB( DB_MASTER );