From 7477622027ce9613c7b5b77b6337e821a81afde2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Sun, 8 Dec 2013 19:52:51 +0100 Subject: [PATCH] SpecialUndelete: Use DifferenceEngine#addHeader instead of rolling our own Change-Id: I4ea57e60aaf3112622d893ecd8b81f4e65e5806d --- includes/specials/SpecialUndelete.php | 33 ++++++++++++--------------- 1 file changed, 14 insertions(+), 19 deletions(-) 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, -- 2.20.1