Index: trunk/phase3/includes/api/ApiQueryAllimages.php |
— | — | @@ -168,18 +168,7 @@ |
169 | 169 | 'sha1' => null, |
170 | 170 | 'sha1base36' => null, |
171 | 171 | 'prop' => array ( |
172 | | - ApiBase :: PARAM_TYPE => array( |
173 | | - 'timestamp', |
174 | | - 'user', |
175 | | - 'comment', |
176 | | - 'url', |
177 | | - 'size', |
178 | | - 'dimensions', // Obsolete |
179 | | - 'mime', |
180 | | - 'sha1', |
181 | | - 'metadata', |
182 | | - 'bitdepth', |
183 | | - ), |
| 172 | + ApiBase :: PARAM_TYPE => ApiQueryImageInfo::getPropertyNames(), |
184 | 173 | ApiBase :: PARAM_DFLT => 'timestamp|url', |
185 | 174 | ApiBase :: PARAM_ISMULTI => true |
186 | 175 | ) |
Index: trunk/phase3/includes/api/ApiQueryImageInfo.php |
— | — | @@ -250,18 +250,7 @@ |
251 | 251 | 'prop' => array ( |
252 | 252 | ApiBase :: PARAM_ISMULTI => true, |
253 | 253 | ApiBase :: PARAM_DFLT => 'timestamp|user', |
254 | | - ApiBase :: PARAM_TYPE => array ( |
255 | | - 'timestamp', |
256 | | - 'user', |
257 | | - 'comment', |
258 | | - 'url', |
259 | | - 'size', |
260 | | - 'sha1', |
261 | | - 'mime', |
262 | | - 'metadata', |
263 | | - 'archivename', |
264 | | - 'bitdepth', |
265 | | - ) |
| 254 | + ApiBase :: PARAM_TYPE => self::getPropertyNames() |
266 | 255 | ), |
267 | 256 | 'limit' => array( |
268 | 257 | ApiBase :: PARAM_TYPE => 'limit', |
— | — | @@ -287,6 +276,25 @@ |
288 | 277 | 'continue' => null, |
289 | 278 | ); |
290 | 279 | } |
| 280 | + |
| 281 | + /** |
| 282 | + * Returns all possible parameters to iiprop |
| 283 | + */ |
| 284 | + public static function getPropertyNames() { |
| 285 | + return array ( |
| 286 | + 'timestamp', |
| 287 | + 'user', |
| 288 | + 'comment', |
| 289 | + 'url', |
| 290 | + 'size', |
| 291 | + 'dimensions', // For backwards compatibility with Allimages |
| 292 | + 'sha1', |
| 293 | + 'mime', |
| 294 | + 'metadata', |
| 295 | + 'archivename', |
| 296 | + 'bitdepth', |
| 297 | + ); |
| 298 | + } |
291 | 299 | |
292 | 300 | public function getParamDescription() { |
293 | 301 | return array ( |
Index: trunk/phase3/includes/api/ApiUpload.php |
— | — | @@ -275,16 +275,7 @@ |
276 | 276 | // Append imageinfo to the result |
277 | 277 | |
278 | 278 | //get all the image properties: |
279 | | - $imParam = Array('timestamp', |
280 | | - 'user', |
281 | | - 'comment', |
282 | | - 'url', |
283 | | - 'size', |
284 | | - 'sha1', |
285 | | - 'mime', |
286 | | - 'metadata', |
287 | | - 'archivename', |
288 | | - 'bitdepth'); |
| 279 | + $imParam = ApiQueryImageInfo::getPropertyNames(); |
289 | 280 | $result['imageinfo'] = ApiQueryImageInfo::getInfo( $file, |
290 | 281 | array_flip( $imParam ), |
291 | 282 | $this->getResult() ); |