Use appropriate HTML functions to create the tool links on image pages, so they don...
authorRob Church <robchurch@users.mediawiki.org>
Mon, 22 May 2006 09:28:03 +0000 (09:28 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Mon, 22 May 2006 09:28:03 +0000 (09:28 +0000)
RELEASE-NOTES
includes/ImagePage.php
languages/Messages.php

index 145a101..f320c38 100644 (file)
@@ -309,6 +309,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 6039) Update for Portuguese localisation (pt)
 * (bug 764) Add CREATE TEMPORARY TABLES to default database permissions
 * Big update to Swedish localisation (sv)
+* Use appropriate HTML functions to create the tool links on image pages, so they don't
+  look garbled when tidy isn't on
 
 == Compatibility ==
 
index 9f1a480..840dc8e 100644 (file)
@@ -324,24 +324,31 @@ END
                return $wgServer . $uploadTitle->getLocalUrl( 'wpDestFile=' . urlencode( $this->img->getName() ) );
        }
 
-
-       function uploadLinksBox()
-       {
+       /**
+        * Print out the various links at the bottom of the image page, e.g. reupload,
+        * external editing (and instructions link) etc.
+        */
+       function uploadLinksBox() {
                global $wgUser, $wgOut;
 
-               if ($this->img->fromSharedDirectory)
+               if( $this->img->fromSharedDirectory )
                        return;
 
                $sk = $wgUser->getSkin();
-               $wgOut->addHTML( '<br /><ul>' );
+               
+               $wgOut->addHtml( '<br /><ul>' );
+               
+               # "Upload a new version of this file" link
                if( $wgUser->isAllowed( 'reupload' ) ) {
-                       $wgOut->addWikiText( "<li>\n<div>". wfMsg( 'uploadnewversion', $this->getUploadUrl() ) ."</div>\n</li>\n" );
-               }
-               $wgOut->addHTML( '<li>' );
-               $wgOut->addHTML( $sk->makeKnownLinkObj( $this->mTitle,
-                       wfMsg( 'edit-externally' ), "action=edit&externaledit=true&mode=file" ) );
-               $wgOut->addWikiText( '<div>' .  wfMsg('edit-externally-help') . '</div>' );
-               $wgOut->addHTML( '</li></ul>' );
+                       $ulink = $sk->makeExternalLink( $this->getUploadUrl(), wfMsg( 'uploadnewversion' ) );
+                       $wgOut->addHtml( "<li><div>{$ulink}</div></li>" );
+               }
+               
+               # External editing link
+               $elink = $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'edit-externally' ), 'action=edit&externaledit=true&mode=file' );
+               $wgOut->addHtml( '<li>' . $elink . '<div>' . wfMsgWikiHtml( 'edit-externally-help' ) . '</div></li>' );
+               
+               $wgOut->addHtml( '</ul>' );
        }
 
        function closeShowImage()
index 0845a77..7342f25 100644 (file)
@@ -868,7 +868,7 @@ this old version, (rev) = revert to this old version.
 'shareddescriptionfollows' => '-',
 'noimage'       => 'No file by this name exists, you can $1.',
 'noimage-linktext'       => 'upload it',
-'uploadnewversion' => '[$1 Upload a new version of this file]',
+'uploadnewversion' => 'Upload a new version of this file',
 
 # Mime search
 #