r49524 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49523‎ | r49524 | r49525 >
Date:20:38, 15 April 2009
Author:aaron
Status:ok
Tags:
Comment:
Added some tag convenience functions
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -323,6 +323,22 @@
324324 }
325325 return $flags;
326326 }
 327+
 328+ /**
 329+ * Get minimum level tags for a tier
 330+ * @return array
 331+ */
 332+ public static function quickTags( $tier ) {
 333+ switch( $tier )
 334+ {
 335+ case 2:
 336+ return self::quickPristineTags();
 337+ case 1:
 338+ return self::quickQualityTags();
 339+ default:
 340+ return self::quickSightedTags();
 341+ }
 342+ }
327343
328344 /**
329345 * Get minimum tags that are closest to the quality level
@@ -1045,6 +1061,19 @@
10461062 }
10471063
10481064 /**
 1065+ * @param Array $flags
 1066+ * @return int, flagging tier
 1067+ */
 1068+ public static function getLevelTier( $flags ) {
 1069+ if( self::isPristine($flags ) )
 1070+ return 2;
 1071+ else if( self::isQuality($flags ) )
 1072+ return 1;
 1073+ else
 1074+ return 0;
 1075+ }
 1076+
 1077+ /**
10491078 * Is this page in reviewable namespace?
10501079 * @param Title, $title
10511080 * @return bool

Status & tagging log