r61972 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61971‎ | r61972 | r61973 >
Date:11:43, 4 February 2010
Author:aaron
Status:ok
Tags:
Comment:
Added showRatingIcon() and always show the icon if forDefaultVersionOnly() is false
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -380,9 +380,8 @@
381381 $srev->getRevId(), $revsSince );
382382 }
383383 $icon = '';
384 - # Show if this the stable or draft, unless tabs already do that
385 - # and there is only review tier (making icon redundant).
386 - if ( !FlaggedRevs::versionTabsShown() || FlaggedRevs::qualityVersions() ) {
 384+ # For protection based configs, show lock only if it's not redundant.
 385+ if ( $this->showRatingIcon() ) {
387386 $icon = $synced
388387 ? FlaggedRevsXML::stableStatusIcon( $quality )
389388 : FlaggedRevsXML::draftStatusIcon();
@@ -446,9 +445,8 @@
447446 // Simple icon-based UI
448447 if ( FlaggedRevs::useSimpleUI() ) {
449448 $icon = '';
450 - # Show if this the stable or draft, unless tabs already do that
451 - # and there is only review tier (making icon redundant).
452 - if ( !FlaggedRevs::versionTabsShown() || FlaggedRevs::qualityVersions() ) {
 449+ # For protection based configs, show lock only if it's not redundant.
 450+ if ( $this->showRatingIcon() ) {
453451 $icon = FlaggedRevsXML::stableStatusIcon( $quality );
454452 }
455453 $revsSince = FlaggedRevs::getRevCountSince( $this->article, $srev->getRevId() );
@@ -527,9 +525,8 @@
528526 // Simple icon-based UI
529527 if ( FlaggedRevs::useSimpleUI() ) {
530528 $icon = '';
531 - # Show if this the stable or draft, unless tabs already do that
532 - # and there is only review tier (making icon redundant).
533 - if ( !FlaggedRevs::versionTabsShown() || FlaggedRevs::qualityVersions() ) {
 529+ # For protection based configs, show lock only if it's not redundant.
 530+ if ( $this->showRatingIcon() ) {
534531 $icon = FlaggedRevsXML::stableStatusIcon( $quality );
535532 }
536533 if ( !$wgUser->getId() ) {
@@ -582,6 +579,16 @@
583580 }
584581 return '';
585582 }
 583+
 584+ // Show icons for draft/stable/old reviewed versions
 585+ protected function showRatingIcon() {
 586+ if ( FlaggedRevs::forDefaultVersionOnly() ) {
 587+ // If there is only on quality level and we have tabs to know
 588+ // which version we are looking at, then just use the lock icon...
 589+ return ( !FlaggedRevs::versionTabsShown() || FlaggedRevs::qualityVersions() );
 590+ }
 591+ return true;
 592+ }
586593
587594 /**
588595 * @param FlaggedRevision $srev, stable version

Status & tagging log