From: Aaron Schulz Date: Mon, 15 Dec 2008 22:22:21 +0000 (+0000) Subject: Add getGeneralShortDesc() and the like to avoid E_STRICT instead X-Git-Tag: 1.31.0-rc.0~43951 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=49de11df319e783a15a459583fe2247ed987831e;p=lhc%2Fweb%2Fwiklou.git Add getGeneralShortDesc() and the like to avoid E_STRICT instead --- diff --git a/includes/filerepo/File.php b/includes/filerepo/File.php index d28fba04d1..4f0990afe7 100644 --- a/includes/filerepo/File.php +++ b/includes/filerepo/File.php @@ -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 ); } } diff --git a/includes/media/Generic.php b/includes/media/Generic.php index 3e6c944bde..a9c681e146 100644 --- a/includes/media/Generic.php +++ b/includes/media/Generic.php @@ -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', diff --git a/includes/media/SVG.php b/includes/media/SVG.php index c7ca2131a7..f0519e8973 100644 --- a/includes/media/SVG.php +++ b/includes/media/SVG.php @@ -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() ),