# extensions should take care to _append_ to the present value
public $editFormPageTop; // Before even the preview
public $editFormTextTop;
- public $editFormTextBeforeContent;
public $editFormTextAfterWarn;
public $editFormTextAfterTools;
public $editFormTextBottom;
- public $didSave = false;
- public $suppressIntro = false;
-
/**
* @todo document
* @param $article
# Placeholders for text injection by hooks (empty per default)
$this->editFormPageTop =
$this->editFormTextTop =
- $this->editFormTextBeforeContent =
$this->editFormTextAfterWarn =
$this->editFormTextAfterTools =
$this->editFormTextBottom = "";
wfProfileIn( __METHOD__ );
$text = '';
- if( !$this->mArticle->getTitle()->exists() ) {
- if ( $this->mArticle->getTitle()->getNamespace() == NS_MEDIAWIKI ) {
+ if( !$this->mTitle->exists() ) {
+ if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
# If this is a system message, get the default text.
- $text = wfMsgWeirdKey ( $this->mArticle->getTitle()->getText() ) ;
+ $text = wfMsgWeirdKey ( $this->mTitle->getText() ) ;
} else {
# If requested, preload some text.
$text = $this->getPreloadedText( $preload );
return;
}
- $permErrors = $this->mArticle->getTitle()->getUserPermissionsErrors('edit', $wgUser);
- if( !$this->mArticle->getTitle()->exists() )
- $permErrors += array_diff( $this->mArticle->getTitle()->getUserPermissionsErrors('create', $wgUser), $permErrors );
+ $permErrors = $this->mTitle->getUserPermissionsErrors('edit', $wgUser);
+ if( !$this->mTitle->exists() )
+ $permErrors += array_diff( $this->mTitle->getUserPermissionsErrors('create', $wgUser), $permErrors );
# Ignore some permissions errors.
$remove = array();
$this->isConflict = false;
// css / js subpages of user pages get a special treatment
- $this->isCssJsSubpage = $this->mArticle->getTitle()->isCssJsSubpage();
- $this->isValidCssJsSubpage = $this->mArticle->getTitle()->isValidCssJsSubpage();
+ $this->isCssJsSubpage = $wgTitle->isCssJsSubpage();
+ $this->isValidCssJsSubpage = $wgTitle->isValidCssJsSubpage();
/* Notice that we can't use isDeleted, because it returns true if article is ever deleted
* no matter it's current state
* deletes. This is done on every preview and save request. Move it further down
* to only perform it on saves
*/
- if ( $this->mArticle->getTitle()->isDeleted() ) {
+ if ( $this->mTitle->isDeleted() ) {
$this->lastDelete = $this->getLastDelete();
if ( !is_null($this->lastDelete) ) {
$deletetime = $this->lastDelete->log_timestamp;
if( $this->formtype == 'initial' || $this->firsttime )
$this->showIntro();
- if( $this->mArticle->getTitle()->isTalkPage() ) {
+ if( $this->mTitle->isTalkPage() ) {
$wgOut->addWikiText( wfMsg( 'talkpagetext' ) );
}
wfProfileOut( $fname );
return;
}
- if( !$this->mArticle->getID() )
- wfRunHooks( 'EditFormPreloadText', array( &$this->textbox1, &$this->mArticle->mTitle ) );
+ if( !$this->mTitle->getArticleId() )
+ wfRunHooks( 'EditFormPreloadText', array( &$this->textbox1, &$this->mTitle ) );
}
$this->showEditForm();
*/
private function previewOnOpen() {
global $wgRequest, $wgUser;
- $title = $this->mArticle->getTitle();
if( $wgRequest->getVal( 'preview' ) == 'yes' ) {
// Explicit override from request
return true;
} elseif( $this->section == 'new' ) {
// Nothing *to* preview for new sections
return false;
- } elseif( ( $wgRequest->getVal( 'preload' ) !== '' || $title->exists() ) && $wgUser->getOption( 'previewonfirst' ) ) {
+ } elseif( ( $wgRequest->getVal( 'preload' ) !== '' || $this->mTitle->exists() ) && $wgUser->getOption( 'previewonfirst' ) ) {
// Standard preference behaviour
return true;
- } elseif( !$title->exists() && $title->getNamespace() == NS_CATEGORY ) {
+ } elseif( !$this->mTitle->exists() && $this->mTitle->getNamespace() == NS_CATEGORY ) {
// Categories are special
return true;
} else {
$this->watchthis = $request->getCheck( 'wpWatchthis' );
# Don't force edit summaries when a user is editing their own user or talk page
- if( ( $this->mArticle->getTitle()->mNamespace == NS_USER || $this->mArticle->getTitle()->mNamespace == NS_USER_TALK ) && $this->mArticle->getTitle()->getText() == $wgUser->getName() ) {
+ if( ( $this->mTitle->mNamespace == NS_USER || $this->mTitle->mNamespace == NS_USER_TALK ) && $this->mTitle->getText() == $wgUser->getName() ) {
$this->allowBlankSummary = true;
} else {
$this->allowBlankSummary = $request->getBool( 'wpIgnoreBlankSummary' );
*/
private function showIntro() {
global $wgOut, $wgUser;
- if ( $this->suppressIntro ) return;
- if( !$this->showCustomIntro() && !$this->mArticle->getTitle()->exists() ) {
+ if( !$this->showCustomIntro() && !$this->mTitle->exists() ) {
if( $wgUser->isLoggedIn() ) {
$wgOut->addWikiText( wfMsg( 'newarticletext' ) );
} else {
wfProfileOut( $fname );
return false;
}
- if ( $wgFilterCallback && $wgFilterCallback( $this->mArticle->getTitle(), $this->textbox1, $this->section ) ) {
+ if ( $wgFilterCallback && $wgFilterCallback( $this->mTitle, $this->textbox1, $this->section ) ) {
# Error messages or other handling should be performed by the filter function
wfProfileOut( $fname );
wfProfileOut( "$fname-checks" );
wfProfileOut( "$fname-checks" );
# If article is new, insert it.
- $aid = $this->mArticle->getTitle()->getArticleID( GAID_FOR_UPDATE );
+ $aid = $this->mTitle->getArticleID( GAID_FOR_UPDATE );
if ( 0 == $aid ) {
// Late check for create permission, just in case *PARANOIA*
- if ( !$this->mArticle->getTitle()->userCan( 'create' ) ) {
+ if ( !$this->mTitle->userCan( 'create' ) ) {
wfDebug( "$fname: no create permission\n" );
$this->noCreatePermission();
wfProfileOut( $fname );
$isComment=($this->section=='new');
$this->mArticle->insertNewArticle( $this->textbox1, $this->summary,
$this->minoredit, $this->watchthis, false, $isComment);
- $this->didSave = true;
wfProfileOut( $fname );
return false;
# update the article here
if( $this->mArticle->updateArticle( $text, $this->summary, $this->minoredit,
$this->watchthis, '', $sectionanchor ) ) {
- $this->didSave = true;
wfProfileOut( $fname );
return false;
} else {
$this->textbox1 = $this->getContent(false);
if ($this->textbox1 === false) return false;
- if ( !$this->mArticle->exists() && $this->mArticle->getTitle()->getNamespace() == NS_MEDIAWIKI )
- $this->textbox1 = wfMsgWeirdKey( $this->mArticle->getTitle()->getText() );
+ if ( !$this->mArticle->exists() && $this->mArticle->mTitle->getNamespace() == NS_MEDIAWIKI )
+ $this->textbox1 = wfMsgWeirdKey( $this->mArticle->mTitle->getText() );
wfProxyCheck();
return true;
}
}
}
- if( $this->mArticle->getTitle()->getNamespace() == NS_MEDIAWIKI ) {
+ if( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
# Show a warning if editing an interface message
$wgOut->addWikiText( wfMsg( 'editinginterface' ) );
- } elseif( $this->mArticle->getTitle()->isProtected( 'edit' ) ) {
+ } elseif( $this->mTitle->isProtected( 'edit' ) ) {
# Is the title semi-protected?
- if( $this->mArticle->getTitle()->isSemiProtected() ) {
+ if( $this->mTitle->isSemiProtected() ) {
$notice = wfMsg( 'semiprotectedpagewarning' );
if( wfEmptyMsg( 'semiprotectedpagewarning', $notice ) || $notice == '-' )
$notice = '';
}
$wgOut->addWikiText( $notice );
}
- if ( $this->mArticle->getTitle()->isCascadeProtected() ) {
+ if ( $this->mTitle->isCascadeProtected() ) {
# Is this page under cascading protection from some source pages?
- list($cascadeSources, /* $restrictions */) = $this->mArticle->getTitle()->getCascadeProtectionSources();
+ list($cascadeSources, /* $restrictions */) = $this->mTitle->getCascadeProtectionSources();
if ( count($cascadeSources) > 0 ) {
# Explain, and list the titles responsible
$notice = wfMsgExt( 'cascadeprotectedwarning', array('parsemag'), count($cascadeSources) ) . "\n";
if( $wgUser->getOption( 'watchdefault' ) ) {
# Watch all edits
$this->watchthis = true;
- } elseif( $wgUser->getOption( 'watchcreations' ) && !$this->mArticle->getTitle()->exists() ) {
+ } elseif( $wgUser->getOption( 'watchcreations' ) && !$this->mTitle->exists() ) {
# Watch creations
$this->watchthis = true;
- } elseif( $this->mArticle->getTitle()->userIsWatching() ) {
+ } elseif( $this->mTitle->userIsWatching() ) {
# Already watched
$this->watchthis = true;
}
if( $this->section == 'new' ) {
$commentsubject="<span id='wpSummaryLabel'><label for='wpSummary'>{$subject}:</label></span>\n<div class='editOptions'>\n<input tabindex='1' type='text' value=\"$summarytext\" name='wpSummary' id='wpSummary' maxlength='200' size='60' /><br />";
$editsummary = '';
- $subjectpreview = $summarytext && $this->preview ? "<div class=\"mw-summary-preview\">".wfMsg('subject-preview').':'.$sk->commentBlock( $this->summary, $this->mArticle->getTitle() )."</div>\n" : '';
+ $subjectpreview = $summarytext && $this->preview ? "<div class=\"mw-summary-preview\">".wfMsg('subject-preview').':'.$sk->commentBlock( $this->summary, $this->mTitle )."</div>\n" : '';
$summarypreview = '';
} else {
$commentsubject = '';
$editsummary="<span id='wpSummaryLabel'><label for='wpSummary'>{$summary}:</label></span>\n<div class='editOptions'>\n<input tabindex='2' type='text' value=\"$summarytext\" name='wpSummary' id='wpSummary' maxlength='200' size='60' /><br />";
- $summarypreview = $summarytext && $this->preview ? "<div class=\"mw-summary-preview\">".wfMsg('summary-preview').':'.$sk->commentBlock( $this->summary, $this->mArticle->getTitle() )."</div>\n" : '';
+ $summarypreview = $summarytext && $this->preview ? "<div class=\"mw-summary-preview\">".wfMsg('summary-preview').':'.$sk->commentBlock( $this->summary, $this->mTitle )."</div>\n" : '';
$subjectpreview = '';
}
$recreate
{$commentsubject}
{$subjectpreview}
-{$this->editFormTextBeforeContent}
<textarea tabindex='1' accesskey="," name="wpTextbox1" id="wpTextbox1" rows='{$rows}'
cols='{$cols}'{$ew} $hidden>
END
if ( $this->isConflict ) {
$wgOut->addWikiText( '==' . wfMsg( "yourdiff" ) . '==' );
- $de = new DifferenceEngine( $this->mArticle->getTitle() );
+ $de = new DifferenceEngine( $this->mTitle );
$de->setText( $this->textbox2, $this->textbox1 );
$de->showDiff( wfMsg( "yourtext" ), wfMsg( "storedversion" ) );
global $wgOut;
$wgOut->addHTML( '<div id="wikiPreview">' );
- if($this->mArticle->getTitle()->getNamespace() == NS_CATEGORY) {
+ if($this->mTitle->getNamespace() == NS_CATEGORY) {
$this->mArticle->openShowCategory();
}
wfRunHooks( 'OutputPageBeforeHTML',array( &$wgOut, &$text ) );
$wgOut->addHTML( $text );
- if($this->mArticle->getTitle()->getNamespace() == NS_CATEGORY) {
+ if($this->mTitle->getNamespace() == NS_CATEGORY) {
$this->mArticle->closeShowCategory();
}
$wgOut->addHTML( '</div>' );
$wgOut->addHTML( '<script type="'.$wgJsMimeType.'" src="' .
htmlspecialchars( "$wgStylePath/common/preview.js?$wgStyleVersion" ) .
'"></script>' . "\n" );
- $liveAction = $this->mTitle->getLocalUrl( 'action=submit&wpPreview=true&live=true' );
+ $liveAction = $wgTitle->getLocalUrl( 'action=submit&wpPreview=true&live=true' );
return "return !lpDoPreview(" .
"editform.wpTextbox1.value," .
'"' . $liveAction . '"' . ")";
'log_comment',
'log_params',
'user_name', ),
- array( 'log_namespace' => $this->mArticle->getTitle()->getNamespace(),
- 'log_title' => $this->mArticle->getTitle()->getDBkey(),
+ array( 'log_namespace' => $this->mTitle->getNamespace(),
+ 'log_title' => $this->mTitle->getDBkey(),
'log_type' => 'delete',
'log_action' => 'delete',
'user_id=log_user' ),
# XXX: stupid php bug won't let us use $wgTitle->isCssJsSubpage() here
if ( $this->isCssJsSubpage ) {
- if(preg_match("/\\.css$/", $this->mArticle->getTitle()->getText() ) ) {
+ if(preg_match("/\\.css$/", $wgTitle->getText() ) ) {
$previewtext = wfMsg('usercsspreview');
- } else if(preg_match("/\\.js$/", $this->mArticle->getTitle()->getText() ) ) {
+ } else if(preg_match("/\\.js$/", $wgTitle->getText() ) ) {
$previewtext = wfMsg('userjspreview');
}
$parserOptions->setTidy(true);
- $parserOutput = $wgParser->parse( $previewtext , $this->mArticle->getTitle(), $parserOptions );
+ $parserOutput = $wgParser->parse( $previewtext , $wgTitle, $parserOptions );
$wgOut->addHTML( $parserOutput->mText );
wfProfileOut( $fname );
return $previewhead;
if ( $this->mMetaData != "" ) $toparse .= "\n" . $this->mMetaData ;
$parserOptions->setTidy(true);
$parserOutput = $wgParser->parse( $this->mArticle->preSaveTransform( $toparse ) ."\n\n",
- $this->mArticle->getTitle(), $parserOptions );
+ $wgTitle, $parserOptions );
$previewHTML = $parserOutput->getText();
$wgOut->addParserOutputNoText( $parserOutput );
# (This happens when a user is blocked during edit, for instance)
$first = $this->firsttime || ( !$this->save && $this->textbox1 == '' );
if( $first ) {
- $source = $this->mArticle->getTitle()->exists() ? $this->getContent() : false;
+ $source = $this->mTitle->exists() ? $this->getContent() : false;
} else {
$source = $this->textbox1;
}
$cols = $wgUser->getOption( 'cols' );
$attribs = array( 'id' => 'wpTextbox1', 'name' => 'wpTextbox1', 'cols' => $cols, 'rows' => $rows, 'readonly' => 'readonly' );
$wgOut->addHtml( '<hr />' );
- $wgOut->addWikiText( wfMsg( $first ? 'blockedoriginalsource' : 'blockededitsource', $this->mArticle->getTitle()->getPrefixedText() ) );
+ $wgOut->addWikiText( wfMsg( $first ? 'blockedoriginalsource' : 'blockededitsource', $this->mTitle->getPrefixedText() ) );
$wgOut->addHtml( wfOpenElement( 'textarea', $attribs ) . htmlspecialchars( $source ) . wfCloseElement( 'textarea' ) );
}
}
// This is the revision the editor started from
$baseRevision = Revision::loadFromTimestamp(
- $db, $this->mArticle->getTitle(), $this->edittime );
+ $db, $this->mArticle->mTitle, $this->edittime );
if( is_null( $baseRevision ) ) {
wfProfileOut( $fname );
return false;
// The current state, we want to merge updates into it
$currentRevision = Revision::loadFromTitle(
- $db, $this->mArticle->getTitle() );
+ $db, $this->mArticle->mTitle );
if( is_null( $currentRevision ) ) {
wfProfileOut( $fname );
return false;
$oldtitle = wfMsgExt( 'currentrev', array('parseinline') );
$newtitle = wfMsgExt( 'yourtext', array('parseinline') );
if ( $oldtext !== false || $newtext != '' ) {
- $de = new DifferenceEngine( $this->mArticle->getTitle() );
+ $de = new DifferenceEngine( $this->mTitle );
$de->setText( $oldtext, $newtext );
$difftext = $de->getDiff( $oldtitle, $newtitle );
$de->showDiffStyle();