r77911 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77910‎ | r77911 | r77912 >
Date:21:06, 6 December 2010
Author:aaron
Status:deferred
Tags:
Comment:
* flagconfig API should not read from $wgFlaggedRevTags like this (for b/c at the least)
* Added tier1 for completeness
Modified paths:
  • /trunk/extensions/FlaggedRevs/api/ApiFlagConfig.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/api/ApiFlagConfig.php
@@ -30,15 +30,17 @@
3131
3232 public function execute() {
3333 $this->getMain()->setCacheMode( 'public' );
34 - global $wgFlaggedRevTags;
 34+ $minQLTags = FlaggedRevs::quickTags( FR_QUALITY );
 35+ $minPLTags = FlaggedRevs::quickTags( FR_PRISTINE );
3536 $data = array();
36 - foreach ( $wgFlaggedRevTags as $tag => $params ) {
37 - $tagInfo = array();
38 - $tagInfo['name'] = $tag;
39 - $tagInfo['levels'] = $params['levels'];
40 - $tagInfo['tier2'] = $params['quality'];
41 - $tagInfo['tier3'] = $params['pristine'];
42 - $data[] = $tagInfo;
 37+ foreach ( FlaggedRevs::getDimensions() as $tag => $levels ) {
 38+ $data[] = array(
 39+ 'name' => $tag,
 40+ 'levels' => count( $levels ) - 1, // exclude '0' level
 41+ 'tier1' => 1,
 42+ 'tier2' => $minQLTags[$tag],
 43+ 'tier3' => $minPLTags[$tag]
 44+ );
4345 }
4446 $result = $this->getResult();
4547 $result->setIndexedTagName( $data, 'tag' );

Status & tagging log