X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiQueryStashImageInfo.php;h=c84de8c97448c71d51b2e26d15c1e675377effc2;hp=abb827fe4f4540c0acc1b45652d0060209a9f564;hb=e19e6bfabcaf2b6aa5dd837ff7057bd6a25baef8;hpb=a90bbf1a484c9d22cb04770e92ce18fe3e4bf398 diff --git a/includes/api/ApiQueryStashImageInfo.php b/includes/api/ApiQueryStashImageInfo.php index abb827fe4f..c84de8c974 100644 --- a/includes/api/ApiQueryStashImageInfo.php +++ b/includes/api/ApiQueryStashImageInfo.php @@ -70,11 +70,37 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo { } } - private $propertyFilter = [ + private static $propertyFilter = [ 'user', 'userid', 'comment', 'parsedcomment', 'mediatype', 'archivename', 'uploadwarning', ]; + /** + * Returns all possible parameters to siiprop + * + * @param array|null $filter List of properties to filter out + * @return array + */ + public static function getPropertyNames( $filter = null ) { + if ( $filter === null ) { + $filter = self::$propertyFilter; + } + return parent::getPropertyNames( $filter ); + } + + /** + * Returns messages for all possible parameters to siiprop + * + * @param array|null $filter List of properties to filter out + * @return array + */ + public static function getPropertyMessages( $filter = null ) { + if ( $filter === null ) { + $filter = self::$propertyFilter; + } + return parent::getPropertyMessages( $filter ); + } + public function getAllowedParams() { return [ 'filekey' => [ @@ -87,9 +113,9 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo { 'prop' => [ ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_DFLT => 'timestamp|url', - ApiBase::PARAM_TYPE => self::getPropertyNames( $this->propertyFilter ), + ApiBase::PARAM_TYPE => self::getPropertyNames(), ApiBase::PARAM_HELP_MSG => 'apihelp-query+imageinfo-param-prop', - ApiBase::PARAM_HELP_MSG_PER_VALUE => self::getPropertyMessages( $this->propertyFilter ) + ApiBase::PARAM_HELP_MSG_PER_VALUE => self::getPropertyMessages() ], 'urlwidth' => [ ApiBase::PARAM_TYPE => 'integer', @@ -123,6 +149,6 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo { } public function getHelpUrls() { - return 'https://www.mediawiki.org/wiki/API:Stashimageinfo'; + return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Stashimageinfo'; } }