From d7c5996274d96a147aa0f6792cb585adbed53367 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 8 May 2005 16:19:12 +0000 Subject: [PATCH] * Moving the metadata table back into a vertical table, I'm working on making collapsable sections within it so it won't be so big. --- includes/ImagePage.php | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 4bb4d5b71c..286201dbd8 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -22,7 +22,7 @@ class ImagePage extends Article { function view() { global $wgUseExternalEditor, $wgOut, $wgShowEXIF; - $this->img = new Image( $this->mTitle ); + $this->img = new Image( $this->mTitle ); if( $this->mTitle->getNamespace() == NS_IMAGE ) { if ($wgShowEXIF && $this->img->exists()) { @@ -37,6 +37,8 @@ class ImagePage extends Article { $wgOut->addHTML($this->showTOC($showmeta)); $this->openShowImage(); + if ($exif) + $wgOut->addWikiText($this->makeMetadataTable($exif)); # No need to display noarticletext, we use our own message, output in openShowImage() if( $this->getID() ) { @@ -52,8 +54,6 @@ class ImagePage extends Article { $this->closeShowImage(); $this->imageHistory(); - if ($exif) - $wgOut->addHTML($this->makeMetadataTable($exif)); $this->imageLinks(); } else { Article::view(); @@ -88,28 +88,14 @@ class ImagePage extends Article { * @return string */ function makeMetadataTable( $exif ) { - # Create the table - $r = '

'. htmlspecialchars( wfMsg( 'metadata' ) ) . "

\n"; - $r .= "\n" ; - $n = 0; + $r = "{| class=metadata align=right width=250px\n"; + $r .= '|+ id=metadata | '. htmlspecialchars( wfMsg( 'metadata' ) ) . "\n"; foreach( $exif as $k => $v ) { - if( $n % 2 == 0 ) { - $r .= ''; - } - $r .= '\n"; - $r .= '\n"; - if ( $n % 2 == 1 ) { - $r .= "\n"; - } else { - $r .= "\n"; - } - $n++; + $r .= '!' . wfMsg( 'exif-' . strtolower( $k ) ) . "\n"; + $r .= '|' . htmlspecialchars( $v ) . "\n"; + $r .= "|-\n"; } - if ( $n % 2 == 1 ) { - $r .= "\n"; - } - - return "$r
' . wfMsg( 'exif-' . strtolower( $k ) ) . "' . htmlspecialchars( $v ) . "
 
\n"; + return substr($r, 0, -3) . '|}'; } function openShowImage() -- 2.20.1