Special:Upload can now have a custom upload message instead of uploadtext by passing...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 7 Jan 2009 13:07:21 +0000 (13:07 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 7 Jan 2009 13:07:21 +0000 (13:07 +0000)
Message name is MediaWiki:Uploadtext-custom if the page is called with Special:Upload?uploadmsg=custom.
The default message will be used if the custom messages doesn't exist.
This should fix the Commons "uselang" hack on for Special:Upload.

RELEASE-NOTES
includes/specials/SpecialUpload.php

index c938415..72f15c0 100644 (file)
@@ -259,6 +259,8 @@ The following extensions are migrated into MediaWiki 1.14:
 * Make "Did you mean" search feature more noticeable
 * (bug 16720) Transcluded Special:NewPages processes "/username="
 * Added "Advanced search" link to the search form
+* Special:Upload can now have a custom upload message instead of uploadtext by
+  passing "uploadmsg" parameter in the url
 
 === Bug fixes in 1.14 ===
 
index 450c872..971de04 100644 (file)
@@ -996,8 +996,19 @@ wgUploadAutoFill = {$autofill};
                        $wgOut->addHTML( "<h2>{$sub}</h2>\n" .
                          "<span class='error'>{$msg}</span>\n" );
                }
+
+               $uploadMsg = $wgRequest->getVal( 'uploadmsg' );
+               if( $uploadMsg ) {
+                       $uploadMsgName = 'uploadtext-' . $uploadMsg;
+                       // Fall back to normal message if the custom messages is empty
+                       if( wfEmptyMsg( $uploadMsgName, wfMsg( $uploadMsgName ) ) )
+                               $uploadMsgName = 'uploadtext';
+               } else {
+                       $uploadMsgName = 'uploadtext';
+               }
+
                $wgOut->addHTML( '<div id="uploadtext">' );
-               $wgOut->addWikiMsg( 'uploadtext', $this->mDesiredDestName );
+               $wgOut->addWikiMsg( $uploadMsgName, $this->mDesiredDestName );
                $wgOut->addHTML( "</div>\n" );
 
                # Print a list of allowed file extensions, if so configured.  We ignore