From bdc10a03f312b31ad37e162f5704fbba169d1f88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Mon, 25 Apr 2005 23:44:16 +0000 Subject: [PATCH] * Rewrote showEXIFdata() to use addWikiText() instead of addHTML() --- includes/ImagePage.php | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index b39ea875c0..6abf063e85 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -54,26 +54,23 @@ class ImagePage extends Article { } } - function showEXIFdata() - { - global $wgOut , $wgShowEXIF ; - if ( ! $wgShowEXIF ) return ; + function showEXIFdata() { + global $wgOut, $wgShowEXIF; + if ( ! $wgShowEXIF ) return; # Get the EXIF data - $exif = $this->img->getExifData () ; - if ( count ( $exif ) == 0 ) return ; # No EXIF data available - if ( count ( $exif ) == 1 && isset ( $exif["EXIF"] ) && $exif["EXIF"] == "NO" ) return ; # This image does not have EXIF data + $exif = $this->img->getExifData(); + if ( count ( $exif ) == 0 ) return; # No EXIF data available # Create the table - $exifdata = wfMsg( 'exifdata' ); - $r = "\n\n" ; - $r .= "\n" ; - foreach ( $exif AS $k => $v ) { - $r .= '\n"; - } - $r .= '
$exifdata
' . htmlspecialchars ( $k ) . '' . htmlspecialchars ( $v ) . "
'; - $wgOut->addHTML ( $r ) ; + $r = "{| class=exif\n" ; + $r .= '|+ ' . wfMsg( 'exifdata' ) . "\n|-\n" ; + foreach ( $exif as $k => $v ) { + $r .= "! $k\n"; + $r .= '| ' . htmlspecialchars($v) . "\n|-\n"; } + $wgOut->addWikiText( substr($r, 0, -3) . '|}' ); + } function openShowImage() { -- 2.20.1