From: Brion Vibber Date: Sat, 30 Apr 2005 02:37:16 +0000 (+0000) Subject: Mix back some of the changes from previous check-in with additional fixes X-Git-Tag: 1.5.0alpha1~57 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=e4b96bc7ec049b73aa712eb89e45adcddfa37c33;p=lhc%2Fweb%2Fwiklou.git Mix back some of the changes from previous check-in with additional fixes and a cleaner version of the table. * Clean up EXIF display table: - use localized description of items - don't forget to HTML-encode the localized messages! - clean up the style a bit on the middle spacer - distinguish the header and data columns a little better * Don't show 'edit this image' link if no file exists --- diff --git a/includes/ImagePage.php b/includes/ImagePage.php index ebbc971937..6cd7b27da6 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -25,13 +25,13 @@ 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(); # No need to display noarticletext, we use our own message, output in openShowImage() - if ( $this->getID() ) { + if( $this->getID() ) { Article::view(); } else { # Just need to set the right headers @@ -45,7 +45,9 @@ class ImagePage extends Article { $this->closeShowImage(); $this->imageHistory(); $this->imageLinks(); - if ( $this->img->exists() ) $this->showEXIFdata(); + if( $this->img->exists() ) { + $this->showEXIFdata(); + } } else { Article::view(); } @@ -69,31 +71,35 @@ class ImagePage extends Article { function showEXIFdata() { global $wgOut, $wgShowEXIF; - if ( ! $wgShowEXIF ) return; + if( !$wgShowEXIF ) { + return; + } # Get the EXIF data $exif = $this->img->getExifData(); - if ( count ( $exif ) == 0 ) return; # No EXIF data available + if( count ( $exif ) == 0 ) { + return; # No EXIF data available + } # Create the table - $r = '

'. wfMsg( 'exifdata' ) . "

\n"; + $r = '

'. htmlspecialchars( wfMsg( 'exifdata' ) ) . "

\n"; $r .= "\n" ; $n = 0; - foreach ( $exif as $k => $v ) { - if ( $n % 2 == 0 ) { + foreach( $exif as $k => $v ) { + if( $n % 2 == 0 ) { $r .= ''; } - $r .= "\n"; - $r .= '\n"; + $r .= '\n"; + $r .= '\n"; if ( $n % 2 == 1 ) { $r .= "\n"; } else { - $r .= "\n"; + $r .= "\n"; } $n++; } if ( $n % 2 == 1 ) { - $r .= "\n"; + $r .= "\n"; } $wgOut->addHTML( $r . "
$k' . htmlspecialchars($v) . "' . wfMsg( 'exif-' . strtolower( $k ) ) . "' . htmlspecialchars( $v ) . "
   
\n" ); @@ -226,7 +232,9 @@ class ImagePage extends Article { } else { $s=''; } $wgOut->addHTML( $s ); - if ( $wgUseExternalEditor ) { + # 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 && $this->img->exists() ) { $this->uploadLinksBox(); } diff --git a/skins/monobook/main.css b/skins/monobook/main.css index 0dbb0bda57..aa936bcf6e 100644 --- a/skins/monobook/main.css +++ b/skins/monobook/main.css @@ -1111,7 +1111,6 @@ li span.deleted { /* Classes for EXIF data display */ table.exif { - background-color: #f9f9f9; margin-left: 0.5em; } @@ -1119,10 +1118,24 @@ table.exif caption { font-weight: bold; } table.exif th { font-weight: normal; } table.exif td { padding: 0.1em; } -table.exif, table.exif td, table.exif th { - border: 1px solid #aaaaaa; +table.exif { + border: none; border-collapse: collapse; } +table.exif td, table.exif th { + border: 1px solid #aaaaaa; +} +table.exif th { + background-color: #f9f9f9; +} +table.exif td { + background-color: #fcfcfc; +} +table.exif td.spacer { + background: white; + border-top: none; + border-bottom: none; +} .toggle { margin-left: 2em;