From d9739ef974dd4921157a4653fc97389e50e44edb Mon Sep 17 00:00:00 2001 From: Priyanka Dhanda Date: Sun, 24 Oct 2010 18:57:25 +0000 Subject: [PATCH] bug25289 Hook that optionally adds custom content instead of article content on diff pages. Now only used by FlaggedRevs to not load the content on history pages when pending changes are enabled. --- includes/diff/DifferenceInterface.php | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/includes/diff/DifferenceInterface.php b/includes/diff/DifferenceInterface.php index 0281f138b7..1b2c525f5c 100644 --- a/includes/diff/DifferenceInterface.php +++ b/includes/diff/DifferenceInterface.php @@ -456,21 +456,24 @@ CONTROL; $wgOut->addHTML( htmlspecialchars( $this->mNewtext ) ); $wgOut->addHTML( "\n\n" ); } - } elseif( $pCache ) { - $article = new Article( $this->mTitle, 0 ); - $pOutput = ParserCache::singleton()->get( $article, $wgOut->parserOptions() ); - if( $pOutput ) { - $wgOut->addParserOutput( $pOutput ); + } elseif( wfRunHooks( 'ArticleContentOnDiff', array( $this, &$wgOut ) ) ) { + //TODO: document this hook + if( $pCache ) { + $article = new Article( $this->mTitle, 0 ); + $pOutput = ParserCache::singleton()->get( $article, $wgOut->parserOptions() ); + if( $pOutput ) { + $wgOut->addParserOutput( $pOutput ); + } else { + $article->doViewParse(); + } } else { - $article->doViewParse(); + $wgOut->addWikiTextTidy( $this->mNewtext ); + } + if( is_object( $this->mNewRev ) && !$this->mNewRev->isCurrent() ) { + $wgOut->parserOptions()->setEditSection( $oldEditSectionSetting ); } - } else { - $wgOut->addWikiTextTidy( $this->mNewtext ); - } - - if( is_object( $this->mNewRev ) && !$this->mNewRev->isCurrent() ) { - $wgOut->parserOptions()->setEditSection( $oldEditSectionSetting ); } + # Add redundant patrol link on bottom... if( $this->mRcidMarkPatrolled && $this->mTitle->quickUserCan('patrol') ) { $sk = $wgUser->getSkin(); -- 2.20.1