Merge "Implement static public Parser::getExternalLinkRel"
[lhc/web/wiklou.git] / includes / media / MediaHandler.php
index e883b7f..dd764e9 100644 (file)
@@ -243,6 +243,15 @@ abstract class MediaHandler {
                return array( $ext, $mime );
        }
 
+       /**
+        * Get useful response headers for GET/HEAD requests for a file with the given metadata
+        * @param $metadata mixed Result of the getMetadata() function of this handler for a file
+        * @return Array
+        */
+       public function getStreamHeaders( $metadata ) {
+               return array();
+       }
+
        /**
         * True if the handled types can be transformed
         * @return bool
@@ -269,6 +278,19 @@ abstract class MediaHandler {
         * @return bool
         */
        function isVectorized( $file ) { return false; }
+       /**
+        * The material is an image, and is animated.
+        * In particular, video material need not return true.
+        * @note Before 1.20, this was a method of ImageHandler only
+        * @return bool
+        */
+       function isAnimatedImage( $file ) { return false; }
+       /**
+        * If the material is animated, we can animate the thumbnail
+        * @since 1.20
+        * @return bool If material is not animated, handler may return any value.
+        */
+       function canAnimateThumbnail( $file ) { return true; }
        /**
         * False if the handler is disabled for all files
         * @return bool
@@ -372,7 +394,7 @@ abstract class MediaHandler {
         */
        function visibleMetadataFields() {
                $fields = array();
-               $lines = explode( "\n", wfMsgForContent( 'metadata-fields' ) );
+               $lines = explode( "\n", wfMessage( 'metadata-fields' )->inContentLanguage()->text() );
                foreach( $lines as $line ) {
                        $matches = array();
                        if( preg_match( '/^\\*\s*(.*?)\s*$/', $line, $matches ) ) {