X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fgallery%2FTraditionalImageGallery.php;h=7a520bcbd1cd90e38ff1120038d0f584bc30b9cf;hb=72e689e843b839a2eb5d5382301449c69c7e0587;hp=0f889da6834ee90305e9adfc6fa3bb403e85ba0f;hpb=e758226c91935a1df2b6fd3ed1f18922d8bfb45b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/gallery/TraditionalImageGallery.php b/includes/gallery/TraditionalImageGallery.php index 0f889da683..7a520bcbd1 100644 --- a/includes/gallery/TraditionalImageGallery.php +++ b/includes/gallery/TraditionalImageGallery.php @@ -174,15 +174,20 @@ class TraditionalImageGallery extends ImageGalleryBase { // ":{$ut}" ); // $ul = Linker::link( $linkTarget, $ut ); - if ( $this->mShowBytes ) { - if ( $img ) { - $fileSize = htmlspecialchars( $lang->formatSize( $img->getSize() ) ); - } else { - $fileSize = $this->msg( 'filemissing' )->escaped(); + $meta = []; + if ( $img ) { + if ( $this->mShowDimensions ) { + $meta[] = $img->getDimensionsString(); } - $fileSize = "$fileSize
\n"; - } else { - $fileSize = ''; + if ( $this->mShowBytes ) { + $meta[] = htmlspecialchars( $lang->formatSize( $img->getSize() ) ); + } + } elseif ( $this->mShowDimensions || $this->mShowBytes ) { + $meta[] = $this->msg( 'filemissing' )->escaped(); + } + $meta = $lang->semicolonList( $meta ); + if ( $meta ) { + $meta .= "
\n"; } $textlink = $this->mShowFilename ? @@ -201,7 +206,7 @@ class TraditionalImageGallery extends ImageGalleryBase { ) . "\n" : ''; - $galleryText = $textlink . $text . $fileSize; + $galleryText = $textlink . $text . $meta; $galleryText = $this->wrapGalleryText( $galleryText, $thumb ); # Weird double wrapping (the extra div inside the li) needed due to FF2 bug @@ -343,22 +348,8 @@ class TraditionalImageGallery extends ImageGalleryBase { * * Used by a subclass to insert extra high resolution images. * @param MediaTransformOutput $thumb The thumbnail - * @param array $imageParameters Array of options + * @param array &$imageParameters Array of options */ protected function adjustImageParameters( $thumb, &$imageParameters ) { } } - -/** - * Backwards compatibility. This always uses traditional mode - * if called the old way, for extensions that may expect traditional - * mode. - * - * @deprecated since 1.22 Use ImageGalleryBase::factory instead. - */ -class ImageGallery extends TraditionalImageGallery { - function __construct( $mode = 'traditional' ) { - wfDeprecated( __METHOD__, '1.22' ); - parent::__construct( $mode ); - } -}