Index: trunk/extensions/Translate/api/ApiQueryMessageCollection.php |
— | — | @@ -46,13 +46,17 @@ |
47 | 47 | $messages->setInFile( $group->load( $params['language'] ) ); |
48 | 48 | |
49 | 49 | foreach ( $params['filter'] as $filter ) { |
| 50 | + $value = null; |
| 51 | + if ( strpos( $filter, ':' ) !== false ) { |
| 52 | + list( $filter, $value ) = explode( ':', $filter, 2 ); |
| 53 | + } |
50 | 54 | /* The filtering params here are swapped wrt MessageCollection. |
51 | 55 | * There (fuzzy) means do not show fuzzy, which is the same as !fuzzy |
52 | 56 | * here and fuzzy here means (fuzzy, false) there. */ |
53 | 57 | if ( $filter[0] === '!' ) { |
54 | | - $messages->filter( substr( $filter, 1 ) ); |
| 58 | + $messages->filter( substr( $filter, 1 ), true, $value ); |
55 | 59 | } else { |
56 | | - $messages->filter( $filter, false ); |
| 60 | + $messages->filter( $filter, false, $value ); |
57 | 61 | } |
58 | 62 | } |
59 | 63 | |
— | — | @@ -112,19 +116,6 @@ |
113 | 117 | return $data; |
114 | 118 | } |
115 | 119 | |
116 | | - /** |
117 | | - * @return array |
118 | | - */ |
119 | | - public function getFilters() { |
120 | | - $basic = MessageCollection::getAvailableFilters(); |
121 | | - $full = array(); |
122 | | - foreach ( $basic as $filter ) { |
123 | | - $full[] = $filter; |
124 | | - $full[] = "!$filter"; |
125 | | - } |
126 | | - return $full; |
127 | | - } |
128 | | - |
129 | 120 | public function getAllowedParams() { |
130 | 121 | |
131 | 122 | // Ugly code for BC <= 1.16 |
— | — | @@ -156,7 +147,7 @@ |
157 | 148 | ApiBase::PARAM_TYPE => 'integer', |
158 | 149 | ), |
159 | 150 | 'filter' => array( |
160 | | - ApiBase::PARAM_TYPE => $this->getFilters(), |
| 151 | + ApiBase::PARAM_TYPE => 'string', |
161 | 152 | ApiBase::PARAM_DFLT => '!optional|!ignored', |
162 | 153 | ApiBase::PARAM_ISMULTI => true, |
163 | 154 | ), |
— | — | @@ -188,6 +179,7 @@ |
189 | 180 | 'hastranslation - messages which have a translation regardless if it is fuzzy or not', |
190 | 181 | 'translated - messages which have a translation which is not fuzzy', |
191 | 182 | 'changed - messages which has been translated or changed since last export', |
| 183 | + 'reviewer:# - messages where given userid # is among reviewers', |
192 | 184 | ), |
193 | 185 | ); |
194 | 186 | } |