Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -829,6 +829,7 @@ |
830 | 830 | 'destfilename', |
831 | 831 | 'watchthisupload', |
832 | 832 | 'filewasdeleted', |
| 833 | + 'upload-wasdeleted', |
833 | 834 | 'filename-bad-prefix', |
834 | 835 | 'filename-prefix-blacklist', |
835 | 836 | ), |
Index: trunk/phase3/skins/chick/main.css |
— | — | @@ -466,7 +466,8 @@ |
467 | 467 | |
468 | 468 | .templatesUsed { margin-top: 1.5em; } |
469 | 469 | |
470 | | -/* Recreating-deleted-page warning and log entries */ |
| 470 | +/* Recreating-deleted-page/reupload file warning and log entries */ |
| 471 | +div#mw-upload-deleted-warn ul li, |
471 | 472 | div#mw-recreate-deleted-warn ul li { |
472 | 473 | font-size: 95%; |
473 | 474 | } |
Index: trunk/phase3/skins/monobook/main.css |
— | — | @@ -1567,12 +1567,14 @@ |
1568 | 1568 | background-color: #FFCCCC; |
1569 | 1569 | } |
1570 | 1570 | |
1571 | | -/* Recreating-deleted-page warning and log entries */ |
| 1571 | +/* Recreating-deleted-page/reupload file warning and log entries */ |
| 1572 | +div#mw-upload-deleted-warn, |
1572 | 1573 | div#mw-recreate-deleted-warn { |
1573 | 1574 | padding: 3px; |
1574 | 1575 | margin-bottom: 3px; |
1575 | 1576 | border: 2px solid #2F6FAB; |
1576 | 1577 | } |
| 1578 | +div#mw-upload-deleted-warn ul li |
1577 | 1579 | div#mw-recreate-deleted-warn ul li { |
1578 | 1580 | font-size: 90%; |
1579 | 1581 | } |
— | — | @@ -1584,4 +1586,4 @@ |
1585 | 1587 | text-align: center; |
1586 | 1588 | vertical-align: middle; |
1587 | 1589 | font-size: 90%; |
1588 | | -} |
\ No newline at end of file |
| 1590 | +} |
Index: trunk/phase3/skins/common/cologneblue.css |
— | — | @@ -95,13 +95,15 @@ |
96 | 96 | small { font-size: 75%; } |
97 | 97 | input.mw-searchInput { width: 106px; } |
98 | 98 | |
99 | | -/* Recreating-deleted-page warning and log entries */ |
| 99 | +/* Recreating-deleted-page/reupload file warning and log entries */ |
| 100 | +div#mw-upload-deleted-warn, |
100 | 101 | div#mw-recreate-deleted-warn { |
101 | 102 | padding: 3px; |
102 | 103 | margin-top: 3px; |
103 | 104 | margin-bottom: 3px; |
104 | 105 | border: 1px solid #6688AA; |
105 | 106 | } |
| 107 | +div#mw-upload-deleted-warn ul li, |
106 | 108 | div#mw-recreate-deleted-warn ul li { |
107 | 109 | font-size: 90%; |
108 | 110 | } |
\ No newline at end of file |
Index: trunk/phase3/skins/common/oldshared.css |
— | — | @@ -447,7 +447,8 @@ |
448 | 448 | float: right; |
449 | 449 | } |
450 | 450 | |
451 | | -/* Recreating-deleted-page warning and log entries */ |
| 451 | +/* Recreating-deleted-page/reupload file warning and log entries */ |
| 452 | +div#mw-upload-deleted-warn ul li, |
452 | 453 | div#mw-recreate-deleted-warn ul li { |
453 | 454 | font-size: 95%; |
454 | 455 | } |
Index: trunk/phase3/skins/simple/main.css |
— | — | @@ -438,7 +438,8 @@ |
439 | 439 | |
440 | 440 | .templatesUsed { margin-top: 1.5em; } |
441 | 441 | |
442 | | -/* Recreating-deleted-page warning and log entries */ |
| 442 | +/* Recreating-deleted-page/reupload file warning and log entries */ |
| 443 | +div#mw-upload-deleted-warn ul li, |
443 | 444 | div#mw-recreate-deleted-warn ul li { |
444 | 445 | font-size: 95%; |
445 | 446 | } |
Index: trunk/phase3/includes/SpecialUpload.php |
— | — | @@ -795,10 +795,10 @@ |
796 | 796 | |
797 | 797 | $useAjaxDestCheck = $wgUseAjax && $wgAjaxUploadDestCheck; |
798 | 798 | $useAjaxLicensePreview = $wgUseAjax && $wgAjaxLicensePreview; |
799 | | - |
| 799 | + |
800 | 800 | $adc = wfBoolToStr( $useAjaxDestCheck ); |
801 | 801 | $alp = wfBoolToStr( $useAjaxLicensePreview ); |
802 | | - |
| 802 | + |
803 | 803 | $wgOut->addScript( "<script type=\"text/javascript\"> |
804 | 804 | wgAjaxUploadDestCheck = {$adc}; |
805 | 805 | wgAjaxLicensePreview = {$alp}; |
— | — | @@ -811,10 +811,11 @@ |
812 | 812 | wfDebug( "Hook 'UploadForm:initial' broke output of the upload form" ); |
813 | 813 | return false; |
814 | 814 | } |
815 | | - |
816 | | - if( $this->mDesiredDestName && $wgUser->isAllowed( 'deletedhistory' ) ) { |
| 815 | + |
| 816 | + if( $this->mDesiredDestName ) { |
817 | 817 | $title = Title::makeTitleSafe( NS_IMAGE, $this->mDesiredDestName ); |
818 | | - if( $title instanceof Title && ( $count = $title->isDeleted() ) > 0 ) { |
| 818 | + // Show a subtitle link to deleted revisions (to sysops et al only) |
| 819 | + if( $title instanceof Title && ( $count = $title->isDeleted() ) > 0 && $wgUser->isAllowed( 'deletedhistory' ) ) { |
819 | 820 | $link = wfMsgExt( |
820 | 821 | $wgUser->isAllowed( 'delete' ) ? 'thisisdeleted' : 'viewdeleted', |
821 | 822 | array( 'parse', 'replaceafter' ), |
— | — | @@ -824,7 +825,12 @@ |
825 | 826 | ) |
826 | 827 | ); |
827 | 828 | $wgOut->addHtml( "<div id=\"contentSub2\">{$link}</div>" ); |
828 | | - } |
| 829 | + } |
| 830 | + |
| 831 | + // Show the relevant lines from deletion log (for still deleted files only) |
| 832 | + if( $title instanceof Title && $title->isDeleted() > 0 && !$title->exists() ) { |
| 833 | + $this->showDeletionLog( $wgOut, $title->getPrefixedText() ); |
| 834 | + } |
829 | 835 | } |
830 | 836 | |
831 | 837 | $cols = intval($wgUser->getOption( 'cols' )); |
— | — | @@ -1463,4 +1469,29 @@ |
1464 | 1470 | } |
1465 | 1471 | return $pageText; |
1466 | 1472 | } |
| 1473 | + |
| 1474 | + /** |
| 1475 | + * If there are rows in the deletion log for this file, show them, |
| 1476 | + * along with a nice little note for the user |
| 1477 | + * |
| 1478 | + * @param OutputPage $out |
| 1479 | + * @param string filename |
| 1480 | + */ |
| 1481 | + private function showDeletionLog( $out, $filename ) { |
| 1482 | + $reader = new LogReader( |
| 1483 | + new FauxRequest( |
| 1484 | + array( |
| 1485 | + 'page' => $filename, |
| 1486 | + 'type' => 'delete', |
| 1487 | + ) |
| 1488 | + ) |
| 1489 | + ); |
| 1490 | + if( $reader->hasRows() ) { |
| 1491 | + $out->addHtml( '<div id="mw-upload-deleted-warn">' ); |
| 1492 | + $out->addWikiText( wfMsg( 'upload-wasdeleted' ) ); |
| 1493 | + $viewer = new LogViewer( $reader ); |
| 1494 | + $viewer->showList( $out ); |
| 1495 | + $out->addHtml( '</div>' ); |
| 1496 | + } |
| 1497 | + } |
1467 | 1498 | } |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1215,7 +1215,7 @@ |
1216 | 1216 | * to ensure that client-side caches don't keep obsolete copies of global |
1217 | 1217 | * styles. |
1218 | 1218 | */ |
1219 | | -$wgStyleVersion = '99'; |
| 1219 | +$wgStyleVersion = '100'; |
1220 | 1220 | |
1221 | 1221 | |
1222 | 1222 | # Server-side caching: |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1428,6 +1428,10 @@ |
1429 | 1429 | 'destfilename' => 'Destination filename', |
1430 | 1430 | 'watchthisupload' => 'Watch this page', |
1431 | 1431 | 'filewasdeleted' => 'A file of this name has been previously uploaded and subsequently deleted. You should check the $1 before proceeding to upload it again.', |
| 1432 | +'upload-wasdeleted' => "'''Warning: You are uploading a file that was previously deleted.''' |
| 1433 | + |
| 1434 | +You should consider whether it is appropriate to continue uploading this file. |
| 1435 | +The deletion log for this file is provided here for convenience:", |
1432 | 1436 | 'filename-bad-prefix' => 'The name of the file you are uploading begins with <strong>"$1"</strong>, which is a non-descriptive name typically assigned automatically by digital cameras. Please choose a more descriptive name for your file.', |
1433 | 1437 | 'filename-prefix-blacklist' => ' #<!-- leave this line exactly as it is --> <pre> |
1434 | 1438 | # Syntax is as follows: |
Index: trunk/phase3/languages/messages/MessagesDe.php |
— | — | @@ -1079,6 +1079,10 @@ |
1080 | 1080 | 'destfilename' => 'Zielname', |
1081 | 1081 | 'watchthisupload' => 'Diese Seite beobachten', |
1082 | 1082 | 'filewasdeleted' => 'Eine Datei mit diesem Namen wurde schon einmal hochgeladen und zwischenzeitlich wieder gelöscht. Bitte prüfe zuerst den Eintrag im $1, bevor du die Datei wirklich speicherst.', |
| 1083 | +'upload-wasdeleted' => "'''Achtung: Du lädst eine Datei hoch, die bereits früher gelöscht wurde.''' |
| 1084 | + |
| 1085 | +Bitte prüfe sorgfältig, ob das erneute Hochladen den Richtlinien entspricht. |
| 1086 | +Zu Deiner Information folgt das Lösch-Logbuch mit der Begründung für die vorhergehende Löschung:", |
1083 | 1087 | 'filename-bad-prefix' => 'Der Dateiname beginnt mit <strong>„$1“</strong>. Dies ist im allgemeinen der von einer Digitalkamera vorgegebener Dateiname und daher nicht sehr aussagekräftig. |
1084 | 1088 | Bitte gebe der Datei einen Namen, der den Inhalt besser beschreibt.', |
1085 | 1089 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -29,6 +29,7 @@ |
30 | 30 | * (bug 11151) Add descriptive <title> to revision history page |
31 | 31 | * (bug 5412) Add feed links for the site to all pages |
32 | 32 | * (bug 11353) Add ability to retrieve raw section content via action=raw |
| 33 | +* Show relevant deletion log lines when uploading a previously deleted file |
33 | 34 | |
34 | 35 | === Bug fixes in 1.12 === |
35 | 36 | |