* Non-working API to facilitate dev collaboration. Do not enable this yet in localset...
[lhc/web/wiklou.git] / includes / DifferenceEngine.php
index 490a889..6dc82d6 100644 (file)
@@ -169,7 +169,7 @@ CONTROL;
                $prevlink = $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'previousdiff' ),
                        'diff=prev&oldid='.$this->mOldid, '', '', 'id="differences-prevlink"' );
                if ( $this->mNewRev->isCurrent() ) {
-                       $nextlink = '';
+                       $nextlink = ' ';
                } else {
                        $nextlink = $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'nextdiff' ),
                                'diff=next&oldid='.$this->mNewid, '', '', 'id="differences-nextlink"' );
@@ -188,7 +188,7 @@ CONTROL;
                $wgOut->addHTML( "<hr /><h2>{$this->mPagetitle}</h2>\n" );
 
                if( !$this->mNewRev->isCurrent() ) {
-                       $oldEditSectionSetting = $wgOut->mParserOptions->setEditSection( false );
+                       $oldEditSectionSetting = $wgOut->parserOptions()->setEditSection( false );
                }
 
                $this->loadNewText();
@@ -198,7 +198,7 @@ CONTROL;
                $wgOut->addSecondaryWikiText( $this->mNewtext );
 
                if( !$this->mNewRev->isCurrent() ) {
-                       $wgOut->mParserOptions->setEditSection( $oldEditSectionSetting );
+                       $wgOut->parserOptions()->setEditSection( $oldEditSectionSetting );
                }
 
                wfProfileOut( $fname );
@@ -411,8 +411,8 @@ CONTROL;
                # Native PHP diff
                $ota = explode( "\n", $wgContLang->segmentForDiff( $otext ) );
                $nta = explode( "\n", $wgContLang->segmentForDiff( $ntext ) );
-               $diffs =& new Diff( $ota, $nta );
-               $formatter =& new TableDiffFormatter();
+               $diffs = new Diff( $ota, $nta );
+               $formatter = new TableDiffFormatter();
                return $wgContLang->unsegmentForDiff( $formatter->format( $diffs ) );
        }
                
@@ -486,20 +486,24 @@ CONTROL;
                }
 
                // Set assorted variables
+               $timestamp = $wgLang->timeanddate( $this->mNewRev->getTimestamp(), true );
+               $this->mNewPage = $this->mNewRev->getTitle();
                if( $this->mNewRev->isCurrent() ) {
-                       $this->mNewPage = $this->mTitle;
                        $newLink = $this->mNewPage->escapeLocalUrl();
                        $this->mPagetitle = htmlspecialchars( wfMsg( 'currentrev' ) );
                        $newEdit = $this->mNewPage->escapeLocalUrl( 'action=edit' );
+                       
+                       $this->mNewtitle = "<strong><a href='$newLink'>{$this->mPagetitle}</a> ($timestamp)</strong>"
+                               . " (<a href='$newEdit'>" . htmlspecialchars( wfMsg( 'editold' ) ) . "</a>)";
+
                } else {
-                       $this->mNewPage = $this->mNewRev->getTitle();
                        $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->mPagetitle = htmlspecialchars( wfMsg( 'revisionasof', $timestamp ) );
+                       
+                       $this->mNewtitle = "<strong><a href='$newLink'>{$this->mPagetitle}</a></strong>"
+                               . " (<a href='$newEdit'>" . htmlspecialchars( wfMsg( 'editold' ) ) . "</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;