$h = $image->getHandler();
if ( !$h ) {
- $this->setWarning( 'Could not create thumbnail because ' .
+ $this->setWarning( 'Could not create thumbnail because ' .
$image->getName() . ' does not have an associated image handler' );
return $thumbParams;
}
if ( !is_null( $thumbParams ) ) {
$mto = $file->transform( $thumbParams );
if ( $mto && !$mto->isError() ) {
- $vals['thumburl'] = wfExpandUrl( $mto->getUrl() );
+ $vals['thumburl'] = wfExpandUrl( $mto->getUrl(), PROTO_CURRENT );
// bug 23834 - If the URL's are the same, we haven't resized it, so shouldn't give the wanted
// thumbnail sizes for the thumbnail actual size
}
if ( isset( $prop['thumbmime'] ) && $file->getHandler() ) {
- list( $ext, $mime ) = $file->getHandler()->getThumbType(
- substr( $mto->getPath(), strrpos( $mto->getPath(), '.' ) + 1 ),
+ list( $ext, $mime ) = $file->getHandler()->getThumbType(
+ substr( $mto->getPath(), strrpos( $mto->getPath(), '.' ) + 1 ),
$file->getMimeType(), $thumbParams );
$vals['thumbmime'] = $mime;
}
- } else if ( $mto && $mto->isError() ) {
+ } elseif ( $mto && $mto->isError() ) {
$vals['thumberror'] = $mto->toText();
}
}
- $vals['url'] = $file->getFullURL();
- $vals['descriptionurl'] = wfExpandUrl( $file->getDescriptionUrl() );
+ $vals['url'] = wfExpandUrl( $file->getFullURL(), PROTO_CURRENT );
+ $vals['descriptionurl'] = wfExpandUrl( $file->getDescriptionUrl(), PROTO_CURRENT );
}
if ( $sha1 ) {
/**
* Returns the descriptions for the properties provided by getPropertyNames()
- *
+ *
* @param array $filter List of properties to filter out
*
* @return array
/**
* Return the API documentation for the parameters.
- * @return {Array} parameter documentation.
+ * @return Array parameter documentation.
*/
public function getParamDescription() {
$p = $this->getModulePrefix();
'limit' => 'How many image revisions to return',
'start' => 'Timestamp to start listing from',
'end' => 'Timestamp to stop listing at',
- 'metadataversion' => array( "Version of metadata to use. if 'latest' is specified, use latest version.",
+ 'metadataversion' => array( "Version of metadata to use. if 'latest' is specified, use latest version.",
"Defaults to '1' for backwards compatibility" ),
'continue' => 'If the query response includes a continue value, use it here to get another page of results'
);
array( 'code' => 'urlparam', 'info' => "Invalid value for {$p}urlparam" ),
array( 'code' => 'urlparam_no_width', 'info' => "{$p}urlparam requires {$p}urlwidth" ),
array( 'code' => 'urlparam_urlwidth_mismatch', 'info' => "The width set in {$p}urlparm doesnt't " .
- "match the one in {$p}urlwidth" ),
+ "match the one in {$p}urlwidth" ),
) );
}
- protected function getExamples() {
+ public function getExamples() {
return array(
'api.php?action=query&titles=File:Albert%20Einstein%20Head.jpg&prop=imageinfo',
'api.php?action=query&titles=File:Test.jpg&prop=imageinfo&iilimit=50&iiend=20071231235959&iiprop=timestamp|user|url',
);
}
+ public function getHelpUrls() {
+ return 'http://www.mediawiki.org/wiki/API:Properties#imageinfo_.2F_ii';
+ }
+
public function getVersion() {
return __CLASS__ . ': $Id$';
}