ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
DifferenceEngine Class Reference
+ Collaboration diagram for DifferenceEngine:

Public Member Functions

 DifferenceEngine ($titleObj=null, $old=0, $new=0, $rcid=0)
 #@-
 showDiffPage ($diffOnly=false)
 renderNewRevision ()
 Show the new revision of the page.
 showFirstRevision ()
 Show the first revision of an article.
 showDiff ($otitle, $ntitle)
 Get the diff text, send it to $wgOut Returns false if the diff could not be generated, otherwise returns true.
 getDiff ($otitle, $ntitle)
 Get diff table, including header Note that the interface has changed, it's no longer static.
 getDiffBody ()
 Get the diff table body, without header Results are cached Returns false on error.
 generateDiffBody ($otext, $ntext)
 Generate a diff, no caching $otext and $ntext must be already segmented.
 localiseLineNumbers ($text)
 Replace line numbers with the text in the user's language.
 localiseLineNumbersCb ($matches)
 getMultiNotice ()
 If there are revisions between the ones being compared, return a note saying so.
 addHeader ($diff, $otitle, $ntitle, $multi= '')
 Add the header to a diff body.
 setText ($oldText, $newText)
 Use specified text instead of loading from the database.
 loadRevisionData ()
 Load revision metadata for the specified articles.
 loadText ()
 Load the text of the revisions, as well as revision data.
 loadNewText ()
 Load the text of the new revision, not the old one.

Data Fields

 $mNewid
 $mTitle
 $mOldtitle
 $mNewtitle
 $mPagetitle
 $mOldtext
 $mNewtext
 $mOldPage
 $mNewPage
 $mRcidMarkPatrolled
 $mOldRev
 $mNewRev
 $mRevisionsLoaded = false
 $mTextLoaded = 0

Private Attributes

 $mOldid
 #@+

Detailed Description

Definition at line 17 of file class.WordLevelDiff.php.

Member Function Documentation

DifferenceEngine::addHeader (   $diff,
  $otitle,
  $ntitle,
  $multi = '' 
)

Add the header to a diff body.

Definition at line 485 of file class.WordLevelDiff.php.

Referenced by getDiff().

{
global $wgOut;
if ( $this->mOldRev && $this->mOldRev->isDeleted(Revision::DELETED_TEXT) ) {
$otitle = '<span class="history-deleted">'.$otitle.'</span>';
}
if ( $this->mNewRev && $this->mNewRev->isDeleted(Revision::DELETED_TEXT) ) {
$ntitle = '<span class="history-deleted">'.$ntitle.'</span>';
}
$header = "
<table border='0' width='98%' cellpadding='0' cellspacing='4' class='diff'>
<tr>
<td colspan='2' width='50%' align='center' class='diff-otitle'>{$otitle}</td>
<td colspan='2' width='50%' align='center' class='diff-ntitle'>{$ntitle}</td>
</tr>
";
if ( $multi != '' )
$header .= "<tr><td colspan='4' align='center' class='diff-multi'>{$multi}</td></tr>";
return $header . $diff . "</table>";
}

+ Here is the caller graph for this function:

DifferenceEngine::DifferenceEngine (   $titleObj = null,
  $old = 0,
  $new = 0,
  $rcid = 0 
)

#@-

Constructor

Parameters
$titleObjTitle object that the diff is associated with
$oldInteger: old ID we want to show and diff with.
$newString: either 'prev' or 'next'.
$rcidInteger: ??? FIXME (default 0)

Definition at line 38 of file class.WordLevelDiff.php.

