Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -1440,10 +1440,10 @@ |
1441 | 1441 | return true; |
1442 | 1442 | } |
1443 | 1443 | |
1444 | | - public static function onArticleViewHeader( &$article, &$outputDone, &$pcache ) { |
| 1444 | + public static function onArticleViewHeader( &$article, &$outputDone, &$useParserCache ) { |
1445 | 1445 | $view = FlaggedArticleView::singleton(); |
1446 | | - $view->addStableLink( $outputDone, $pcache ); |
1447 | | - $view->setPageContent( $outputDone, $pcache ); |
| 1446 | + $view->addStableLink( $outputDone, $useParserCache ); |
| 1447 | + $view->setPageContent( $outputDone, $useParserCache ); |
1448 | 1448 | return true; |
1449 | 1449 | } |
1450 | 1450 | |
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -223,7 +223,7 @@ |
224 | 224 | * Adds stable version status/info tags and notes |
225 | 225 | * Adds a quick review form on the bottom if needed |
226 | 226 | */ |
227 | | - public function setPageContent( &$outputDone, &$pcache ) { |
| 227 | + public function setPageContent( &$outputDone, &$useParserCache ) { |
228 | 228 | global $wgRequest, $wgOut, $wgLang, $wgContLang; |
229 | 229 | $this->load(); |
230 | 230 | # Only trigger on article view for content pages, not for protect/delete/hist... |
— | — | @@ -267,7 +267,7 @@ |
268 | 268 | $wgOut->returnToMain( false, $this->article->getTitle() ); |
269 | 269 | # Tell MW that parser output is done |
270 | 270 | $outputDone = true; |
271 | | - $pcache = false; |
| 271 | + $useParserCache = false; |
272 | 272 | return true; |
273 | 273 | } |
274 | 274 | // Is the page config altered? |
— | — | @@ -291,13 +291,13 @@ |
292 | 292 | if ( $old ) { |
293 | 293 | $this->showOldReviewedVersion( $srev, $frev, $tag, $prot ); |
294 | 294 | $outputDone = true; # Tell MW that parser output is done |
295 | | - $pcache = false; |
| 295 | + $useParserCache = false; |
296 | 296 | // Stable version requested by ID or relevant conditions met to |
297 | 297 | // to override page view. |
298 | 298 | } else if ( $stable || $this->pageOverride() ) { |
299 | | - $this->showStableVersion( $srev, $tag, $prot ); |
| 299 | + $this->showStableVersion( $srev, $tag, $prot ); |
300 | 300 | $outputDone = true; # Tell MW that parser output is done |
301 | | - $pcache = false; |
| 301 | + $useParserCache = false; |
302 | 302 | // Looking at some specific old revision (&oldid=x) or if FlaggedRevs is not |
303 | 303 | // set to override given the relevant conditions (like &stable=0) or there |
304 | 304 | // is no stable version. |
— | — | @@ -494,14 +494,7 @@ |
495 | 495 | # Get quality level |
496 | 496 | $quality = FlaggedRevs::isQuality( $flags ); |
497 | 497 | $pristine = FlaggedRevs::isPristine( $flags ); |
498 | | - $text = $frev->getRevText(); |
499 | | - # Check if this is a redirect... |
500 | | - $redirHtml = $this->getRedirectHtml( $text ); |
501 | | - if ( $redirHtml == '' ) { |
502 | | - $parserOptions = FlaggedRevs::makeParserOptions(); |
503 | | - $parserOut = FlaggedRevs::parseStableText( |
504 | | - $this->article->getTitle(), $text, $frev->getRevId(), $parserOptions ); |
505 | | - } |
| 498 | + |
506 | 499 | # Construct some tagging for non-printable outputs. Note that the pending |
507 | 500 | # notice has all this info already, so don't do this if we added that already. |
508 | 501 | if ( !$wgOut->isPrintable() ) { |
— | — | @@ -541,12 +534,21 @@ |
542 | 535 | } |
543 | 536 | } |
544 | 537 | } |
545 | | - # Output HTML |
| 538 | + # Load the review notes which will be shown by onSkinAfterContent |
546 | 539 | $this->setReviewNotes( $frev ); |
547 | | - if ( $redirHtml != '' ) { |
| 540 | + |
| 541 | + # Check if this is a redirect... |
| 542 | + $text = $frev->getRevText(); |
| 543 | + $redirHtml = $this->getRedirectHtml( $text ); |
| 544 | + |
| 545 | + # Parse and output HTML |
| 546 | + if ( $redirHtml == '' ) { |
| 547 | + $parserOptions = FlaggedRevs::makeParserOptions(); |
| 548 | + $parserOut = FlaggedRevs::parseStableText( |
| 549 | + $this->article->getTitle(), $text, $frev->getRevId(), $parserOptions ); |
| 550 | + $this->addParserOutput( $parserOut ); |
| 551 | + } else { |
548 | 552 | $wgOut->addHtml( $redirHtml ); |
549 | | - } else { |
550 | | - $this->addParserOutput( $parserOut ); |
551 | 553 | } |
552 | 554 | } |
553 | 555 | |
— | — | @@ -567,26 +569,7 @@ |
568 | 570 | # Get quality level |
569 | 571 | $quality = FlaggedRevs::isQuality( $flags ); |
570 | 572 | $pristine = FlaggedRevs::isPristine( $flags ); |
571 | | - # Get parsed stable version |
572 | | - $redirHtml = ''; |
573 | | - $parserOut = FlaggedRevs::getPageCache( $this->article, $wgUser ); |
574 | | - if ( !$parserOut ) { |
575 | | - $text = $srev->getRevText(); |
576 | | - # Check if this is a redirect... |
577 | | - $redirHtml = $this->getRedirectHtml( $text ); |
578 | | - # Don't parse redirects, use separate handling... |
579 | | - if ( $redirHtml == '' ) { |
580 | | - # Get the new stable output |
581 | | - $parserOptions = FlaggedRevs::makeParserOptions(); |
582 | | - $parserOut = FlaggedRevs::parseStableText( |
583 | | - $this->article->getTitle(), $text, $srev->getRevId(), $parserOptions ); |
584 | | - # Update the stable version cache & dependancies |
585 | | - FlaggedRevs::updatePageCache( $this->article, $parserOptions, $parserOut ); |
586 | | - FlaggedRevs::updateCacheTracking( $this->article, $parserOut ); |
587 | | - } else { |
588 | | - $parserOut = null; |
589 | | - } |
590 | | - } |
| 573 | + |
591 | 574 | $synced = $this->article->stableVersionIsSynced(); |
592 | 575 | # Construct some tagging |
593 | 576 | if ( !$wgOut->isPrintable() && !( $this->article->lowProfileUI() && $synced ) ) { |
— | — | @@ -632,13 +615,31 @@ |
633 | 616 | } |
634 | 617 | } |
635 | 618 | } |
636 | | - # Output HTML |
| 619 | + |
| 620 | + # Load the review notes which will be shown by onSkinAfterContent |
637 | 621 | $this->setReviewNotes( $srev ); |
638 | | - if ( $redirHtml != '' ) { |
639 | | - $wgOut->addHtml( $redirHtml ); |
640 | | - } else { |
641 | | - // $parserOut will not be null here |
642 | | - $this->addParserOutput( $parserOut ); |
| 622 | + |
| 623 | + # Get parsed stable version and output HTML |
| 624 | + $redirHtml = ''; |
| 625 | + $parserOut = FlaggedRevs::getPageCache( $this->article, $wgUser ); |
| 626 | + if ( !$parserOut ) { |
| 627 | + $text = $srev->getRevText(); |
| 628 | + # Check if this is a redirect... |
| 629 | + $redirHtml = $this->getRedirectHtml( $text ); |
| 630 | + # Don't parse redirects, use separate handling... |
| 631 | + if ( $redirHtml == '' ) { |
| 632 | + # Get the new stable output |
| 633 | + $parserOptions = FlaggedRevs::makeParserOptions(); |
| 634 | + $parserOut = FlaggedRevs::parseStableText( |
| 635 | + $this->article->getTitle(), $text, $srev->getRevId(), $parserOptions ); |
| 636 | + # Update the stable version cache & dependancies |
| 637 | + FlaggedRevs::updatePageCache( $this->article, $parserOptions, $parserOut ); |
| 638 | + FlaggedRevs::updateCacheTracking( $this->article, $parserOut ); |
| 639 | + |
| 640 | + $this->addParserOutput( $parserOut ); |
| 641 | + } else { |
| 642 | + $wgOut->addHtml( $redirHtml ); |
| 643 | + } |
643 | 644 | } |
644 | 645 | } |
645 | 646 | |