* (bug 27205) aiprop=metadata and aiprop=parsedcomment need help text
authorSam Reed <reedy@users.mediawiki.org>
Sun, 6 Feb 2011 23:59:03 +0000 (23:59 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 6 Feb 2011 23:59:03 +0000 (23:59 +0000)
Refactored code out to reduce duplication (and hence, mismatches like this)

RELEASE-NOTES
includes/api/ApiQueryAllimages.php
includes/api/ApiQueryImageInfo.php

index fd06eeb..49c34b7 100644 (file)
@@ -149,6 +149,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Expose list of skins in meta=siteinfo
 * (bug 26548) Add iiurlparam param to query=imageinfo and query=stashimageinfo
 * (bug 27201) Special:WhatLinksHere output no longer contains duplicate IDs
+* (bug 27205) aiprop=metadata and aiprop=parsedcomment need help text
 
 === Languages updated in 1.18 ===
 
index 8fa733c..52cea73 100644 (file)
@@ -199,21 +199,7 @@ class ApiQueryAllimages extends ApiQueryGeneratorBase {
                        'limit' => 'How many images in total to return',
                        'sha1' => "SHA1 hash of image. Overrides {$this->getModulePrefix()}sha1base36",
                        'sha1base36' => 'SHA1 hash of image in base 36 (used in MediaWiki)',
-                       'prop' => array(
-                               'Which properties to get',
-                               ' timestamp    - Adds the timestamp when the image was upload',
-                               ' user         - Adds the username of the last uploader',
-                               ' userid       - Adds the user ID of the last uploader',
-                               ' comment      - Adds the comment of the last upload',
-                               ' url          - Adds the URL of the image and its description page',
-                               ' size         - Adds the size of the image in bytes and its height and width',
-                               ' dimensions   - Alias of size',
-                               ' sha1         - Adds the SHA-1 hash of the image',
-                               ' mime         - Adds the MIME of the image',
-                               ' thumbmime    - Adds the MIME of the tumbnail for the image',
-                               ' archivename  - Adds the file name of the archive version for non-latest versions',
-                               ' bitdepth     - Adds the bit depth of the version',
-                       ),
+                       'prop' => ApiQueryImageInfo::getPropertyDescriptions(),
                );
        }
 
index 355d172..836f363 100644 (file)
@@ -424,6 +424,8 @@ class ApiQueryImageInfo extends ApiQueryBase {
 
        /**
         * Returns all possible parameters to iiprop
+        * @static
+        * @return Array
         */
        public static function getPropertyNames() {
                return array(
@@ -444,15 +446,14 @@ class ApiQueryImageInfo extends ApiQueryBase {
                );
        }
 
-
        /**
-        * Return the API documentation for the parameters.
-        * @return {Array} parameter documentation.
+        * Returns the descriptions for the properties provided by getPropertyNames()
+        *
+        * @static
+        * @return array
         */
-       public function getParamDescription() {
-               $p = $this->getModulePrefix();
+       public static function getPropertyDescriptions() {
                return array(
-                       'prop' => array(
                                'What image information to get:',
                                ' timestamp     - Adds timestamp for the uploaded version',
                                ' user          - Adds the user who uploaded the image version',
@@ -468,7 +469,17 @@ class ApiQueryImageInfo extends ApiQueryBase {
                                ' metadata      - Lists EXIF metadata for the version of the image',
                                ' archivename   - Adds the file name of the archive version for non-latest versions',
                                ' bitdepth      - Adds the bit depth of the version',
-                       ),
+                       );
+       }
+
+       /**
+        * Return the API documentation for the parameters.
+        * @return {Array} parameter documentation.
+        */
+       public function getParamDescription() {
+               $p = $this->getModulePrefix();
+               return array(
+                       'prop' => self::getPropertyDescriptions(),
                        'urlwidth' => array( "If {$p}prop=url is set, a URL to an image scaled to this width will be returned.",
                                            'Only the current version of the image can be scaled' ),
                        'urlheight' => "Similar to {$p}urlwidth. Cannot be used without {$p}urlwidth",