From: Arne Heizmann Date: Sat, 28 Aug 2004 19:08:17 +0000 (+0000) Subject: make "Revision as of [time] [date]" link to the relevant revision X-Git-Tag: 1.5.0alpha1~2209 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=487722221b73039c5921fe7a01b8654cae9a3419;p=lhc%2Fweb%2Fwiklou.git make "Revision as of [time] [date]" link to the relevant revision --- diff --git a/includes/DifferenceEngine.php b/includes/DifferenceEngine.php index 1bad821058..571b7abbcd 100644 --- a/includes/DifferenceEngine.php +++ b/includes/DifferenceEngine.php @@ -3,7 +3,7 @@ class DifferenceEngine { /* private */ var $mOldid, $mNewid; - /* private */ var $mOldtitle, $mNewtitle; + /* private */ var $mOldtitle, $mNewtitle, $mPagetitle; /* private */ var $mOldtext, $mNewtext; /* private */ var $mOldUser, $mNewUser; /* private */ var $mOldComment, $mNewComment; @@ -90,7 +90,7 @@ class DifferenceEngine { DifferenceEngine::showDiff( $this->mOldtext, $this->mNewtext, $oldHeader, $newHeader ); - $wgOut->addHTML( "

{$this->mNewtitle}

\n" ); + $wgOut->addHTML( "

{$this->mPagetitle}

\n" ); $wgOut->addWikiText( $this->mNewtext ); wfProfileOut( $fname ); @@ -137,7 +137,9 @@ cellpadding='0' cellspacing='4px' class='diff'> $dbr =& wfGetDB( DB_SLAVE ); if ( 0 == $this->mNewid || 0 == $this->mOldid ) { $wgOut->setArticleFlag( true ); - $this->mNewtitle = wfMsg( 'currentrev' ); + $newLink = $wgTitle->getLocalUrl(); + $this->mPagetitle = wfMsg( 'currentrev' ); + $this->mNewtitle = "{$this->mPagetitle}"; $id = $wgTitle->getArticleID(); $s = $dbr->getArray( 'cur', array( 'cur_text', 'cur_user_text', 'cur_comment' ), @@ -162,7 +164,9 @@ cellpadding='0' cellspacing='4px' class='diff'> $t = $wgLang->timeanddate( $s->old_timestamp, true ); $this->mNewPage = Title::MakeTitle( $s->old_namespace, $s->old_title ); - $this->mNewtitle = wfMsg( 'revisionasof', $t ); + $newLink = $wgTitle->getLocalUrl ('oldid=' . $this->mNewid); + $this->mPagetitle = wfMsg( 'revisionasof', $t ); + $this->mNewtitle = "{$this->mPagetitle}"; $this->mNewUser = $s->old_user_text; $this->mNewComment = $s->old_comment; } @@ -188,7 +192,8 @@ cellpadding='0' cellspacing='4px' class='diff'> $this->mOldtext = Article::getRevisionText( $s ); $t = $wgLang->timeanddate( $s->old_timestamp, true ); - $this->mOldtitle = wfMsg( 'revisionasof', $t ); + $oldLink = $this->mOldPage->getLocalUrl ('oldid=' . $this->mOldid); + $this->mOldtitle = "" . wfMsg( 'revisionasof', $t ) . ''; $this->mOldUser = $s->old_user_text; $this->mOldComment = $s->old_comment;