New hook getOtherBlockLogLink, called in Special:IPBlockList to show links to block...
[lhc/web/wiklou.git] / includes / media / Generic.php
index 8c3ed06..b1c6394 100644 (file)
@@ -1,13 +1,14 @@
 <?php
-
 /**
  * Media-handling base classes and generic functionality
+ * @file
+ * @ingroup Media
  */
 
 /**
  * Base media handler class
  *
- * @addtogroup Media
+ * @ingroup Media
  */
 abstract class MediaHandler {
        const TRANSFORM_LATER = 1;
@@ -178,6 +179,14 @@ abstract class MediaHandler {
                );
        }
 
+       /**
+        * Generic getter for text layer.
+        * Currently overloaded by PDF and DjVu handlers
+        */
+       function getPageText( $image, $page ) {
+               return false;
+       }
+
        /**
         * Get an array structure that looks like this:
         *
@@ -234,7 +243,24 @@ abstract class MediaHandler {
        function getLongDesc( $file ) {
                global $wgUser;
                $sk = $wgUser->getSkin();
-               return wfMsg( 'file-info', $sk->formatSize( $file->getSize() ), $file->getMimeType() );
+               return wfMsgExt( 'file-info', 'parseinline',
+                       $sk->formatSize( $file->getSize() ),
+                       $file->getMimeType() );
+       }
+       
+       static function getGeneralShortDesc( $file ) {
+               global $wgLang;
+               $nbytes = '(' . wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ),
+                       $wgLang->formatNum( $file->getSize() ) ) . ')';
+               return "$nbytes";
+       }
+
+       static function getGeneralLongDesc( $file ) {
+               global $wgUser;
+               $sk = $wgUser->getSkin();
+               return wfMsgExt( 'file-info', 'parseinline',
+                       $sk->formatSize( $file->getSize() ),
+                       $file->getMimeType() );
        }
 
        function getDimensionsString( $file ) {
@@ -272,7 +298,7 @@ abstract class MediaHandler {
 /**
  * Media handler abstract base class for images
  *
- * @addtogroup Media
+ * @ingroup Media
  */
 abstract class ImageHandler extends MediaHandler {
        function canRender( $file ) {
@@ -409,17 +435,24 @@ abstract class ImageHandler extends MediaHandler {
 
        function getLongDesc( $file ) {
                global $wgLang;
-               return wfMsgHtml('file-info-size', $wgLang->formatNum( $file->getWidth() ), $wgLang->formatNum( $file->getHeight() ),
-                       $wgLang->formatSize( $file->getSize() ), $file->getMimeType() );
+               return wfMsgExt('file-info-size', 'parseinline',
+                       $wgLang->formatNum( $file->getWidth() ),
+                       $wgLang->formatNum( $file->getHeight() ),
+                       $wgLang->formatSize( $file->getSize() ),
+                       $file->getMimeType() );
        }
 
        function getDimensionsString( $file ) {
                global $wgLang;
                $pages = $file->pageCount();
+               $width = $wgLang->formatNum( $file->getWidth() );
+               $height = $wgLang->formatNum( $file->getHeight() );
+               $pagesFmt = $wgLang->formatNum( $pages );
+
                if ( $pages > 1 ) {
-                       return wfMsg( 'widthheightpage', $wgLang->formatNum( $file->getWidth() ), $wgLang->formatNum( $file->getHeight() ), $wgLang->formatNum( $pages ) );
+                       return wfMsgExt( 'widthheightpage', 'parsemag', $width, $height, $pagesFmt );
                } else {
-                       return wfMsg( 'widthheight', $wgLang->formatNum( $file->getWidth() ), $wgLang->formatNum( $file->getHeight() ) );
+                       return wfMsg( 'widthheight', $width, $height );
                }
        }
 }