function convertMetadataVersion( $metadata, $version = 1 ) {
if ( !is_array( $metadata ) ) {
- //unserialize to keep return parameter consistent.
- wfSuppressWarnings();
+ // unserialize to keep return parameter consistent.
+ MediaWiki\suppressWarnings();
$ret = unserialize( $metadata );
- wfRestoreWarnings();
+ MediaWiki\restoreWarnings();
return $ret;
}
*/
static function getGeneralLongDesc( $file ) {
return wfMessage( 'file-info' )->sizeParams( $file->getSize() )
- ->params( $file->getMimeType() )->parse();
+ ->params( '<span class="mime-type">' . $file->getMimeType() . '</span>' )->parse();
}
/**
public function sanitizeParamsForBucketing( $params ) {
return $params;
}
+
+ /**
+ * Gets configuration for the file warning message. Return value of
+ * the following structure:
+ * array(
+ * // Required, module with messages loaded for the client
+ * 'module' => 'example.filewarning.messages',
+ * // Required, array of names of messages
+ * 'messages' => array(
+ * // Required, main warning message
+ * 'main' => 'example-filewarning-main',
+ * // Optional, header for warning dialog
+ * 'header' => 'example-filewarning-header',
+ * // Optional, footer for warning dialog
+ * 'footer' => 'example-filewarning-footer',
+ * // Optional, text for more-information link (see below)
+ * 'info' => 'example-filewarning-info',
+ * ),
+ * // Optional, link for more information
+ * 'link' => 'http://example.com',
+ * )
+ *
+ * Returns null if no warning is necessary.
+ * @param File $file
+ * @return array|null
+ */
+ public function getWarningConfig( $file ) {
+ return null;
+ }
}