r60357 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60356‎ | r60357 | r60358 >
Date:08:05, 24 December 2009
Author:aaron
Status:ok
Tags:
Comment:
* Fixed getTagValueMsg()
* No tag case counts as binaryFlagging (flagged/not flagged)
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -31,7 +31,7 @@
3232 if( !empty($wgFlaggedRevTags) ) {
3333 self::$qualityVersions = true;
3434 self::$pristineVersions = true;
35 - self::$binaryFlagging = (count($wgFlaggedRevTags) == 1);
 35+ self::$binaryFlagging = (count($wgFlaggedRevTags) <= 1);
3636 }
3737 foreach( $wgFlaggedRevTags as $tag => $levels ) {
3838 # Sanity checks
@@ -342,7 +342,7 @@
343343 }
344344
345345 /**
346 - * Get the message name for a tag
 346+ * Get the UI name for a tag
347347 * @param string $tag
348348 * @returns string
349349 */
@@ -357,11 +357,12 @@
358358 */
359359 public static function getTagLevels( $tag ) {
360360 self::load();
361 - return isset(self::$dimensions[$tag]) ? self::$dimensions[$tag] : array();
 361+ return isset(self::$dimensions[$tag]) ?
 362+ self::$dimensions[$tag] : array();
362363 }
363364
364365 /**
365 - * Get the the message name for a value of a tag
 366+ * Get the the UI name for a value of a tag
366367 * @param string $tag
367368 * @param int $value
368369 * @returns string
@@ -369,10 +370,12 @@
370371 public static function getTagValueMsg( $tag, $value ) {
371372 self::load();
372373 if( !isset(self::$dimensions[$tag]) )
373 - return "";
 374+ return '';
 375+ if( !isset(self::$dimensions[$tag][$value]) )
 376+ return '';
374377 # Return empty string if not there
375 - return isset(self::$dimensions[$tag][$value]) ?
376 - self::$dimensions[$tag][$value] : "";
 378+ return wfMsgExt( 'revreview-' . self::$dimensions[$tag][$value],
 379+ array( 'escapenoentities' ) );
377380 }
378381
379382 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r60358Follow-up r60357: actually fix binaryFlagging() for no tag caseaaron08:40, 24 December 2009

Status & tagging log