<?php
/**
* @defgroup DifferenceEngine DifferenceEngine
- *
- * @file
- * See diff.doc
- * @todo indicate where diff.doc can be found.
*/
/**
$this->mRefreshCache = $refreshCache;
}
+ function getTitle() {
+ return $this->mTitle;
+ }
+
function showDiffPage( $diffOnly = false ) {
global $wgUser, $wgOut, $wgUseExternalEditor, $wgUseRCPatrol;
wfProfileIn( __METHOD__ );
$wgOut->setArticleFlag( false );
if ( ! $this->loadRevisionData() ) {
- $t = $this->mTitle->getPrefixedText() . ' ' . wfMsgExt( 'missingarticle-diff', array( 'escape' ), $this->mOldid, $this->mNewid );
+ $t = $this->mTitle->getPrefixedText();
+ $d = wfMsgExt( 'missingarticle-diff', array( 'escape' ), $this->mOldid, $this->mNewid );
$wgOut->setPagetitle( wfMsg( 'errorpagetitle' ) );
- $wgOut->addWikiMsg( 'missingarticle', "<nowiki>$t</nowiki>" );
+ $wgOut->addWikiMsg( 'missing-article', "<nowiki>$t</nowiki>", $d );
wfProfileOut( __METHOD__ );
return;
}
$wgOut->setPageTitle( $oldTitle . ', ' . $newTitle );
}
$wgOut->setSubtitle( wfMsg( 'difference' ) );
- $wgOut->setRobotpolicy( 'noindex,nofollow' );
+ $wgOut->setRobotPolicy( 'noindex,nofollow' );
if ( !( $this->mOldPage->userCanRead() && $this->mNewPage->userCanRead() ) ) {
$wgOut->loginToUse();
$sk = $wgUser->getSkin();
- if ( $this->mNewRev->isCurrent() && $wgUser->isAllowed('rollback') ) {
+ // Check if page is editable
+ $editable = $this->mNewRev->getTitle()->userCan( 'edit' );
+ if ( $editable && $this->mNewRev->isCurrent() && $wgUser->isAllowed( 'rollback' ) ) {
$rollback = ' ' . $sk->generateRollback( $this->mNewRev );
} else {
$rollback = '';
# Get article text from the DB
#
if ( ! $this->loadNewText() ) {
- $t = $this->mTitle->getPrefixedText() . ' ' . wfMsgExt( 'missingarticle-diff', array( 'escape' ), $this->mOldid, $this->mNewid );
+ $t = $this->mTitle->getPrefixedText();
+ $d = wfMsgExt( 'missingarticle-diff', array( 'escape' ), $this->mOldid, $this->mNewid );
$wgOut->setPagetitle( wfMsg( 'errorpagetitle' ) );
- $wgOut->addWikiMsg( 'missingarticle', "<nowiki>$t</nowiki>" );
+ $wgOut->addWikiMsg( 'missing-article', "<nowiki>$t</nowiki>", $d );
wfProfileOut( __METHOD__ );
return;
}
$wgOut->addHTML( $header );
$wgOut->setSubtitle( wfMsg( 'difference' ) );
- $wgOut->setRobotpolicy( 'noindex,nofollow' );
+ $wgOut->setRobotPolicy( 'noindex,nofollow' );
wfProfileOut( __METHOD__ );
}
global $wgOut;
$diff = $this->getDiff( $otitle, $ntitle );
if ( $diff === false ) {
- $wgOut->addWikiMsg( 'missingarticle', "<nowiki>(fixme, bug)</nowiki>" );
+ $wgOut->addWikiMsg( 'missing-article', "<nowiki>(fixme, bug)</nowiki>", '' );
return false;
} else {
$this->showDiffStyle();
$timestamp = $wgLang->timeanddate( $this->mNewRev->getTimestamp(), true );
$this->mNewPage = $this->mNewRev->getTitle();
if( $this->mNewRev->isCurrent() ) {
- $newLink = $this->mNewPage->escapeLocalUrl();
+ $newLink = $this->mNewPage->escapeLocalUrl( 'oldid=' . $this->mNewid );
$this->mPagetitle = htmlspecialchars( wfMsg( 'currentrev' ) );
$newEdit = $this->mNewPage->escapeLocalUrl( 'action=edit' );