http://www.mediawiki.org/wiki/Special:Code/MediaWiki/84504

Revision: 84504
Author:   reedy
Date:     2011-03-22 00:08:45 +0000 (Tue, 22 Mar 2011)
Log Message:
-----------
* (bug 27586) Remove duplication of props in ApiQueryStashImageInfo by using 
ApiQueryImageInfo

Programatically do properties and descriptions. Reduces text duplication, and 
hence normalises descriptions! :)

Follows up r84502, r84433

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES
    trunk/phase3/includes/api/ApiQueryStashImageInfo.php

Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES  2011-03-21 23:59:05 UTC (rev 84503)
+++ trunk/phase3/RELEASE-NOTES  2011-03-22 00:08:45 UTC (rev 84504)
@@ -277,6 +277,8 @@
 * (bug 16288) API: consider making closure status of wikis more clear
   with meta=siteinfo
 * (bug 27589) list=allimages&aiprop=archivename is useless
+* (bug 27586) Remove duplication of props in ApiQueryStashImageInfo
+  by using ApiQueryImageInfo
 
 === Languages updated in 1.18 ===
 

Modified: trunk/phase3/includes/api/ApiQueryStashImageInfo.php
===================================================================
--- trunk/phase3/includes/api/ApiQueryStashImageInfo.php        2011-03-21 
23:59:05 UTC (rev 84503)
+++ trunk/phase3/includes/api/ApiQueryStashImageInfo.php        2011-03-22 
00:08:45 UTC (rev 84504)
@@ -61,22 +61,10 @@
                }
        }
 
-       /**
-        * Returns all valid parameters to siiprop
-        */
-       public static function getPropertyNames() {
-               return array(
-                       'timestamp',
-                       'url',
-                       'size',
-                       'dimensions', // For backwards compatibility with 
Allimages
-                       'sha1',
-                       'mime',
-                       'thumbmime',
-                       'metadata',
-                       'bitdepth',
-               );
-       }
+       private $propertyFilter = array(
+               'user', 'userid', 'comment', 'parsedcomment',
+               'mediatype', 'archivename',
+       );
 
        public function getAllowedParams() {
                return array(
@@ -88,7 +76,7 @@
                        'prop' => array(
                                ApiBase::PARAM_ISMULTI => true,
                                ApiBase::PARAM_DFLT => 'timestamp|url',
-                               ApiBase::PARAM_TYPE => self::getPropertyNames()
+                               ApiBase::PARAM_TYPE => self::getPropertyNames( 
$this->propertyFilter )
                        ),
                        'urlwidth' => array(
                                ApiBase::PARAM_TYPE => 'integer',
@@ -112,18 +100,7 @@
        public function getParamDescription() {
                $p = $this->getModulePrefix();
                return array(
-                       'prop' => array(
-                               'What image information to get:',
-                               ' timestamp    - Adds timestamp for the 
uploaded version',
-                               ' url          - Gives URL to the image and the 
description page',
-                               ' size         - Adds the size of the image in 
bytes and the height, width and page count (if applicable)',
-                               ' dimensions   - Alias for size',
-                               ' sha1         - Adds sha1 hash for the image',
-                               ' mime         - Adds MIME of the image',
-                               ' thumbmime    - Adds MIME of the image 
thumbnail (requires url)',
-                               ' metadata     - Lists EXIF metadata for the 
version of the image',
-                               ' bitdepth     - Adds the bit depth of the 
version',
-                       ),
+                       'prop' => self::getPropertyDescriptions( 
$this->propertyFilter ),
                        'sessionkey' => 'Session key that identifies a previous 
upload that was stashed temporarily.',
                        'urlwidth' => "If {$p}prop=url is set, a URL to an 
image scaled to this width will be returned.",
                        'urlheight' => "Similar to {$p}urlwidth. Cannot be used 
without {$p}urlwidth",


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to