Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -640,6 +640,7 @@ |
641 | 641 | 'rev-deleted-user', |
642 | 642 | 'rev-deleted-event', |
643 | 643 | 'rev-deleted-text-permission', |
| 644 | + 'rev-deleted-text-unhide', |
644 | 645 | 'rev-deleted-text-view', |
645 | 646 | 'rev-deleted-no-diff', |
646 | 647 | 'rev-deleted-unhide-diff', |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -929,17 +929,30 @@ |
930 | 930 | if( is_null( $this->mRevision ) ) { |
931 | 931 | // FIXME: This would be a nice place to load the 'no such page' text. |
932 | 932 | } else { |
933 | | - $this->setOldSubtitle( isset($this->mOldId) ? $this->mOldId : $oldid ); |
| 933 | + $this->setOldSubtitle( $oldid ); |
934 | 934 | # Allow admins to see deleted content if explicitly requested |
935 | 935 | if( $this->mRevision->isDeleted( Revision::DELETED_TEXT ) ) { |
936 | | - if( !$unhide || !$this->mRevision->userCan(Revision::DELETED_TEXT) ) { |
937 | | - $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n", 'rev-deleted-text-permission' ); |
| 936 | + // If the user is not allowed to see it... |
| 937 | + if( !$this->mRevision->userCan(Revision::DELETED_TEXT) ) { |
| 938 | + $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n", |
| 939 | + 'rev-deleted-text-permission' ); |
938 | 940 | $wgOut->setPageTitle( $this->mTitle->getPrefixedText() ); |
939 | 941 | wfProfileOut( __METHOD__ ); |
940 | 942 | return; |
| 943 | + // If the user needs to confirm that they want to see it... |
| 944 | + } else if( !$unhide ) { |
| 945 | + # Give explanation and add a link to view the revision... |
| 946 | + $link = $this->mTitle->getFullUrl( "oldid={$oldid}". |
| 947 | + '&unhide=1&token='.urlencode( $wgUser->editToken($oldid) ) ); |
| 948 | + $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n", |
| 949 | + array('rev-deleted-text-unhide',$link) ); |
| 950 | + $wgOut->setPageTitle( $this->mTitle->getPrefixedText() ); |
| 951 | + wfProfileOut( __METHOD__ ); |
| 952 | + return; |
| 953 | + // We are allowed to see... |
941 | 954 | } else { |
942 | | - $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n", 'rev-deleted-text-view' ); |
943 | | - // and we are allowed to see... |
| 955 | + $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n", |
| 956 | + 'rev-deleted-text-view' ); |
944 | 957 | } |
945 | 958 | } |
946 | 959 | // Is this the current revision and otherwise cacheable? Try the parser cache... |
Index: trunk/phase3/includes/PageHistory.php |
— | — | @@ -252,7 +252,9 @@ |
253 | 253 | * @param bool $firstInList Whether this row corresponds to the first displayed on this history page. |
254 | 254 | * @return string HTML output for the row |
255 | 255 | */ |
256 | | - function historyLine( $row, $next, $counter = '', $notificationtimestamp = false, $latest = false, $firstInList = false ) { |
| 256 | + function historyLine( $row, $next, $counter = '', $notificationtimestamp = false, |
| 257 | + $latest = false, $firstInList = false ) |
| 258 | + { |
257 | 259 | global $wgUser, $wgLang; |
258 | 260 | $rev = new Revision( $row ); |
259 | 261 | $rev->setTitle( $this->mTitle ); |
— | — | @@ -268,10 +270,12 @@ |
269 | 271 | if( $wgUser->isAllowed( 'deleterevision' ) ) { |
270 | 272 | if( $latest ) { |
271 | 273 | // We don't currently handle well changing the top revision's settings |
272 | | - $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), '('.$this->message['rev-delundel'].')' ); |
| 274 | + $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), '('. |
| 275 | + $this->message['rev-delundel'].')' ); |
273 | 276 | } else if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { |
274 | 277 | // If revision was hidden from sysops |
275 | | - $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), '('.$this->message['rev-delundel'].')' ); |
| 278 | + $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), '('. |
| 279 | + $this->message['rev-delundel'].')' ); |
276 | 280 | } else { |
277 | 281 | $query = array( 'target' => $this->mTitle->getPrefixedDbkey(), |
278 | 282 | 'oldid' => $rev->getId() |
— | — | @@ -350,11 +354,14 @@ |
351 | 355 | function revLink( $rev ) { |
352 | 356 | global $wgLang; |
353 | 357 | $date = $wgLang->timeanddate( wfTimestamp(TS_MW, $rev->getTimestamp()), true ); |
354 | | - if( !$rev->isDeleted( Revision::DELETED_TEXT ) ) { |
| 358 | + if( $rev->userCan( Revision::DELETED_TEXT ) ) { |
355 | 359 | $link = $this->mSkin->makeKnownLinkObj( $this->mTitle, $date, "oldid=" . $rev->getId() ); |
356 | 360 | } else { |
357 | | - $link = '<span class="history-deleted">' . $date . '</span>'; |
| 361 | + $link = $date; |
358 | 362 | } |
| 363 | + if( $rev->isDeleted( Revision::DELETED_TEXT ) ) { |
| 364 | + $link = "<span class=\"history-deleted\">$link</span>"; |
| 365 | + } |
359 | 366 | return $link; |
360 | 367 | } |
361 | 368 | |
— | — | @@ -366,7 +373,7 @@ |
367 | 374 | */ |
368 | 375 | function curLink( $rev, $latest ) { |
369 | 376 | $cur = $this->message['cur']; |
370 | | - if( $latest || $rev->isDeleted( Revision::DELETED_TEXT ) ) { |
| 377 | + if( $latest || !$rev->userCan( Revision::DELETED_TEXT ) ) { |
371 | 378 | return $cur; |
372 | 379 | } else { |
373 | 380 | return $this->mSkin->makeKnownLinkObj( $this->mTitle, $cur, |
— | — | @@ -392,7 +399,7 @@ |
393 | 400 | # Next row probably exists but is unknown, use an oldid=prev link |
394 | 401 | return $this->mSkin->makeKnownLinkObj( $this->mTitle, $last, |
395 | 402 | "diff=" . $prevRev->getId() . "&oldid=prev" ); |
396 | | - } elseif( $prevRev->isDeleted(Revision::DELETED_TEXT) || $nextRev->isDeleted(Revision::DELETED_TEXT) ) { |
| 403 | + } elseif( !$prevRev->userCan(Revision::DELETED_TEXT) || !$nextRev->userCan(Revision::DELETED_TEXT) ) { |
397 | 404 | return $last; |
398 | 405 | } else { |
399 | 406 | return $this->mSkin->makeKnownLinkObj( $this->mTitle, $last, |
— | — | @@ -419,7 +426,7 @@ |
420 | 427 | $checkmark = array( 'checked' => 'checked' ); |
421 | 428 | } else { |
422 | 429 | # Check visibility of old revisions |
423 | | - if( $rev->isDeleted( Revision::DELETED_TEXT ) ) { |
| 430 | + if( !$rev->userCan( Revision::DELETED_TEXT ) ) { |
424 | 431 | $radio['disabled'] = 'disabled'; |
425 | 432 | $checkmark = array(); // We will check the next possible one |
426 | 433 | } else if( $counter == 2 || !$this->mOldIdChecked ) { |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1294,6 +1294,9 @@ |
1295 | 1295 | 'rev-deleted-event' => '(log action removed)', |
1296 | 1296 | 'rev-deleted-text-permission' => "This page revision has been '''removed from the public archives'''. |
1297 | 1297 | There may be details in the [{{fullurl:Special:Log/delete|page={{FULLPAGENAMEE}}}} deletion log].", |
| 1298 | +'rev-deleted-text-unhide' => "This page revision has been '''removed from the public archives'''. |
| 1299 | +There may be details in the [{{fullurl:Special:Log/delete|page={{FULLPAGENAMEE}}}} deletion log]. |
| 1300 | +As an administrator you can still [$1 view this revision] if you wish to proceed.", |
1298 | 1301 | 'rev-deleted-text-view' => "This page revision has been '''removed from the public archives'''. |
1299 | 1302 | As an administrator you can view it; there may be details in the [{{fullurl:Special:Log/delete|page={{FULLPAGENAMEE}}}} deletion log].", |
1300 | 1303 | 'rev-deleted-no-diff' => "You cannot view this diff because one of the revisions has been '''removed from the public archives'''. |