From 8c6db5089648cd4c69b49a44681333f7257e1ed4 Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Wed, 27 Oct 2010 01:50:07 +0000 Subject: [PATCH] Make the image page more consistent. Now all pages will have the fullMedia div. (with link, and file description) Perhaps we should move the "Size of this preview:" and "No higher resolution available" markers into that div as well ? Feedback welcome. --- includes/ImagePage.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 06cc5f3762..e9be037009 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -364,20 +364,15 @@ class ImagePage extends Article { ); } else { # Image is small enough to show full size on image page - $msgbig = htmlspecialchars( $this->displayImg->getName() ); $msgsmall = wfMsgExt( 'file-nohires', array( 'parseinline' ) ); } $params['width'] = $width; $thumbnail = $this->displayImg->transform( $params ); - $anchorclose = "
"; - if ( $this->displayImg->mustRender() ) { - $showLink = true; - } else { - $anchorclose .= - $msgsmall . - '
' . Xml::tags( 'a', $linkAttribs, $msgbig ) . "$dirmark " . $longDesc; + $showLink = true; + if ( !$this->displayImg->mustRender() ) { + $anchorclose = "
" . $msgsmall; } $isMulti = $this->displayImg->isMultipage() && $this->displayImg->pageCount() > 1; @@ -469,7 +464,11 @@ class ImagePage extends Article { if ( $showLink ) { $filename = wfEscapeWikiText( $this->displayImg->getName() ); - $medialink = "[[Media:$filename|$filename]]"; + $linktext = $filename; + if ( isset( $msgbig ) ) { + $linktext = wfEscapeWikiText( $msgbig ); + } + $medialink = "[[Media:$filename|$linktext]]"; if ( !$this->displayImg->isSafeFile() ) { $warning = wfMsgNoTrans( 'mediawarning' ); -- 2.20.1