diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 14679ebf608..4bb4d5b71cc 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -20,14 +20,22 @@ class ImagePage extends Article { /* private */ var $img; // Image object this page is shown for function view() { - global $wgUseExternalEditor, $wgOut ; + global $wgUseExternalEditor, $wgOut, $wgShowEXIF; $this->img = new Image( $this->mTitle ); if( $this->mTitle->getNamespace() == NS_IMAGE ) { - if( $this->img->exists() ) { - $this->showTOC(); + if ($wgShowEXIF && $this->img->exists()) { + $exif = $this->img->getExifData(); + $showmeta = count($exif) ? true : false; + } else { + $exif = false; + $showmeta = false; } + + if ($this->img->exists()) + $wgOut->addHTML($this->showTOC($showmeta)); + $this->openShowImage(); # No need to display noarticletext, we use our own message, output in openShowImage() @@ -44,38 +52,42 @@ class ImagePage extends Article { $this->closeShowImage(); $this->imageHistory(); + if ($exif) + $wgOut->addHTML($this->makeMetadataTable($exif)); $this->imageLinks(); - if( $this->img->exists() ) { - $this->showEXIFdata(); - } } else { Article::view(); } } - function showTOC() { - global $wgOut, $wgShowEXIF, $wgLang; + /** + * Create the TOC + * + * @access private + * + * @param bool $metadata Whether or not to show the metadata link + * @return string + */ + function showTOC( $metadata ) { + global $wgLang; $r = '
| \n"; } - $wgOut->addHTML( $r . " |