From: Brion Vibber Date: Sun, 5 Dec 2004 19:14:31 +0000 (+0000) Subject: Get image gallery playing nice with missing image files X-Git-Tag: 1.5.0alpha1~1149 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=6c799e62aa8be2db1c071dd0828c6973a6917962;p=lhc%2Fweb%2Fwiklou.git Get image gallery playing nice with missing image files --- diff --git a/includes/ImageGallery.php b/includes/ImageGallery.php index 8184ce4987..2b33d54e01 100644 --- a/includes/ImageGallery.php +++ b/includes/ImageGallery.php @@ -93,8 +93,17 @@ class ImageGallery //TODO //$ul = $sk->makeLink( $wgContLang->getNsText( Namespace::getUser() ) . ":{$ut}", $ut ); - $nb = $this->mShowBytes ? - wfMsg( "nbytes", $wgLang->formatNum( $img->getSize() ) ) . '
' : + if( $this->mShowBytes ) { + if( $img->exists() ) { + $nb = wfMsg( 'nbytes', $wgLang->formatNum( $img->getSize() ) ); + } else { + $nb = wfMsg( 'filemissing' ); + } + $nb = htmlspecialchars( $nb ) . '
'; + } else { + $nb = ''; + } + '' ; $textlink = $this->mShowFilename ? $sk->makeKnownLinkObj( $nt, htmlspecialchars( $wgLang->truncate( $nt->getText(), 20, '...' ) ) ) . '
' : diff --git a/languages/Language.php b/languages/Language.php index 98abf3cf39..6e086b3f7b 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1452,6 +1452,7 @@ article [[Train]]. 'thumbnail-more' => 'Enlarge', 'missingimage' => "Missing image
$1\n", +'filemissing' => 'File missing', # Special:Import 'import' => 'Import pages',