From: Bartosz DziewoƄski Date: Sun, 8 Dec 2013 18:52:51 +0000 (+0100) Subject: SpecialUndelete: Use DifferenceEngine#addHeader instead of rolling our own X-Git-Tag: 1.31.0-rc.0~17622 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles_versions%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=7477622027ce9613c7b5b77b6337e821a81afde2;p=lhc%2Fweb%2Fwiklou.git SpecialUndelete: Use DifferenceEngine#addHeader instead of rolling our own Change-Id: I4ea57e60aaf3112622d893ecd8b81f4e65e5806d --- diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index d33851d18d..264eb46d1b 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -1050,26 +1050,19 @@ class SpecialUndelete extends SpecialPage { $diffEngine = $currentRev->getContentHandler()->createDifferenceEngine( $diffContext ); $diffEngine->showDiffStyle(); - $this->getOutput()->addHTML( "
" . - "" . - "" . - "" . - "" . - "" . - "" . - "\n" . - "\n" . - "" . - $diffEngine->generateContentDiffBody( - $previousRev->getContent( Revision::FOR_THIS_USER, $this->getUser() ), - $currentRev->getContent( Revision::FOR_THIS_USER, $this->getUser() ) ) . - "
" . - $this->diffHeader( $previousRev, 'o' ) . - "" . - $this->diffHeader( $currentRev, 'n' ) . - "
" . - "
\n" + + $formattedDiff = $diffEngine->generateContentDiffBody( + $previousRev->getContent( Revision::FOR_THIS_USER, $this->getUser() ), + $currentRev->getContent( Revision::FOR_THIS_USER, $this->getUser() ) + ); + + $formattedDiff = $diffEngine->addHeader( + $formattedDiff, + $this->diffHeader( $previousRev, 'o' ), + $this->diffHeader( $currentRev, 'n' ) ); + + $this->getOutput()->addHTML( "
$formattedDiff
\n" ); } /** @@ -1111,6 +1104,8 @@ class SpecialUndelete extends SpecialPage { ); $tagSummary = ChangeTags::formatSummaryRow( $tags, 'deleteddiff' ); + // FIXME This is reimplementing DifferenceEngine#getRevisionHeader + // and partially #showDiffPage, but worse return '
' . Linker::link( $targetPage,