r75481 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75480‎ | r75481 | r75482 >
Date:22:34, 26 October 2010
Author:platonides
Status:ok
Tags:
Comment:
Address my own CR in r75332.
Modified paths:
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/diff/DifferenceInterface.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -373,6 +373,10 @@
374374 $output: the OutputPage object ($wgOut)
375375 &$reason: the reason (string) the article is being deleted
376376
 377+'ArticleContentOnDiff': before showing the article below a diff
 378+ $diffEngine: the DifferenceEngine
 379+ $output: the OutputPage object ($wgOut)
 380+
377381 'ArticleDelete': before an article is deleted
378382 $article: the article (object) being deleted
379383 $user: the user (object) deleting the article
Index: trunk/phase3/includes/diff/DifferenceInterface.php
@@ -456,9 +456,8 @@
457457 $wgOut->addHTML( htmlspecialchars( $this->mNewtext ) );
458458 $wgOut->addHTML( "\n</pre>\n" );
459459 }
460 - } elseif( wfRunHooks( 'ArticleContentOnDiff', array( $this, &$wgOut ) ) ) {
461 - //TODO: document this hook
462 - if( $pCache ) {
 460+ } elseif( wfRunHooks( 'ArticleContentOnDiff', array( $this, $wgOut ) ) ) {
 461+ if ( $pCache ) {
463462 $article = new Article( $this->mTitle, 0 );
464463 $pOutput = ParserCache::singleton()->get( $article, $wgOut->parserOptions() );
465464 if( $pOutput ) {
@@ -467,13 +466,14 @@
468467 $article->doViewParse();
469468 }
470469 } else {
471 - $wgOut->addWikiTextTidy( $this->mNewtext );
 470+ $wgOut->addWikiTextTidy( $this->mNewtext );
472471 }
473 - if( is_object( $this->mNewRev ) && !$this->mNewRev->isCurrent() ) {
474 - $wgOut->parserOptions()->setEditSection( $oldEditSectionSetting );
475 - }
476472 }
477473
 474+ if( is_object( $this->mNewRev ) && !$this->mNewRev->isCurrent() ) {
 475+ $wgOut->parserOptions()->setEditSection( $oldEditSectionSetting );
 476+ }
 477+
478478 # Add redundant patrol link on bottom...
479479 if( $this->mRcidMarkPatrolled && $this->mTitle->quickUserCan('patrol') ) {
480480 $sk = $wgUser->getSkin();

Follow-up revisions

RevisionCommit summaryAuthorDate
r76444MFT r75332, r75481: Adding hook for changing content on diff pagesdemon15:03, 10 November 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r75332bug25289 Hook that optionally adds custom content instead of article content ...pdhanda18:57, 24 October 2010

Status & tagging log