X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fgallery%2FTraditionalImageGallery.php;h=a0059cea1fcc76d265451cb7e4dc8ce8fa279fb2;hb=7bb26739ec20082cdce09115ac7a80e15325ec8c;hp=f6527b820ed9022e5d0dde516917c341231eed35;hpb=99dbf4e1d4d7f18e02935bdb8cd3be4413ffe729;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/gallery/TraditionalImageGallery.php b/includes/gallery/TraditionalImageGallery.php index f6527b820e..a0059cea1f 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 @@ -238,8 +243,8 @@ class TraditionalImageGallery extends ImageGalleryBase { } /** - * How much padding such the thumb have between image and inner div that - * that contains the border. This is both for verical and horizontal + * How much padding the thumb has between the image and the inner div + * that contains the border. This is for both vertical and horizontal * padding. (However, it is cut in half in the vertical direction). * @return int */ @@ -348,17 +353,3 @@ class TraditionalImageGallery extends ImageGalleryBase { 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 ); - } -}