{
$this->mTitle = $titleObj;
wfDebug("DifferenceEngine old '$old' new '$new' rcid '$rcid'\n");
if ( 'prev' === $new ) {
# Show diff between revision $old and the previous one.
# Get previous one from DB.
#
$this->mNewid = intval($old);
$this->mOldid = $this->mTitle->getPreviousRevisionID( $this->mNewid );
} elseif ( 'next' === $new ) {
# Show diff between revision $old and the previous one.
# Get previous one from DB.
#
$this->mOldid = intval($old);
$this->mNewid = $this->mTitle->getNextRevisionID( $this->mOldid );
if ( false === $this->mNewid ) {
# if no result, NewId points to the newest old revision. The only newer
# revision is cur, which is "0".
$this->mNewid = 0;
}
} else {
$this->mOldid = intval($old);
$this->mNewid = intval($new);
}
$this->mRcidMarkPatrolled = intval($rcid); # force it to be an integer
}
DifferenceEngine::generateDiffBody (   $otext,
  $ntext 
)

Generate a diff, no caching $otext and $ntext must be already segmented.

Definition at line 371 of file class.WordLevelDiff.php.

References $cmd.

Referenced by getDiffBody().

{
global $wgExternalDiffEngine, $wgContLang;
$fname = 'DifferenceEngine::generateDiffBody';
$otext = str_replace( "\r\n", "\n", $otext );
$ntext = str_replace( "\r\n", "\n", $ntext );
if ( $wgExternalDiffEngine == 'wikidiff' ) {
# For historical reasons, external diff engine expects
# input text to be HTML-escaped already
$otext = htmlspecialchars ( $wgContLang->segmentForDiff( $otext ) );
$ntext = htmlspecialchars ( $wgContLang->segmentForDiff( $ntext ) );
if( !function_exists( 'wikidiff_do_diff' ) ) {
dl('php_wikidiff.so');
}
return $wgContLang->unsegementForDiff( wikidiff_do_diff( $otext, $ntext, 2 ) );
}
if ( $wgExternalDiffEngine == 'wikidiff2' ) {
# Better external diff engine, the 2 may some day be dropped
# This one does the escaping and segmenting itself
if ( !function_exists( 'wikidiff2_do_diff' ) ) {
//wfProfileIn( "$fname-dl" );
@dl('php_wikidiff2.so');
//wfProfileOut( "$fname-dl" );
}
if ( function_exists( 'wikidiff2_do_diff' ) ) {
//wfProfileIn( 'wikidiff2_do_diff' );
$text = wikidiff2_do_diff( $otext, $ntext, 2 );
//wfProfileOut( 'wikidiff2_do_diff' );
return $text;
}
}
if ( $wgExternalDiffEngine !== false ) {
# Diff via the shell
global $wgTmpDirectory;
$tempName1 = tempnam( $wgTmpDirectory, 'diff_' );
$tempName2 = tempnam( $wgTmpDirectory, 'diff_' );
$tempFile1 = fopen( $tempName1, "w" );
if ( !$tempFile1 ) {
//wfProfileOut( $fname );
return false;
}
$tempFile2 = fopen( $tempName2, "w" );
if ( !$tempFile2 ) {
//wfProfileOut( $fname );
return false;
}
fwrite( $tempFile1, $otext );
fwrite( $tempFile2, $ntext );
fclose( $tempFile1 );
fclose( $tempFile2 );
$cmd = wfEscapeShellArg( $wgExternalDiffEngine, $tempName1, $tempName2 );
//wfProfileIn( "$fname-shellexec" );
$difftext = wfShellExec( $cmd );
//wfProfileOut( "$fname-shellexec" );
unlink( $tempName1 );
unlink( $tempName2 );
return $difftext;
}
# Native PHP diff
$ota = explode( "\n", $wgContLang->segmentForDiff( $otext ) );
$nta = explode( "\n", $wgContLang->segmentForDiff( $ntext ) );
$diffs = new Diff( $ota, $nta );
$formatter = new TableDiffFormatter();
return $wgContLang->unsegmentForDiff( $formatter->format( $diffs ) );
}

+ Here is the caller graph for this function:

DifferenceEngine::getDiff (   $otitle,
  $ntitle 
)

Get diff table, including header Note that the interface has changed, it's no longer static.

Returns false on error

Definition at line 305 of file class.WordLevelDiff.php.

