From 11030d3e1f71b6dab7d4b85406e98a1175c8c596 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Wed, 22 Aug 2007 08:51:56 +0000 Subject: [PATCH] * (bug 9002) Provide a "view/restore deleted edits" link on Special:Upload when a destination filename is provided that corresponds with previous deleted files * Fix various bits of invalid XHTML in Special:Upload --- RELEASE-NOTES | 4 ++++ includes/SpecialUpload.php | 23 ++++++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 8cfb5b69ba..619c4ef7ec 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 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 == diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index 597fd148bf..62e76ae027 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -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( "
{$link}
" ); + } + } $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}; "" ; } if ( $useAjaxDestCheck ) { - $warningRow = " "; + $warningRow = " "; $destOnkeyup = 'onkeyup="wgUploadWarningObj.keypress();"'; } else { $warningRow = ''; @@ -1395,6 +1410,4 @@ EOT } return $pageText; } -} - - +} \ No newline at end of file -- 2.20.1