* (bug 9002) Provide a "view/restore deleted edits" link on Special:Upload when a...
authorRob Church <robchurch@users.mediawiki.org>
Wed, 22 Aug 2007 08:51:56 +0000 (08:51 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Wed, 22 Aug 2007 08:51:56 +0000 (08:51 +0000)
* Fix various bits of invalid XHTML in Special:Upload

RELEASE-NOTES
includes/SpecialUpload.php

index 8cfb5b6..619c4ef 100644 (file)
@@ -182,6 +182,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 11001) Submit Special:Newpages as a GET, rather than a POST request
 * The <strong></strong> around links to watched pages in change lists now
   has a class - "mw-watched"
+* (bug 9002) Provide a "view/restore deleted edits" link on Special:Upload
+  when a destination filename is provided that corresponds with previous
+  deleted files
 
 == Bugfixes since 1.10 ==
 
@@ -400,6 +403,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   leading to inconsistent paging behaviour
 * (bug 9026) Incorrect heading numbering when viewing Special:Statistics with
   "auto-numbered headings" enabled
+* Fixed invalid XHTML in Special:Upload
 
 == API changes since 1.10 ==
 
index 597fd14..62e76ae 100644 (file)
@@ -758,6 +758,21 @@ wgAjaxLicensePreview = {$alp};
                        wfDebug( "Hook 'UploadForm:initial' broke output of the upload form" );
                        return false;
                }
+               
+               if( $this->mDesiredDestName && $wgUser->isAllowed( 'delete' ) ) {
+                       $title = Title::makeTitleSafe( NS_IMAGE, $this->mDesiredDestName );
+                       if( $title instanceof Title && ( $count = $title->isDeleted() ) > 0 ) {
+                               $link = wfMsgExt(
+                                       'thisisdeleted',
+                                       array( 'parse', 'replaceafter' ),
+                                       $wgUser->getSkin()->makeKnownLinkObj(
+                                               SpecialPage::getTitleFor( 'Undelete', $title->getPrefixedText() ),
+                                               wfMsgHtml( 'restorelink', $count )
+                                       )
+                               );
+                               $wgOut->addHtml( "<div id=\"contentSub2\">{$link}</div>" );
+                       }                               
+               }
 
                $cols = intval($wgUser->getOption( 'cols' ));
                $ew = $wgUser->getOption( 'editwidth' );
@@ -775,7 +790,7 @@ wgAjaxLicensePreview = {$alp};
 
                $sourcefilename = wfMsgHtml( 'sourcefilename' );
                $destfilename = wfMsgHtml( 'destfilename' );
-               $summary = wfMsgWikiHtml( 'fileuploadsummary' );
+               $summary = wfMsgExt( 'fileuploadsummary', 'parseinline' );
 
                $licenses = new Licenses();
                $license = wfMsgExt( 'license', array( 'parseinline' ) );
@@ -824,7 +839,7 @@ wgAjaxLicensePreview = {$alp};
                                "<input type='hidden' name='wpSourceType' value='file' />" ;
                }
                if ( $useAjaxDestCheck ) {
-                       $warningRow = "<tr><td colspan='2' id='wpDestFile-warning'>&nbsp</td></tr>";
+                       $warningRow = "<tr><td colspan='2' id='wpDestFile-warning'>&nbsp;</td></tr>";
                        $destOnkeyup = 'onkeyup="wgUploadWarningObj.keypress();"';
                } else {
                        $warningRow = '';
@@ -1395,6 +1410,4 @@ EOT
                }
                return $pageText;
        }
-}
-
-
+}
\ No newline at end of file