X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FImagePage.php;h=8f683e92073b9e8464e4d867ff06b2c0cf8f6b5f;hb=071b7d9adf291b897a0eb47b6cb98ca68ca182e6;hp=3fbbcba26b85bf83a3700bc0e340a6d6886fbeb8;hpb=5b4e4a06c79047709d734c07a6e7dc11c71b254f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 3fbbcba26b..8f683e9207 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -346,18 +346,30 @@ class ImagePage extends Article { # Note that $height <= $maxHeight now, but might not be identical # because of rounding. } - $msgbig = wfMsgHtml( 'show-big-image' ); + $msgbig = wfMsgHtml( 'show-big-image' ); + if ( $this->displayImg->getRepo()->canTransformVia404() ) { + $thumbSizes = $wgImageLimits; + } else { + # Creating thumb links triggers thumbnail generation. + # Just generate the thumb for the current users prefs. + $thumbOption = $user->getOption( 'thumbsize' ); + $thumbSizes = array( isset( $wgImageLimits[$thumbOption] ) + ? $wgImageLimits[$thumbOption] + : $wgImageLimits[User::getDefaultOption( 'thumbsize' )] ); + } + # Generate thumbnails or thumbnail links as needed... $otherSizes = array(); - foreach ( $wgImageLimits as $size ) { - if ( $size[0] < $width_orig && $size[1] < $height_orig && - $size[0] != $width && $size[1] != $height ) { + foreach ( $thumbSizes as $size ) { + if ( $size[0] < $width_orig && $size[1] < $height_orig + && $size[0] != $width && $size[1] != $height ) + { $otherSizes[] = $this->makeSizeLink( $params, $size[0], $size[1] ); } } $msgsmall = wfMessage( 'show-big-image-preview' )-> rawParams( $this->makeSizeLink( $params, $width, $height ) )-> parse(); - if ( count( $otherSizes ) && $this->displayImg->getRepo()->canTransformVia404() ) { + if ( count( $otherSizes ) ) { $msgsmall .= ' ' . Html::rawElement( 'span', array( 'class' => 'mw-filepage-other-resolutions' ), wfMessage( 'show-big-image-other' )->rawParams( $lang->pipeList( $otherSizes ) )-> @@ -978,7 +990,7 @@ class ImageHistoryList extends ContextSource { $img = $iscur ? $file->getName() : $file->getArchiveName(); $userId = $file->getUser( 'id' ); $userText = $file->getUser( 'text' ); - $description = $file->getDescription(); + $description = $file->getDescription( File::FOR_THIS_USER, $user ); $local = $this->current->isLocal(); $row = $selected = ''; @@ -1026,7 +1038,9 @@ class ImageHistoryList extends ContextSource { $row .= '