From: Brion Vibber Date: Sat, 30 Apr 2005 01:59:51 +0000 (+0000) Subject: Undo severe uglification and cluttering of exif table X-Git-Tag: 1.5.0alpha1~58 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=307371410105564c483ca0bd15c2a07f4356cb6c;p=lhc%2Fweb%2Fwiklou.git Undo severe uglification and cluttering of exif table --- diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 937c3194bd..ebbc971937 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -25,13 +25,10 @@ class ImagePage extends Article { $this->img = new Image( $this->mTitle ); if( $this->mTitle->getNamespace() == NS_IMAGE ) { - if ( $this->img->exists() ) + if ( $this->img->exists() ) { $this->showTOC(); + } $this->openShowImage(); - $this->closeShowImage(); - if ( $this->img->exists() ) - $this->showEXIFdata(); - # No need to display noarticletext, we use our own message, output in openShowImage() if ( $this->getID() ) { @@ -45,12 +42,10 @@ class ImagePage extends Article { $this->viewUpdates(); } + $this->closeShowImage(); $this->imageHistory(); - # Exist check because we don't want to show this on pages where an image - # doesn't exist along with the noimage message, that would suck. -ævar - if ( $wgUseExternalEditor and $this->img->exists() ) - $this->uploadLinksBox(); $this->imageLinks(); + if ( $this->img->exists() ) $this->showEXIFdata(); } else { Article::view(); } @@ -59,13 +54,16 @@ class ImagePage extends Article { function showTOC() { global $wgOut, $wgShowEXIF, $wgLang; - $r = ''; - $wgOut->addHTML( $r ); + $r= '
'.wfMsg( 'toc' ).'
'; + $r .= '' . $wgLang->getNStext( NS_IMAGE ) . ' - '; + $r .= '' . wfMsg( 'imghistory' ) . ' - '; + $r .= '' . wfMsg( 'imagelinks' ) . ''; + if ( $wgShowEXIF ) { + $r .= ' - ' . wfMsg( 'exifdata' ) . ''; + } + + + $wgOut->addHTML( $r . '
' ); } @@ -75,18 +73,30 @@ class ImagePage extends Article { # Get the EXIF data $exif = $this->img->getExifData(); - if ( !count($exif) ) - return; # No EXIF data available + if ( count ( $exif ) == 0 ) return; # No EXIF data available # Create the table - $r = "
\n{| class=metadata\n"; # For those wondering whether the div is redundant, then no, it isn't -ævar - $r .= '|+ ' . wfMsg( 'metadata' ) . "\n|-\n" ; + $r = '

'. wfMsg( 'exifdata' ) . "

\n"; + $r .= "\n" ; + $n = 0; foreach ( $exif as $k => $v ) { - $r .= '! ' . wfMsg( 'exif-' . strtolower($k) ) . "\n"; - $r .= "| $v\n"; - $r .= "|-\n"; + if ( $n % 2 == 0 ) { + $r .= ''; + } + $r .= "\n"; + $r .= '\n"; + if ( $n % 2 == 1 ) { + $r .= "\n"; + } else { + $r .= "\n"; + } + $n++; } - $wgOut->addWikiText( substr($r, 0, -3) . "|}\n" ); + if ( $n % 2 == 1 ) { + $r .= "\n"; + } + + $wgOut->addHTML( $r . "
$k' . htmlspecialchars($v) . "
  
\n" ); } function openShowImage() @@ -173,7 +183,7 @@ class ImagePage extends Article { { global $wgUser,$wgOut; $sk = $wgUser->getSkin(); - $wgOut->addHTML( '