Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -244,7 +244,7 @@ |
245 | 245 | global $wgFlaggedRevsComments; |
246 | 246 | return $wgFlaggedRevsComments; |
247 | 247 | } |
248 | | - |
| 248 | + |
249 | 249 | /** |
250 | 250 | * Get the array of tag dimensions and level messages |
251 | 251 | * @returns array |
— | — | @@ -253,26 +253,8 @@ |
254 | 254 | self::load(); |
255 | 255 | return self::$dimensions; |
256 | 256 | } |
257 | | - |
| 257 | + |
258 | 258 | /** |
259 | | - * Get min level this tag needs to be for a rev to be "quality" |
260 | | - * @returns int |
261 | | - */ |
262 | | - public static function getMinQL( $tag ) { |
263 | | - self::load(); |
264 | | - return self::$minQL[$tag]; |
265 | | - } |
266 | | - |
267 | | - /** |
268 | | - * Get min level this tag needs to be for a rev to be "pristine" |
269 | | - * @returns int |
270 | | - */ |
271 | | - public static function getMinPL( $tag ) { |
272 | | - self::load(); |
273 | | - return self::$minPL[$tag]; |
274 | | - } |
275 | | - |
276 | | - /** |
277 | 259 | * Get the associative array of tag dimensions |
278 | 260 | * (tags => array(levels => msgkey)) |
279 | 261 | * @returns array |
— | — | @@ -867,11 +849,12 @@ |
868 | 850 | */ |
869 | 851 | public static function getRevisionTags( Title $title, $rev_id ) { |
870 | 852 | $dbr = wfGetDB( DB_SLAVE ); |
871 | | - $tags = $dbr->selectField( 'flaggedrevs', 'fr_tags', |
| 853 | + $tags = (string)$dbr->selectField( 'flaggedrevs', |
| 854 | + 'fr_tags', |
872 | 855 | array( 'fr_rev_id' => $rev_id, |
873 | 856 | 'fr_page_id' => $title->getArticleId() ), |
874 | | - __METHOD__ ); |
875 | | - $tags = $tags ? $tags : ""; |
| 857 | + __METHOD__ |
| 858 | + ); |
876 | 859 | return FlaggedRevision::expandRevisionTags( strval( $tags ) ); |
877 | 860 | } |
878 | 861 | |
— | — | @@ -1161,7 +1144,7 @@ |
1162 | 1145 | /** |
1163 | 1146 | * Get the quality tier of review flags |
1164 | 1147 | * @param array $flags |
1165 | | - * @return int, flagging tier (-1 for non-checked) |
| 1148 | + * @return int flagging tier (FR_PRISTINE,FR_QUALITY,FR_CHECKED,-1) |
1166 | 1149 | */ |
1167 | 1150 | public static function getLevelTier( array $flags ) { |
1168 | 1151 | if ( self::isPristine( $flags ) ) { |
— | — | @@ -1176,26 +1159,17 @@ |
1177 | 1160 | |
1178 | 1161 | /** |
1179 | 1162 | * Get minimum level tags for a tier |
| 1163 | + * @param int $tier FR_PRISTINE/FR_QUALITY/FR_CHECKED |
1180 | 1164 | * @return array |
1181 | 1165 | */ |
1182 | 1166 | public static function quickTags( $tier ) { |
1183 | 1167 | self::load(); |
1184 | | - switch( $tier ) // select reference levels |
1185 | | - { |
1186 | | - case FR_PRISTINE: |
1187 | | - $minLevels = self::$minPL; |
1188 | | - break; |
1189 | | - case FR_QUALITY: |
1190 | | - $minLevels = self::$minQL; |
1191 | | - break; |
1192 | | - default: |
1193 | | - $minLevels = self::$minSL; |
| 1168 | + if ( $tier == FR_PRISTINE ) { |
| 1169 | + return self::$minPL; |
| 1170 | + } elseif ( $tier == FR_QUALITY ) { |
| 1171 | + return self::$minQL; |
1194 | 1172 | } |
1195 | | - $flags = array(); |
1196 | | - foreach ( self::getTags() as $tag ) { |
1197 | | - $flags[$tag] = $minLevels[$tag]; |
1198 | | - } |
1199 | | - return $flags; |
| 1173 | + return self::$minSL; |
1200 | 1174 | } |
1201 | 1175 | |
1202 | 1176 | /** |