r59689 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59688‎ | r59689 | r59690 >
Date:02:01, 3 December 2009
Author:aaron
Status:ok
Tags:
Comment:
Defer calling getRevCountSince()
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -300,7 +300,6 @@
301301 # Get quality level
302302 $quality = FlaggedRevs::isQuality( $flags );
303303 $pristine = FlaggedRevs::isPristine( $flags );
304 - $revsSince = FlaggedRevs::getRevCountSince( $this->article, $srev->getRevId() );
305304 # Get stable version sync status
306305 $synced = FlaggedRevs::stableVersionIsSynced( $srev, $this->article );
307306 if( $synced ) {
@@ -311,6 +310,7 @@
312311 $pending = '';
313312 # Give notice to newer users if an unreviewed edit was completed...
314313 if( !$synced && $wgRequest->getVal('shownotice') && !$wgUser->isAllowed('review') ) {
 314+ $revsSince = FlaggedRevs::getRevCountSince( $this->article, $srev->getRevId() );
315315 $tooltip = wfMsgHtml('revreview-draft-title');
316316 $pending = "{$prot}<span class='fr-icon-current' title=\"{$tooltip}\"></span>" .
317317 wfMsgExt('revreview-edited',array('parseinline'),$srev->getRevId(),$revsSince);
@@ -323,6 +323,7 @@
324324 # Construct some tagging for non-printable outputs. Note that the pending
325325 # notice has all this info already, so don't do this if we added that already.
326326 if( !$wgOut->isPrintable() && !$pending && !($this->article->lowProfileUI() && $synced) ) {
 327+ $revsSince = FlaggedRevs::getRevCountSince( $this->article, $srev->getRevId() );
327328 $class = 'fr-icon-current'; // default
328329 $tooltip = 'revreview-draft-title';
329330 // Simple icon-based UI
@@ -388,7 +389,6 @@
389390 # Get quality level
390391 $quality = FlaggedRevs::isQuality( $flags );
391392 $pristine = FlaggedRevs::isPristine( $flags );
392 - $revsSince = FlaggedRevs::getRevCountSince( $this->article, $srev->getRevId() );
393393 $text = $frev->getRevText();
394394 $parserOut = FlaggedRevs::parseStableText( $this->article, $text, $frev->getRevId() );
395395 # Construct some tagging for non-printable outputs. Note that the pending
@@ -399,6 +399,8 @@
400400 $tooltip = wfMsgHtml($tooltip);
401401 // Simple icon-based UI
402402 if( FlaggedRevs::useSimpleUI() ) {
 403+ $revsSince = FlaggedRevs::getRevCountSince( $this->article, $srev->getRevId() );
 404+
403405 $msg = $quality ? 'revreview-quick-quality-old' : 'revreview-quick-basic-old';
404406 $html = "{$prot}<span class='{$class}' title=\"{$tooltip}\"></span>" .
405407 wfMsgExt( $msg, array('parseinline'), $frev->getRevId(), $time );
@@ -442,8 +444,6 @@
443445 # Get quality level
444446 $quality = FlaggedRevs::isQuality( $flags );
445447 $pristine = FlaggedRevs::isPristine( $flags );
446 - # We will be looking at the reviewed revision...
447 - $revsSince = FlaggedRevs::getRevCountSince( $this->article, $srev->getRevId() );
448448 # Get parsed stable version
449449 $parserOut = FlaggedRevs::getPageCache( $this->article, $wgUser );
450450 if( $parserOut == false ) {
@@ -455,6 +455,7 @@
456456 $synced = FlaggedRevs::stableVersionIsSynced( $srev, $this->article, $parserOut, null );
457457 # Construct some tagging
458458 if( !$wgOut->isPrintable() && !($this->article->lowProfileUI() && $synced) ) {
 459+ $revsSince = FlaggedRevs::getRevCountSince( $this->article, $srev->getRevId() );
459460 $class = $quality ? 'fr-icon-quality' : 'fr-icon-stable';
460461 $tooltip = $quality ? 'revreview-quality-title' : 'revreview-stable-title';
461462 $tooltip = wfMsgHtml($tooltip);

Status & tagging log