r37647 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37646‎ | r37647 | r37648 >
Date:14:57, 14 July 2008
Author:aaron
Status:old
Tags:
Comment:
Add $wgFlaggedRevsLowProfile to suppress tags for reviewed content for anons
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticle.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -39,6 +39,8 @@
4040 # Add stable/draft revision tabs. May be redundant due to the tags.
4141 # If you have an open wiki, with the simple UI, you may want to enable these.
4242 $wgFlaggedRevTabs = false;
 43+# For non-user visitors, only show tags/icons for *unreviewed* pages
 44+$wgFlaggedRevsLowProfile = false;
4345
4446 # Allowed namespaces of reviewable pages
4547 $wgFlaggedRevsNamespaces = array( NS_MAIN );
Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php
@@ -345,7 +345,7 @@
346346 }
347347 $synced = FlaggedRevs::stableVersionIsSynced( $frev, $this->parent, $parserOut, null );
348348 # Construct some tagging
349 - if( !$wgOut->isPrintable() ) {
 349+ if( !$wgOut->isPrintable() && !FlaggedRevs::lowProfileUI() ) {
350350 $class = $quality ? 'fr-icon-quality' : 'fr-icon-stable';
351351 $tooltip = $quality ? 'revreview-quality-title' : 'revreview-stable-title';
352352 $tooltip = wfMsgHtml($tooltip);
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -6,11 +6,10 @@
77 protected static $qualityVersions = false;
88 protected static $pristineVersions = false;
99 protected static $extStorage = false;
10 - protected static $allowComments = false;
1110 protected static $includeVersionCache = array();
1211
1312 public static function load() {
14 - global $wgFlaggedRevTags, $wgFlaggedRevValues, $wgFlaggedRevsComments;
 13+ global $wgFlaggedRevTags, $wgFlaggedRevValues;
1514 if( self::$loaded ) {
1615 return true;
1716 }
@@ -41,8 +40,6 @@
4241 self::$extStorage = $wgFlaggedRevsExternalStore ?
4342 $wgFlaggedRevsExternalStore : $wgDefaultExternalStore;
4443
45 - self::$allowComments = (bool)$wgFlaggedRevsComments;
46 -
4744 self::$loaded = true;
4845 }
4946
@@ -85,14 +82,24 @@
8683
8784 return $wgUser->getOption( 'flaggedrevssimpleui', intval($wgSimpleFlaggedRevsUI) );
8885 }
89 -
 86+
9087 /**
 88+ * Should tags only be shown for unreviewed content for this user?
 89+ * @returns bool
 90+ */
 91+ public static function lowProfileUI() {
 92+ global $wgUser, $wgFlaggedRevsLowProfile;
 93+ self::load();
 94+ return (!$wgUser->getId() && $wgFlaggedRevsLowProfile);
 95+ }
 96+ /**
9197 * Should comments be allowed on pages and forms?
9298 * @returns bool
9399 */
94100 public static function allowComments() {
 101+ global $wgFlaggedRevsComments;
95102 self::load();
96 - return self::$allowComments;
 103+ return $wgFlaggedRevsComments;
97104 }
98105
99106 /**

Status & tagging log