From: Priyanka Dhanda Date: Sun, 24 Oct 2010 18:57:25 +0000 (+0000) Subject: bug25289 Hook that optionally adds custom content instead of article content on diff... X-Git-Tag: 1.31.0-rc.0~34334 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=d9739ef974dd4921157a4653fc97389e50e44edb;p=lhc%2Fweb%2Fwiklou.git 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. --- 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();