From b3f46dd82a7b455a743e81c0e770d84edbc54309 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 4 Dec 2009 11:33:50 +0000 Subject: [PATCH] * (bug 21523) File that can have multiple pages (djvu, pdf, ...) no longer have the page selector when they have only one page --- RELEASE-NOTES | 2 ++ includes/ImagePage.php | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9fd3ce74ec..7530fc74e2 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -663,6 +663,8 @@ Hopefully we will remove this configuration var soon) * (bug 20159) thumbnails rerendered if older that $wgThumbnailEpoch * Fixed a bug which in some situations causes the job queue to grow forever, due to an infinite loop of job requeues. +* (bug 21523) File that can have multiple pages (djvu, pdf, ...) no longer have + the page selector when they have only one page == API changes in 1.16 == diff --git a/includes/ImagePage.php b/includes/ImagePage.php index d85ffdb6b8..700bb767ba 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -329,7 +329,7 @@ class ImagePage extends Article { $linkAttribs = array( 'href' => $full_url ); $longDesc = $this->displayImg->getLongDesc(); - wfRunHooks( 'ImageOpenShowImageInlineBefore', array( &$this , &$wgOut ) ) ; + wfRunHooks( 'ImageOpenShowImageInlineBefore', array( &$this, &$wgOut ) ); if( $this->displayImg->allowInlineDisplay() ) { # image @@ -374,7 +374,8 @@ class ImagePage extends Article { '
' . Xml::tags( 'a', $linkAttribs, $msgbig ) . "$dirmark " . $longDesc; } - if( $this->displayImg->isMultipage() ) { + $isMulti = $this->displayImg->isMultipage() && $this->displayImg->pageCount() > 1; + if( $isMulti ) { $wgOut->addHTML( '
' ); } @@ -388,7 +389,7 @@ class ImagePage extends Article { $anchorclose . "\n" ); } - if( $this->displayImg->isMultipage() ) { + if( $isMulti ) { $count = $this->displayImg->pageCount(); if( $page > 1 ) { -- 2.20.1