*/
/** */
-require_once( 'Revision.php' );
-
define( 'MAX_DIFF_LINE', 10000 );
define( 'MAX_DIFF_XREF_LENGTH', 10000 );
/**
* @todo document
- * @access public
+ * @public
* @package MediaWiki
* @subpackage DifferenceEngine
*/
class DifferenceEngine {
/**#@+
- * @access private
+ * @private
*/
var $mOldid, $mNewid, $mTitle;
var $mOldtitle, $mNewtitle, $mPagetitle;
/**
* Constructor
- * @param Title $titleObj Title object that the diff is associated with
- * @param integer $old Old ID we want to show and diff with.
- * @param string $new Either 'prev' or 'next'.
- * @param integer $rcid ??? (default 0)
+ * @param $titleObj Title object that the diff is associated with
+ * @param $old Integer: old ID we want to show and diff with.
+ * @param $new String: either 'prev' or 'next'.
+ * @param $rcid Integer: ??? FIXME (default 0)
*/
function DifferenceEngine( $titleObj = null, $old = 0, $new = 0, $rcid = 0 ) {
$this->mTitle = $titleObj;
wfProfileOut( $fname );
return;
}
+
+ wfRunHooks( 'DiffViewHeader', array( $this, $this->mOldRev, $this->mNewRev ) );
+
if ( $this->mNewRev->isCurrent() ) {
$wgOut->setArticleFlag( true );
}
$wgOut->setPageTitle( $oldTitle . ', ' . $newTitle );
}
$wgOut->setSubtitle( wfMsg( 'difference' ) );
- $wgOut->setRobotpolicy( 'noindex,follow' );
+ $wgOut->setRobotpolicy( 'noindex,nofollow' );
if ( !( $this->mOldPage->userCanRead() && $this->mNewPage->userCanRead() ) ) {
$wgOut->loginToUse();
function localiseLineNumbersCb( $matches ) {
global $wgLang;
- return wfMsg( 'lineno', $wgLang->formatNum( $matches[1] ) );
+ return wfMsgExt( 'lineno', array('parseinline'), $wgLang->formatNum( $matches[1] ) );
}
/**
// Set assorted variables
if( $this->mNewRev->isCurrent() ) {
- $this->mPagetitle = htmlspecialchars( wfMsg( 'currentrev' ) );
$this->mNewPage = $this->mTitle;
$newLink = $this->mNewPage->escapeLocalUrl();
- $this->mNewtitle = "<a href='$newLink'>{$this->mPagetitle}</a>";
+ $this->mPagetitle = htmlspecialchars( wfMsg( 'currentrev' ) );
+ $newEdit = $this->mNewPage->escapeLocalUrl( 'action=edit' );
} else {
$this->mNewPage = $this->mNewRev->getTitle();
- $newLink = $this->mNewPage->escapeLocalUrl ('oldid=' . $this->mNewid );
+ $newLink = $this->mNewPage->escapeLocalUrl( 'oldid=' . $this->mNewid );
+ $newEdit = $this->mNewPage->escapeLocalUrl( 'action=edit&oldid=' . $this->mNewid );
$t = $wgLang->timeanddate( $this->mNewRev->getTimestamp(), true );
$this->mPagetitle = htmlspecialchars( wfMsg( 'revisionasof', $t ) );
- $this->mNewtitle = "<a href='$newLink'>{$this->mPagetitle}</a>";
}
+ $this->mNewtitle = "<strong><a href='$newLink'>{$this->mPagetitle}</a></strong>"
+ . " (<a href='$newEdit'>" . htmlspecialchars( wfMsg( 'editold' ) ) . "</a>)";
// Load the old revision object
$this->mOldRev = false;
$t = $wgLang->timeanddate( $this->mOldRev->getTimestamp(), true );
$oldLink = $this->mOldPage->escapeLocalUrl( 'oldid=' . $this->mOldid );
- $this->mOldtitle = "<a href='$oldLink'>" . htmlspecialchars( wfMsg( 'revisionasof', $t ) ) . '</a>';
+ $oldEdit = $this->mOldPage->escapeLocalUrl( 'action=edit&oldid=' . $this->mOldid );
+ $this->mOldtitle = "<strong><a href='$oldLink'>" . htmlspecialchars( wfMsg( 'revisionasof', $t ) )
+ . "</a></strong> (<a href='$oldEdit'>" . htmlspecialchars( wfMsg( 'editold' ) ) . "</a>)";
}
return true;
/**
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
* Line length limits for robustness added by Tim Starling, 2005-08-31
*
* @author Geoffrey T. Dairiki, Tim Starling
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* Class representing a 'diff' between two sequences of strings.
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* FIXME: bad name.
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
* It is intended that this class be customized via inheritance,
* to obtain fancier outputs.
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/
/**
* Wikipedia Table style diff formatter.
* @todo document
- * @access private
+ * @private
* @package MediaWiki
* @subpackage DifferenceEngine
*/