# 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 ) )->
$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 = '';
$row .= '<td>';
if ( $iscur ) {
$row .= wfMsgHtml( 'filehist-current' );
- } elseif ( $local && $user->isLoggedIn() && $this->title->userCan( 'edit' ) ) {
+ } elseif ( $local && $this->title->quickUserCan( 'edit' )
+ && $this->title->quickUserCan( 'upload' )
+ ) {
if ( $file->isDeleted( File::DELETED_FILE ) ) {
$row .= wfMsgHtml( 'filehist-revert' );
} else {
// Image dimensions + size
$row .= '<td>';
$row .= htmlspecialchars( $file->getDimensionsString() );
- $row .= ' <span style="white-space: nowrap;">(' . Linker::formatSize( $file->getSize() ) . ')</span>';
+ $row .= $this->getContext()->msg( 'word-separator' )->plain();
+ $row .= '<span style="white-space: nowrap;">';
+ $row .= $this->getContext()->msg( 'parentheses' )->rawParams( Linker::formatSize( $file->getSize() ) )->plain();
+ $row .= '</span>';
$row .= '</td>';
// Uploading user
$row .= '<span class="history-deleted">' . wfMsgHtml( 'rev-deleted-user' ) . '</span>';
} else {
if ( $local ) {
- $row .= Linker::userLink( $userId, $userText ) . ' <span style="white-space: nowrap;">' .
- Linker::userToolLinks( $userId, $userText ) . '</span>';
+ $row .= Linker::userLink( $userId, $userText );
+ $row .= $this->getContext()->msg( 'word-separator' )->plain();
+ $row .= '<span style="white-space: nowrap;">';
+ $row .= Linker::userToolLinks( $userId, $userText );
+ $row .= '</span>';
} else {
$row .= htmlspecialchars( $userText );
}