Add getGeneralShortDesc() and the like to avoid E_STRICT instead
authorAaron Schulz <aaron@users.mediawiki.org>
Mon, 15 Dec 2008 22:22:21 +0000 (22:22 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Mon, 15 Dec 2008 22:22:21 +0000 (22:22 +0000)
includes/filerepo/File.php
includes/media/Generic.php
includes/media/SVG.php

index d28fba0..4f0990a 100644 (file)
@@ -1218,7 +1218,7 @@ abstract class File {
                if ( $handler ) {
                        return $handler->getLongDesc( $this );
                } else {
-                       return MediaHandler::getLongDescription( $this );
+                       return MediaHandler::getGeneralLongDesc( $this );
                }
        }
 
@@ -1227,7 +1227,7 @@ abstract class File {
                if ( $handler ) {
                        return $handler->getShortDesc( $this );
                } else {
-                       return MediaHandler::getShortDescription( $this );
+                       return MediaHandler::getGeneralShortDesc( $this );
                }
        }
 
index 3e6c944..a9c681e 100644 (file)
@@ -224,23 +224,30 @@ abstract class MediaHandler {
                        'value' => $value
                );
        }
-       
+
        function getShortDesc( $file ) {
-               return self::getShortDescription( $file );
+               global $wgLang;
+               $nbytes = '(' . wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ),
+                       $wgLang->formatNum( $file->getSize() ) ) . ')';
+               return "$nbytes";
        }
 
        function getLongDesc( $file ) {
-               return self::getLongDescription( $file );
-       }       
-
-       static function getShortDescription( $file ) {
+               global $wgUser;
+               $sk = $wgUser->getSkin();
+               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 getLongDescription( $file ) {
+       static function getGeneralLongDesc( $file ) {
                global $wgUser;
                $sk = $wgUser->getSkin();
                return wfMsgExt( 'file-info', 'parseinline',
index c7ca213..f0519e8 100644 (file)
@@ -112,7 +112,7 @@ class SvgHandler extends ImageHandler {
                return array( 'png', 'image/png' );
        }
 
-       static function getLongDescription( $file ) {
+       function getLongDesc( $file ) {
                global $wgLang;
                return wfMsgExt( 'svg-long-desc', 'parseinline',
                        $wgLang->formatNum( $file->getWidth() ),