Missing global declaration.
[lhc/web/wiklou.git] / includes / ImagePage.php
index 582b4c1..6abf063 100644 (file)
@@ -54,29 +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
-               $r = "<table border='1' cellspacing='0' cellpadding='0' align='right'>" ;
-               $r .= "<caption>EXIF data</caption>" ;
-               foreach ( $exif AS $k => $v ) {
-                       $r .= "<tr>" ;
-                       $v = str_replace ( "\0" , "" , $v ) ;
-                       $r .= "<th><small>" . htmlspecialchars ( $k ) . "</small></th>" ;
-                       $r .= "<td><small>" . htmlspecialchars ( $v ) . "</small></td>" ;
-                       $r .= "</tr>" ;
-                       }
-               $r .= "</table>" ;
-               $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()
        {
@@ -159,7 +153,9 @@ class ImagePage extends Article {
 
        function uploadNewVersionLink() {
                global $wgOut;
+               $wgOut->addHTML("<div class='editExternally'>");
                $wgOut->addWikiText( wfMsg( 'uploadnewversion', $this->getUploadUrl() ) );
+               $wgOut->addHTML("</div><br clear='both' />");
        }
 
        function externalEditorLink()
@@ -172,7 +168,7 @@ class ImagePage extends Article {
                        "action=edit&externaledit=true&mode=file" ) );
                $wgOut->addWikiText( '<div class="editExternallyHelp">' .
                        wfMsg('edit-externally-help') . '</div>' );
-               $wgOut->addHTML( '</div><br clear="both" />' );
+               $wgOut->addHTML( '</div><br clear="all" />' );
        }
        
        function closeShowImage()