http://www.mediawiki.org/wiki/Special:Code/MediaWiki/61972

Revision: 61972
Author:   aaron
Date:     2010-02-04 11:43:55 +0000 (Thu, 04 Feb 2010)

Log Message:
-----------
Added showRatingIcon() and always show the icon if forDefaultVersionOnly() is 
false

Modified Paths:
--------------
    trunk/extensions/FlaggedRevs/FlaggedArticleView.php

Modified: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
===================================================================
--- trunk/extensions/FlaggedRevs/FlaggedArticleView.php 2010-02-04 10:39:24 UTC 
(rev 61971)
+++ trunk/extensions/FlaggedRevs/FlaggedArticleView.php 2010-02-04 11:43:55 UTC 
(rev 61972)
@@ -380,9 +380,8 @@
                                                $srev->getRevId(), $revsSince );
                                }
                                $icon = '';
-                               # Show if this the stable or draft, unless tabs 
already do that
-                               # and there is only review tier (making icon 
redundant).
-                               if ( !FlaggedRevs::versionTabsShown() || 
FlaggedRevs::qualityVersions() ) {
+                               # For protection based configs, show lock only 
if it's not redundant.
+                               if ( $this->showRatingIcon() ) {
                                        $icon = $synced
                                                ? 
FlaggedRevsXML::stableStatusIcon( $quality )
                                                : 
FlaggedRevsXML::draftStatusIcon();
@@ -446,9 +445,8 @@
                        // Simple icon-based UI
                        if ( FlaggedRevs::useSimpleUI() ) {
                                $icon = '';
-                               # Show if this the stable or draft, unless tabs 
already do that
-                               # and there is only review tier (making icon 
redundant).
-                               if ( !FlaggedRevs::versionTabsShown() || 
FlaggedRevs::qualityVersions() ) {
+                               # For protection based configs, show lock only 
if it's not redundant.
+                               if ( $this->showRatingIcon() ) {
                                        $icon = 
FlaggedRevsXML::stableStatusIcon( $quality );
                                }
                                $revsSince = FlaggedRevs::getRevCountSince( 
$this->article, $srev->getRevId() );
@@ -527,9 +525,8 @@
                        // Simple icon-based UI
                        if ( FlaggedRevs::useSimpleUI() ) {
                                $icon = '';
-                               # Show if this the stable or draft, unless tabs 
already do that
-                               # and there is only review tier (making icon 
redundant).
-                               if ( !FlaggedRevs::versionTabsShown() || 
FlaggedRevs::qualityVersions() ) {
+                               # For protection based configs, show lock only 
if it's not redundant.
+                               if ( $this->showRatingIcon() ) {
                                        $icon = 
FlaggedRevsXML::stableStatusIcon( $quality );
                                }
                                if ( !$wgUser->getId() ) {
@@ -582,6 +579,16 @@
                }
                return '';
        }
+       
+       // Show icons for draft/stable/old reviewed versions
+       protected function showRatingIcon() {
+               if ( FlaggedRevs::forDefaultVersionOnly() ) {
+                       // If there is only on quality level and we have tabs 
to know
+                       // which version we are looking at, then just use the 
lock icon...
+                       return ( !FlaggedRevs::versionTabsShown() || 
FlaggedRevs::qualityVersions() );
+               }
+               return true;
+       }
 
        /**
        * @param FlaggedRevision $srev, stable version



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to