*/
function isRedirect( $text = false ) {
if ( $text === false ) {
- if ( $this->mDataLoaded )
+ if ( $this->mDataLoaded )
return $this->mIsRedirect;
-
+
// Apparently loadPageData was never called
$this->loadContent();
$titleObj = Title::newFromRedirect( $this->fetchContent() );
$this->viewUpdates();
wfProfileOut( __METHOD__ );
}
-
+
protected function viewRedirect( $target, $overwriteSubtitle = true, $forceKnown = false ) {
global $wgParser, $wgOut, $wgContLang, $wgStylePath, $wgUser;
-
+
# Display redirect
$imageDir = $wgContLang->isRTL() ? 'rtl' : 'ltr';
$imageUrl = $wgStylePath.'/common/images/redirect' . $imageDir . '.png';
-
+
if( $overwriteSubtitle ) {
$wgOut->setSubtitle( wfMsgHtml( 'redirectpagesub' ) );
}
$wgOut->addHTML( '<img src="'.$imageUrl.'" alt="#REDIRECT " />' .
'<span class="redirectText">'.$link.'</span>' );
-
+
}
function addTrackbacks() {
# Update page
$ok = $this->updateRevisionOn( $dbw, $revision, $lastRevision );
-
+
wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, $baseRevId) );
if( !$ok ) {
# Update the page record with revision data
$this->updateRevisionOn( $dbw, $revision, 0 );
-
+
wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, false) );
if( !( $flags & EDIT_SUPPRESS_RC ) ) {
'page_id' => $id
), 'Article::protect'
);
-
+
wfRunHooks( 'NewRevisionFromEditComplete', array($this, $nullRevision, false) );
wfRunHooks( 'ArticleProtectComplete', array( &$this, &$wgUser, $limit, $reason ) );
function doDelete( $reason, $suppress = false ) {
global $wgOut, $wgUser;
wfDebug( __METHOD__."\n" );
-
+
$id = $this->getId();
if (wfRunHooks('ArticleDelete', array(&$this, &$wgUser, &$reason))) {
if( empty( $summary ) ){
$summary = wfMsgForContent( 'revertpage' );
}
-
+
# Allow the custom summary to use the same args as the default message
$args = array(
$target->getUserText(), $from, $s->rev_id,
$wgLang->timeanddate(wfTimestamp(TS_MW, $s->rev_timestamp), true),
$current->getId(), $wgLang->timeanddate($current->getTimestamp())
);
- $summary = wfMsgReplaceArgs( $summary, $args );
+ $summary = wfMsgReplaceArgs( $summary, $args );
# Save
$flags = EDIT_UPDATE;
. $wgUser->getSkin()->userToolLinks( $target->getUser(), $target->getUserText() );
$wgOut->addHtml( wfMsgExt( 'rollback-success', array( 'parse', 'replaceafter' ), $old, $new ) );
$wgOut->returnToMain( false, $this->mTitle );
-
+
if( !$wgRequest->getBool( 'hidediff', false ) ) {
$de = new DifferenceEngine( $this->mTitle, $current->getId(), 'next', false, true );
$de->showDiff( '', '' );
/**
* Prepare text which is about to be saved.
- * Returns a stdclass with source, pst, output and user members
+ * Returns a stdclass with source, pst and output members
*/
function prepareTextForEdit( $text, $revid=null ) {
if ( $this->mPreparedEdit && $this->mPreparedEdit->newText == $text && $this->mPreparedEdit->revid == $revid) {
$edit->revid = $revid;
$edit->newText = $text;
$edit->pst = $this->preSaveTransform( $text );
- $user = new User();
- $options = new ParserOptions( $user );
+ $options = new ParserOptions;
$options->setTidy( true );
- $options->setInterfaceMessage( true ); // @bug 14404
$options->enableLimitReport();
$edit->output = $wgParser->parse( $edit->pst, $this->mTitle, $options, true, true, $revid );
$edit->oldText = $this->getContent();
- $edit->user = $user;
$this->mPreparedEdit = $edit;
return $edit;
}
# Save it to the parser cache
if ( $wgEnableParserCache ) {
$parserCache = ParserCache::singleton();
- $parserCache->save( $editInfo->output, $this, $editInfo->user, /*content*/true );
+ $parserCache->save( $editInfo->output, $this, $wgUser );
}
# Update the links tables
$revision->insertOn( $dbw );
$this->updateRevisionOn( $dbw, $revision );
$dbw->commit();
-
+
wfRunHooks( 'NewRevisionFromEditComplete', array($this, $revision, false) );
wfProfileOut( __METHOD__ );