References addHeader(), getDiffBody(), and getMultiNotice().

Referenced by showDiff().

{
$body = $this->getDiffBody();
if ( $body === false ) {
return false;
} else {
$multi = $this->getMultiNotice();
return $this->addHeader( $body, $otitle, $ntitle, $multi );
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DifferenceEngine::getDiffBody ( )

Get the diff table body, without header Results are cached Returns false on error.

Definition at line 320 of file class.WordLevelDiff.php.

References generateDiffBody(), loadText(), and localiseLineNumbers().

Referenced by getDiff().

{
global $wgMemc;
$fname = 'DifferenceEngine::getDiffBody';
//wfProfileIn( $fname );
// Cacheable?
$key = false;
if ( $this->mOldid && $this->mNewid ) {
// Try cache
$key = wfMemcKey( 'diff', 'oldid', $this->mOldid, 'newid', $this->mNewid );
$difftext = $wgMemc->get( $key );
if ( $difftext ) {
wfIncrStats( 'diff_cache_hit' );
$difftext = $this->localiseLineNumbers( $difftext );
$difftext .= "\n<!-- diff cache key $key -->\n";
//wfProfileOut( $fname );
return $difftext;
}
}
#loadtext is permission safe, this just clears out the diff
if ( !$this->loadText() ) {
//wfProfileOut( $fname );
return false;
} else if ( $this->mOldRev && !$this->mOldRev->userCan(Revision::DELETED_TEXT) ) {
return '';
} else if ( $this->mNewRev && !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) {
return '';
}
$difftext = $this->generateDiffBody( $this->mOldtext, $this->mNewtext );
// Save to cache for 7 days
if ( $key !== false && $difftext !== false ) {
wfIncrStats( 'diff_cache_miss' );
$wgMemc->set( $key, $difftext, 7*86400 );
} else {
wfIncrStats( 'diff_uncacheable' );
}
// Replace line numbers with the text in the user's language
if ( $difftext !== false ) {
$difftext = $this->localiseLineNumbers( $difftext );
}
//wfProfileOut( $fname );
return $difftext;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DifferenceEngine::getMultiNotice ( )

If there are revisions between the ones being compared, return a note saying so.

Definition at line 459 of file class.WordLevelDiff.php.

References $n.

Referenced by getDiff().

{
if ( !is_object($this->mOldRev) || !is_object($this->mNewRev) )
return '';
if( !$this->mOldPage->equals( $this->mNewPage ) ) {
// Comparing two different pages? Count would be meaningless.
return '';
}
$oldid = $this->mOldRev->getId();
$newid = $this->mNewRev->getId();
if ( $oldid > $newid ) {
$tmp = $oldid; $oldid = $newid; $newid = $tmp;
}
$n = $this->mTitle->countRevisionsBetween( $oldid, $newid );
if ( !$n )
return '';
return wfMsgExt( 'diff-multi', array( 'parseinline' ), $n );
}

+ Here is the caller graph for this function:

DifferenceEngine::loadNewText ( )

Load the text of the new revision, not the old one.

Definition at line 636 of file class.WordLevelDiff.php.

References loadRevisionData().

Referenced by renderNewRevision(), and showFirstRevision().

{
if ( $this->mTextLoaded >= 1 ) {
return true;
} else {
$this->mTextLoaded = 1;
}
if ( !$this->loadRevisionData() ) {
return false;
}
$this->mNewtext = $this->mNewRev->getText();
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DifferenceEngine::loadRevisionData ( )

Load revision metadata for the specified articles.

If newid is 0, then compare the old article in oldid to the current article; if oldid is 0, then compare the current article to the immediately previous one (ignoring the value of newid).

If oldid is false, leave the corresponding revision object set to false. This is impossible via ordinary user input, and is provided for API convenience.

Definition at line 527 of file class.WordLevelDiff.php.

References $t, $timestamp, and wfMsg().

Referenced by loadNewText(), loadText(), and showDiffPage().

{
global $wgLang;
if ( $this->mRevisionsLoaded ) {
return true;
} else {
// Whether it succeeds or fails, we don't want to try again
$this->mRevisionsLoaded = true;
}
// Load the new revision object
if( $this->mNewid ) {
$this->mNewRev = Revision::newFromId( $this->mNewid );
} else {
$this->mNewRev = Revision::newFromTitle( $this->mTitle );
}
if( is_null( $this->mNewRev ) ) {
return false;
}
// Set assorted variables
$timestamp = $wgLang->timeanddate( $this->mNewRev->getTimestamp(), true );
$this->mNewPage = $this->mNewRev->getTitle();
if( $this->mNewRev->isCurrent() ) {
$newLink = $this->mNewPage->escapeLocalUrl();
$this->mPagetitle = htmlspecialchars( wfMsg( 'currentrev' ) );
$newEdit = $this->mNewPage->escapeLocalUrl( 'action=edit' );
$this->mNewtitle = "<a href='$newLink'>{$this->mPagetitle}</a> ($timestamp)"
. " (<a href='$newEdit'>" . htmlspecialchars( wfMsg( 'editold' ) ) . "</a>)";
} else {
$newLink = $this->mNewPage->escapeLocalUrl( 'oldid=' . $this->mNewid );
$newEdit = $this->mNewPage->escapeLocalUrl( 'action=edit&oldid=' . $this->mNewid );
$this->mPagetitle = htmlspecialchars( wfMsg( 'revisionasof', $timestamp ) );
$this->mNewtitle = "<a href='$newLink'>{$this->mPagetitle}</a>"
. " (<a href='$newEdit'>" . htmlspecialchars( wfMsg( 'editold' ) ) . "</a>)";
}
// Load the old revision object
$this->mOldRev = false;
if( $this->mOldid ) {
$this->mOldRev = Revision::newFromId( $this->mOldid );
} elseif ( $this->mOldid === 0 ) {
$rev = $this->mNewRev->getPrevious();
if( $rev ) {
$this->mOldid = $rev->getId();
$this->mOldRev = $rev;
} else {
// No previous revision; mark to show as first-version only.
$this->mOldid = false;
$this->mOldRev = false;
}
}/* elseif ( $this->mOldid === false ) leave mOldRev false; */
if( is_null( $this->mOldRev ) ) {
return false;
}
if ( $this->mOldRev ) {
$this->mOldPage = $this->mOldRev->getTitle();
$t = $wgLang->timeanddate( $this->mOldRev->getTimestamp(), true );
$oldLink = $this->mOldPage->escapeLocalUrl( 'oldid=' . $this->mOldid );
$oldEdit = $this->mOldPage->escapeLocalUrl( 'action=edit&oldid=' . $this->mOldid );
$this->mOldtitle = "<a href='$oldLink'>" . htmlspecialchars( wfMsg( 'revisionasof', $t ) )
. "</a> (<a href='$oldEdit'>" . htmlspecialchars( wfMsg( 'editold' ) ) . "</a>)";
//now that we considered old rev, we can make undo link (bug 8133, multi-edit undo)
$newUndo = $this->mNewPage->escapeLocalUrl( 'action=edit&undoafter=' . $this->mOldid . '&undo=' . $this->mNewid);
$this->mNewtitle .= " (<a href='$newUndo'>" . htmlspecialchars( wfMsg( 'editundo' ) ) . "</a>)";
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DifferenceEngine::loadText ( )

Load the text of the revisions, as well as revision data.

Definition at line 606 of file class.WordLevelDiff.php.

References loadRevisionData().

Referenced by getDiffBody().

{
if ( $this->mTextLoaded == 2 ) {
return true;
} else {
// Whether it succeeds or fails, we don't want to try again
$this->mTextLoaded = 2;
}
if ( !$this->loadRevisionData() ) {
return false;
}
if ( $this->mOldRev ) {
// FIXME: permission tests
$this->mOldtext = $this->mOldRev->revText();
if ( $this->mOldtext === false ) {
return false;
}
}
if ( $this->mNewRev ) {
$this->mNewtext = $this->mNewRev->revText();
if ( $this->mNewtext === false ) {
return false;
}
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DifferenceEngine::localiseLineNumbers (   $text)

Replace line numbers with the text in the user's language.

Definition at line 445 of file class.WordLevelDiff.php.

Referenced by getDiffBody().

{
return preg_replace_callback( '/<!--LINE (\d+)-->/',
array( &$this, 'localiseLineNumbersCb' ), $text );
}

+ Here is the caller graph for this function:

DifferenceEngine::localiseLineNumbersCb (   $matches)

Definition at line 450 of file class.WordLevelDiff.php.

{
global $wgLang;
return wfMsgExt( 'lineno', array('parseinline'), $wgLang->formatNum( $matches[1] ) );
}
DifferenceEngine::renderNewRevision ( )

Show the new revision of the page.

Definition at line 203 of file class.WordLevelDiff.php.

References loadNewText(), and wfMsg().

Referenced by showDiffPage().

{
global $wgOut;
$fname = 'DifferenceEngine::renderNewRevision';
//wfProfileIn( $fname );
$wgOut->addHTML( "<hr /><h2>{$this->mPagetitle}</h2>\n" );
#add deleted rev tag if needed
if ( !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) {
$wgOut->addWikiText( wfMsg( 'rev-deleted-text-permission' ) );
}
if( !$this->mNewRev->isCurrent() ) {
$oldEditSectionSetting = $wgOut->parserOptions()->setEditSection( false );
}
$this->loadNewText();
if( is_object( $this->mNewRev ) ) {
$wgOut->setRevisionId( $this->mNewRev->getId() );
}
$wgOut->addWikiTextTidy( $this->mNewtext );
if( !$this->mNewRev->isCurrent() ) {
$wgOut->parserOptions()->setEditSection( $oldEditSectionSetting );
}
//wfProfileOut( $fname );
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DifferenceEngine::setText (   $oldText,
  $newText 
)

Use specified text instead of loading from the database.

Definition at line 511 of file class.WordLevelDiff.php.

{
$this->mOldtext = $oldText;
$this->mNewtext = $newText;
$this->mTextLoaded = 2;
}
DifferenceEngine::showDiff (   $otitle,
  $ntitle 
)

Get the diff text, send it to $wgOut Returns false if the diff could not be generated, otherwise returns true.

Definition at line 288 of file class.WordLevelDiff.php.

References getDiff(), and wfMsg().

Referenced by showDiffPage().

{
global $wgOut;
$diff = $this->getDiff( $otitle, $ntitle );
if ( $diff === false ) {
$wgOut->addWikitext( wfMsg( 'missingarticle', "<nowiki>(fixme, bug)</nowiki>" ) );
return false;
} else {
$wgOut->addHTML( $diff );
return true;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DifferenceEngine::showDiffPage (   $diffOnly = false)

Definition at line 69 of file class.WordLevelDiff.php.

References $t, exit, loadRevisionData(), renderNewRevision(), showDiff(), showFirstRevision(), and wfMsg().

{
global $wgUser, $wgOut, $wgUseExternalEditor, $wgUseRCPatrol;
$fname = 'DifferenceEngine::showDiffPage';
//wfProfileIn( $fname );
# If external diffs are enabled both globally and for the user,
# we'll use the application/x-external-editor interface to call
# an external diff tool like kompare, kdiff3, etc.
if($wgUseExternalEditor && $wgUser->getOption('externaldiff')) {
global $wgInputEncoding,$wgServer,$wgScript,$wgLang;
$wgOut->disable();
header ( "Content-type: application/x-external-editor; charset=".$wgInputEncoding );
$url1=$this->mTitle->getFullURL("action=raw&oldid=".$this->mOldid);
$url2=$this->mTitle->getFullURL("action=raw&oldid=".$this->mNewid);
$special=$wgLang->getNsText(NS_SPECIAL);
$control=<<<CONTROL
[Process]
Type=Diff text
Engine=MediaWiki
Script={$wgServer}{$wgScript}
Special namespace={$special}
[File]
Extension=wiki
URL=$url1
[File 2]
Extension=wiki
URL=$url2
CONTROL;
echo($control);
return;
}
$wgOut->setArticleFlag( false );
if ( ! $this->loadRevisionData() ) {
$t = $this->mTitle->getPrefixedText() . " (Diff: {$this->mOldid}, {$this->mNewid})";
$mtext = wfMsg( 'missingarticle', "<nowiki>$t</nowiki>" );
$wgOut->setPagetitle( wfMsg( 'errorpagetitle' ) );
$wgOut->addWikitext( $mtext );
//wfProfileOut( $fname );
return;
}
wfRunHooks( 'DiffViewHeader', array( $this, $this->mOldRev, $this->mNewRev ) );
if ( $this->mNewRev->isCurrent() ) {
$wgOut->setArticleFlag( true );
}
# mOldid is false if the difference engine is called with a "vague" query for
# a diff between a version V and its previous version V' AND the version V
# is the first version of that article. In that case, V' does not exist.
if ( $this->mOldid === false ) {
$this->renderNewRevision(); // should we respect $diffOnly here or not?
//wfProfileOut( $fname );
return;
}
$wgOut->suppressQuickbar();
$oldTitle = $this->mOldPage->getPrefixedText();
$newTitle = $this->mNewPage->getPrefixedText();
if( $oldTitle == $newTitle ) {
$wgOut->setPageTitle( $newTitle );
} else {
$wgOut->setPageTitle( $oldTitle . ', ' . $newTitle );
}
$wgOut->setSubtitle( wfMsg( 'difference' ) );
$wgOut->setRobotpolicy( 'noindex,nofollow' );
if ( !( $this->mOldPage->userCanRead() && $this->mNewPage->userCanRead() ) ) {
$wgOut->loginToUse();
$wgOut->output();
//wfProfileOut( $fname );
}
$sk = $wgUser->getSkin();
if ( $this->mNewRev->isCurrent() && $wgUser->isAllowed('rollback') ) {
$rollback = '&nbsp;&nbsp;&nbsp;' . $sk->generateRollback( $this->mNewRev );
} else {
$rollback = '';
}
if( $wgUseRCPatrol && $this->mRcidMarkPatrolled != 0 && $wgUser->isAllowed( 'patrol' ) ) {
$patrol = ' [' . $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'markaspatrolleddiff' ), "action=markpatrolled&rcid={$this->mRcidMarkPatrolled}" ) . ']';
} else {
$patrol = '';
}
$prevlink = $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'previousdiff' ),
'diff=prev&oldid='.$this->mOldid, '', '', 'id="differences-prevlink"' );
if ( $this->mNewRev->isCurrent() ) {
$nextlink = '&nbsp;';
} else {
$nextlink = $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'nextdiff' ),
'diff=next&oldid='.$this->mNewid, '', '', 'id="differences-nextlink"' );
}
$oldminor = '';
$newminor = '';
if ($this->mOldRev->mMinorEdit == 1) {
$oldminor = wfElement( 'span', array( 'class' => 'minor' ),
wfMsg( 'minoreditletter') ) . ' ';
}
if ($this->mNewRev->mMinorEdit == 1) {
$newminor = wfElement( 'span', array( 'class' => 'minor' ),
wfMsg( 'minoreditletter') ) . ' ';
}
$oldHeader = "<strong>{$this->mOldtitle}</strong><br />" .
$sk->revUserTools( $this->mOldRev ) . "<br />" .
$oldminor . $sk->revComment( $this->mOldRev, !$diffOnly ) . "<br />" .
$prevlink;
$newHeader = "<strong>{$this->mNewtitle}</strong><br />" .
$sk->revUserTools( $this->mNewRev ) . " $rollback<br />" .
$newminor . $sk->revComment( $this->mNewRev, !$diffOnly ) . "<br />" .
$nextlink . $patrol;
$this->showDiff( $oldHeader, $newHeader );
if ( !$diffOnly )
//wfProfileOut( $fname );
}

+ Here is the call graph for this function:

DifferenceEngine::showFirstRevision ( )

Show the first revision of an article.

Uses normal diff headers in contrast to normal "old revision" display style.

Definition at line 236 of file class.WordLevelDiff.php.

References $t, exit, loadNewText(), and wfMsg().

Referenced by showDiffPage().

{
global $wgOut, $wgUser;
$fname = 'DifferenceEngine::showFirstRevision';
//wfProfileIn( $fname );
# Get article text from the DB
#
if ( ! $this->loadNewText() ) {
$t = $this->mTitle->getPrefixedText() . " (Diff: {$this->mOldid}, " .
"{$this->mNewid})";
$mtext = wfMsg( 'missingarticle', "<nowiki>$t</nowiki>" );
$wgOut->setPagetitle( wfMsg( 'errorpagetitle' ) );
$wgOut->addWikitext( $mtext );
//wfProfileOut( $fname );
return;
}
if ( $this->mNewRev->isCurrent() ) {
$wgOut->setArticleFlag( true );
}
# Check if user is allowed to look at this page. If not, bail out.
#
if ( !( $this->mTitle->userCanRead() ) ) {
$wgOut->loginToUse();
$wgOut->output();
//wfProfileOut( $fname );
}
# Prepare the header box
#
$sk = $wgUser->getSkin();
$nextlink = $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'nextdiff' ), 'diff=next&oldid='.$this->mNewid, '', '', 'id="differences-nextlink"' );
$header = "<div class=\"firstrevisionheader\" style=\"text-align: center\"><strong>{$this->mOldtitle}</strong><br />" .
$sk->revUserTools( $this->mNewRev ) . "<br />" .
$sk->revComment( $this->mNewRev ) . "<br />" .
$nextlink . "</div>\n";
$wgOut->addHTML( $header );
$wgOut->setSubtitle( wfMsg( 'difference' ) );
$wgOut->setRobotpolicy( 'noindex,nofollow' );
//wfProfileOut( $fname );
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

DifferenceEngine::$mNewid

Definition at line 21 of file class.WordLevelDiff.php.

DifferenceEngine::$mNewPage

Definition at line 24 of file class.WordLevelDiff.php.

DifferenceEngine::$mNewRev

Definition at line 26 of file class.WordLevelDiff.php.

DifferenceEngine::$mNewtext

Definition at line 23 of file class.WordLevelDiff.php.

DifferenceEngine::$mNewtitle

Definition at line 22 of file class.WordLevelDiff.php.

DifferenceEngine::$mOldid
private

#@+

Definition at line 21 of file class.WordLevelDiff.php.

DifferenceEngine::$mOldPage

Definition at line 24 of file class.WordLevelDiff.php.

DifferenceEngine::$mOldRev

Definition at line 26 of file class.WordLevelDiff.php.

DifferenceEngine::$mOldtext

Definition at line 23 of file class.WordLevelDiff.php.

DifferenceEngine::$mOldtitle

Definition at line 22 of file class.WordLevelDiff.php.

DifferenceEngine::$mPagetitle

Definition at line 22 of file class.WordLevelDiff.php.

DifferenceEngine::$mRcidMarkPatrolled

Definition at line 25 of file class.WordLevelDiff.php.

DifferenceEngine::$mRevisionsLoaded = false

Definition at line 27 of file class.WordLevelDiff.php.

DifferenceEngine::$mTextLoaded = 0

Definition at line 28 of file class.WordLevelDiff.php.

DifferenceEngine::$mTitle

Definition at line 21 of file class.WordLevelDiff.php.


The documentation for this class was generated from the following file: