}
/**
- * Used instead of getLongDesc if there is no handler registered for file.
+ * Short description. Shown on Special:Search results.
*
* @param File $file
* @return string
*/
function getShortDesc( $file ) {
- global $wgLang;
-
- return htmlspecialchars( $wgLang->formatSize( $file->getSize() ) );
+ return self::getGeneralShortDesc( $file );
}
/**
- * Short description. Shown on Special:Search results.
+ * Long description. Shown under image on image description page surounded by ().
*
* @param File $file
* @return string
*/
function getLongDesc( $file ) {
- global $wgLang;
-
- return wfMessage( 'file-info', htmlspecialchars( $wgLang->formatSize( $file->getSize() ) ),
- $file->getMimeType() )->parse();
+ return self::getGeneralLongDesc( $file );
}
/**
- * Long description. Shown under image on image description page surounded by ().
+ * Used instead of getShortDesc if there is no handler registered for file.
*
* @param File $file
* @return string
static function getGeneralShortDesc( $file ) {
global $wgLang;
- return $wgLang->formatSize( $file->getSize() );
+ return htmlspecialchars( $wgLang->formatSize( $file->getSize() ) );
}
/**
- * Used instead of getShortDesc if there is no handler registered for file.
+ * Used instead of getLongDesc if there is no handler registered for file.
*
* @param File $file
* @return string
*/
static function getGeneralLongDesc( $file ) {
- global $wgLang;
-
- return wfMessage( 'file-info', $wgLang->formatSize( $file->getSize() ),
- $file->getMimeType() )->parse();
+ return wfMessage( 'file-info' )->sizeParams( $file->getSize() )
+ ->params( $file->getMimeType() )->parse();
}
/**
public function getLength( $file ) {
return 0.0;
}
+
+ /**
+ * True if creating thumbnails from the file is large or otherwise resource-intensive.
+ * @param File $file
+ * @return bool
+ */
+ public function isExpensiveToThumbnail( $file ) {
+ return false;
+ }
}