);
}
$version = $opts['version'];
- $vals = array();
+ $vals = array(
+ ApiResult::META_TYPE => 'assoc',
+ );
// Timestamp is shown even if the file is revdelete'd in interface
// so do same here.
if ( isset( $prop['timestamp'] ) ) {
if ( $user || $userid ) {
if ( $file->isDeleted( File::DELETED_USER ) ) {
- $vals['userhidden'] = '';
+ $vals['userhidden'] = true;
$anyHidden = true;
}
if ( $canShowField( File::DELETED_USER ) ) {
$vals['userid'] = $file->getUser( 'id' );
}
if ( !$file->getUser( 'id' ) ) {
- $vals['anon'] = '';
+ $vals['anon'] = true;
}
}
}
if ( $pcomment || $comment ) {
if ( $file->isDeleted( File::DELETED_COMMENT ) ) {
- $vals['commenthidden'] = '';
+ $vals['commenthidden'] = true;
$anyHidden = true;
}
if ( $canShowField( File::DELETED_COMMENT ) ) {
}
if ( $file->isDeleted( File::DELETED_FILE ) ) {
- $vals['filehidden'] = '';
+ $vals['filehidden'] = true;
$anyHidden = true;
}
$retval[] = $r;
}
}
- $result->setIndexedTagName( $retval, 'metadata' );
+ ApiResult::setIndexedTagName( $retval, 'metadata' );
return $retval;
}
'prop' => array(
ApiBase::PARAM_ISMULTI => true,
ApiBase::PARAM_DFLT => 'timestamp|user',
- ApiBase::PARAM_TYPE => self::getPropertyNames()
+ ApiBase::PARAM_TYPE => self::getPropertyNames(),
+ ApiBase::PARAM_HELP_MSG_PER_VALUE => self::getPropertyMessages(),
),
'limit' => array(
ApiBase::PARAM_TYPE => 'limit',
* Returns all possible parameters to iiprop
*
* @param array $filter List of properties to filter out
- *
* @return array
*/
public static function getPropertyNames( $filter = array() ) {
- return array_diff( array_keys( self::getProperties() ), $filter );
+ return array_keys( self::getPropertyMessages( $filter ) );
+ }
+
+ /**
+ * Returns messages for all possible parameters to iiprop
+ *
+ * @param array $filter List of properties to filter out
+ * @return array
+ */
+ public static function getPropertyMessages( $filter = array() ) {
+ return array_diff_key(
+ array(
+ 'timestamp' => 'apihelp-query+imageinfo-paramvalue-prop-timestamp',
+ 'user' => 'apihelp-query+imageinfo-paramvalue-prop-user',
+ 'userid' => 'apihelp-query+imageinfo-paramvalue-prop-userid',
+ 'comment' => 'apihelp-query+imageinfo-paramvalue-prop-comment',
+ 'parsedcomment' => 'apihelp-query+imageinfo-paramvalue-prop-parsedcomment',
+ 'canonicaltitle' => 'apihelp-query+imageinfo-paramvalue-prop-canonicaltitle',
+ 'url' => 'apihelp-query+imageinfo-paramvalue-prop-url',
+ 'size' => 'apihelp-query+imageinfo-paramvalue-prop-size',
+ 'dimensions' => 'apihelp-query+imageinfo-paramvalue-prop-dimensions',
+ 'sha1' => 'apihelp-query+imageinfo-paramvalue-prop-sha1',
+ 'mime' => 'apihelp-query+imageinfo-paramvalue-prop-mime',
+ 'thumbmime' => 'apihelp-query+imageinfo-paramvalue-prop-thumbmime',
+ 'mediatype' => 'apihelp-query+imageinfo-paramvalue-prop-mediatype',
+ 'metadata' => 'apihelp-query+imageinfo-paramvalue-prop-metadata',
+ 'commonmetadata' => 'apihelp-query+imageinfo-paramvalue-prop-commonmetadata',
+ 'extmetadata' => 'apihelp-query+imageinfo-paramvalue-prop-extmetadata',
+ 'archivename' => 'apihelp-query+imageinfo-paramvalue-prop-archivename',
+ 'bitdepth' => 'apihelp-query+imageinfo-paramvalue-prop-bitdepth',
+ 'uploadwarning' => 'apihelp-query+imageinfo-paramvalue-prop-uploadwarning',
+ ),
+ array_flip( $filter )
+ );
}
/**
);
}
- public function getExamplesMessages() {
+ protected function getExamplesMessages() {
return array(
'action=query&titles=File:Albert%20Einstein%20Head.jpg&prop=imageinfo'
=> 'apihelp-query+imageinfo-example-simple',
}
public function getHelpUrls() {
- return 'https://www.mediawiki.org/wiki/API:Properties#imageinfo_.2F_ii';
+ return 'https://www.mediawiki.org/wiki/API:Imageinfo';
}
}