Index: trunk/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -622,20 +622,20 @@ |
623 | 623 | } |
624 | 624 | |
625 | 625 | // Don't show useless link to people who cannot hide revisions |
626 | | - if( $wgUser->isAllowed('deleterevision') || ($rev->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) { |
627 | | - // If revision was hidden from sysops |
| 626 | + $canHide = $wgUser->isAllowed( 'deleterevision' ); |
| 627 | + if( $canHide || ($rev->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) { |
628 | 628 | if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { |
629 | | - $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), |
630 | | - wfMsg( 'parentheses', $this->messages['rev-delundel'] ) ) . ' '; |
631 | | - // Otherwise, show the link... |
| 629 | + $del = $this->mSkin->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops |
632 | 630 | } else { |
633 | 631 | $query = array( |
634 | | - 'type' => 'revision', |
| 632 | + 'type' => 'revision', |
635 | 633 | 'target' => $page->getPrefixedDbkey(), |
636 | | - 'ids' => $rev->getId() ); |
| 634 | + 'ids' => $rev->getId() |
| 635 | + ); |
637 | 636 | $del = $this->mSkin->revDeleteLink( $query, |
638 | | - $rev->isDeleted( Revision::DELETED_RESTRICTED ) ) . ' '; |
| 637 | + $rev->isDeleted( Revision::DELETED_RESTRICTED ), $canHide ); |
639 | 638 | } |
| 639 | + $del .= ' '; |
640 | 640 | } else { |
641 | 641 | $del = ''; |
642 | 642 | } |
Index: trunk/phase3/includes/specials/SpecialDeletedContributions.php |
— | — | @@ -190,20 +190,18 @@ |
191 | 191 | $mflag = ''; |
192 | 192 | } |
193 | 193 | |
194 | | - // Don't show useless link to people who cannot hide revisions |
195 | | - if( $wgUser->isAllowed('deleterevision') || ($rev->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) { |
196 | | - // If revision was hidden from sysops |
| 194 | + // Revision delete link |
| 195 | + $canHide = $wgUser->isAllowed( 'deleterevision' ); |
| 196 | + if( $canHide || ($rev->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) { |
197 | 197 | if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { |
198 | | - $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), |
199 | | - '(' . $this->message['rev-delundel'] . ')' ) . ' '; |
200 | | - // Otherwise, show the link... |
| 198 | + $del = $this->mSkin->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops |
201 | 199 | } else { |
202 | 200 | $query = array( |
203 | 201 | 'type' => 'archive', |
204 | 202 | 'target' => $page->getPrefixedDbkey(), |
205 | 203 | 'ids' => $rev->getTimestamp() ); |
206 | 204 | $del = $this->mSkin->revDeleteLink( $query, |
207 | | - $rev->isDeleted( Revision::DELETED_RESTRICTED ) ) . ' '; |
| 205 | + $rev->isDeleted( Revision::DELETED_RESTRICTED ), $canHide ) . ' '; |
208 | 206 | } |
209 | 207 | } else { |
210 | 208 | $del = ''; |
Index: trunk/phase3/includes/specials/SpecialUndelete.php |
— | — | @@ -783,25 +783,25 @@ |
784 | 784 | } else { |
785 | 785 | $openDiv = '<div id="mw-undelete-revision">'; |
786 | 786 | } |
787 | | - |
788 | | - $revdlink = ''; |
789 | | - // Diffs already have revision delete links |
790 | | - if( !$this->mDiff && $wgUser->isAllowed( 'deletedhistory' ) ) { |
791 | | - // Don't show useless link to people who cannot hide revisions |
792 | | - if( !$rev->getVisibility() && !$wgUser->isAllowed( 'deleterevision' ) ) { |
793 | | - $revdlink = ''; |
794 | | - // If revision was hidden from sysops |
795 | | - } else if( !$rev->userCan(Revision::DELETED_RESTRICTED ) ) { |
796 | | - $revdlink = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), |
797 | | - '('.wfMsgHtml('rev-delundel').')' ); |
| 787 | + |
| 788 | + // Revision delete links |
| 789 | + $canHide = $wgUser->isAllowed( 'deleterevision' ); |
| 790 | + if( $this->mDiff ) { |
| 791 | + $revdlink = ''; // diffs already have revision delete links |
| 792 | + } else if( $canHide || ($rev->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) { |
| 793 | + if( !$rev->userCan(Revision::DELETED_RESTRICTED ) ) { |
| 794 | + $revdlink = $skin->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops |
798 | 795 | } else { |
799 | 796 | $query = array( |
800 | 797 | 'type' => 'archive', |
801 | 798 | 'target' => $this->mTargetObj->getPrefixedDBkey(), |
802 | 799 | 'ids' => $rev->getTimestamp() |
803 | 800 | ); |
804 | | - $revdlink = $skin->revDeleteLink( $query, $rev->isDeleted( File::DELETED_RESTRICTED ) ); |
| 801 | + $revdlink = $skin->revDeleteLink( $query, |
| 802 | + $rev->isDeleted( File::DELETED_RESTRICTED ), $canHide ); |
805 | 803 | } |
| 804 | + } else { |
| 805 | + $revdlink = ''; |
806 | 806 | } |
807 | 807 | |
808 | 808 | $wgOut->addHTML( $openDiv . $revdlink . wfMsgWikiHtml( 'undelete-revision', $link, $time, $user, $d, $t ) . '</div>' ); |
— | — | @@ -899,20 +899,20 @@ |
900 | 900 | $targetPage = $rev->getTitle(); |
901 | 901 | $targetQuery = array( 'oldid' => $rev->getId() ); |
902 | 902 | } |
903 | | - // Add show/hide link if available. Don't show useless link to people who cannot hide revisions. |
904 | | - if( $wgUser->isAllowed('deleterevision') || ($rev->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) { |
905 | | - // If revision was hidden from sysops |
| 903 | + // Add show/hide deletion links if available |
| 904 | + $canHide = $wgUser->isAllowed( 'deleterevision' ); |
| 905 | + if( $canHide || ($rev->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) { |
| 906 | + $del = ' '; |
906 | 907 | if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { |
907 | | - $del = ' ' . Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), |
908 | | - '(' . wfMsgHtml('rev-delundel') . ')' ); |
909 | | - // Otherwise, show the link... |
| 908 | + $del .= $sk->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops |
910 | 909 | } else { |
911 | 910 | $query = array( |
912 | | - 'type' => 'archive', |
| 911 | + 'type' => 'archive', |
913 | 912 | 'target' => $this->mTargetObj->getPrefixedDbkey(), |
914 | | - 'ids' => $rev->getTimestamp() ); |
915 | | - $del = ' ' . $sk->revDeleteLink( $query, |
916 | | - $rev->isDeleted( Revision::DELETED_RESTRICTED ) ); |
| 913 | + 'ids' => $rev->getTimestamp() |
| 914 | + ); |
| 915 | + $del .= $sk->revDeleteLink( $query, |
| 916 | + $rev->isDeleted( Revision::DELETED_RESTRICTED ), $canHide ); |
917 | 917 | } |
918 | 918 | } else { |
919 | 919 | $del = ''; |
— | — | @@ -1200,19 +1200,19 @@ |
1201 | 1201 | } |
1202 | 1202 | // Edit summary |
1203 | 1203 | $comment = $sk->revComment( $rev ); |
1204 | | - // Show/hide link. // Don't show useless link to people who cannot hide revisions. |
1205 | | - if( $wgUser->isAllowed('deleterevision') || ($rev->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) { |
| 1204 | + // Revision delete links |
| 1205 | + $canHide = $wgUser->isAllowed( 'deleterevision' ); |
| 1206 | + if( $canHide || ($rev->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) { |
1206 | 1207 | if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { |
1207 | | - // If revision was hidden from sysops |
1208 | | - $revdlink = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), |
1209 | | - '('.wfMsgHtml('rev-delundel').')' ); |
| 1208 | + $revdlink = $sk->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops |
1210 | 1209 | } else { |
1211 | 1210 | $query = array( |
1212 | | - 'type' => 'archive', |
| 1211 | + 'type' => 'archive', |
1213 | 1212 | 'target' => $this->mTargetObj->getPrefixedDBkey(), |
1214 | | - 'ids' => $ts |
| 1213 | + 'ids' => $ts |
1215 | 1214 | ); |
1216 | | - $revdlink = $sk->revDeleteLink( $query, $rev->isDeleted( Revision::DELETED_RESTRICTED ) ); |
| 1215 | + $revdlink = $sk->revDeleteLink( $query, |
| 1216 | + $rev->isDeleted( Revision::DELETED_RESTRICTED ), $canHide ); |
1217 | 1217 | } |
1218 | 1218 | } else { |
1219 | 1219 | $revdlink = ''; |
— | — | @@ -1246,20 +1246,22 @@ |
1247 | 1247 | ')'; |
1248 | 1248 | $data = htmlspecialchars( $data ); |
1249 | 1249 | $comment = $this->getFileComment( $file, $sk ); |
1250 | | - $revdlink = ''; |
1251 | | - // Add show/hide link if available. Don't show useless link to people who cannot hide revisions. |
1252 | | - if( $wgUser->isAllowed('deleterevision') || ($file->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) { |
| 1250 | + // Add show/hide deletion links if available |
| 1251 | + $canHide = $wgUser->isAllowed( 'deleterevision' ); |
| 1252 | + if( $canHide || ($file->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) { |
1253 | 1253 | if( !$file->userCan(File::DELETED_RESTRICTED ) ) { |
1254 | | - // If revision was hidden from sysops |
1255 | | - $revdlink = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), '('.wfMsgHtml('rev-delundel').')' ); |
| 1254 | + $revdlink = $sk->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops |
1256 | 1255 | } else { |
1257 | 1256 | $query = array( |
1258 | 1257 | 'type' => 'filearchive', |
1259 | 1258 | 'target' => $this->mTargetObj->getPrefixedDBkey(), |
1260 | 1259 | 'ids' => $row->fa_id |
1261 | 1260 | ); |
1262 | | - $revdlink = $sk->revDeleteLink( $query, $file->isDeleted( File::DELETED_RESTRICTED ) ); |
| 1261 | + $revdlink = $sk->revDeleteLink( $query, |
| 1262 | + $file->isDeleted( File::DELETED_RESTRICTED ), $canHide ); |
1263 | 1263 | } |
| 1264 | + } else { |
| 1265 | + $revdlink = ''; |
1264 | 1266 | } |
1265 | 1267 | return "<li>$checkBox $revdlink $pageLink . . $userLink $data $comment</li>\n"; |
1266 | 1268 | } |
Index: trunk/phase3/includes/HistoryPage.php |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | function preCacheMessages() { |
52 | 52 | // Precache various messages |
53 | 53 | if( !isset( $this->message ) ) { |
54 | | - $msgs = array( 'cur', 'last', 'rev-delundel', 'pipe-separator' ); |
| 54 | + $msgs = array( 'cur', 'last', 'pipe-separator' ); |
55 | 55 | foreach( $msgs as $msg ) { |
56 | 56 | $this->message[$msg] = wfMsgExt( $msg, array( 'escapenoentities') ); |
57 | 57 | } |
— | — | @@ -472,6 +472,7 @@ |
473 | 473 | $classes = array(); |
474 | 474 | |
475 | 475 | $del = ''; |
| 476 | + // User can delete revisions... |
476 | 477 | if( $wgUser->isAllowed( 'deleterevision' ) ) { |
477 | 478 | // If revision was hidden from sysops, disable the checkbox |
478 | 479 | if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { |
— | — | @@ -484,13 +485,13 @@ |
485 | 486 | } else if( $rev->getVisibility() && $wgUser->isAllowed( 'deletedhistory' ) ) { |
486 | 487 | // If revision was hidden from sysops, disable the link |
487 | 488 | if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { |
488 | | - $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), |
489 | | - '(' . $this->historyPage->message['rev-delundel'] . ')' ); |
| 489 | + $cdel = $this->getSkin()->revDeleteLinkDisabled( false ); |
490 | 490 | // Otherwise, show the link... |
491 | 491 | } else { |
492 | 492 | $query = array( 'type' => 'revision', |
493 | 493 | 'target' => $this->title->getPrefixedDbkey(), 'ids' => $rev->getId() ); |
494 | | - $del .= $this->getSkin()->revDeleteLink( $query, $rev->isDeleted( Revision::DELETED_RESTRICTED ) ); |
| 494 | + $del .= $this->getSkin()->revDeleteLink( $query, |
| 495 | + $rev->isDeleted( Revision::DELETED_RESTRICTED ), false ); |
495 | 496 | } |
496 | 497 | } |
497 | 498 | if( $del ) $s .= " $del "; |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -3369,6 +3369,8 @@ |
3370 | 3370 | return; |
3371 | 3371 | } |
3372 | 3372 | |
| 3373 | + $unhide = $wgRequest->getInt('unhide') == 1 && |
| 3374 | + $wgUser->matchEditToken( $wgRequest->getVal('token'), $oldid ); |
3373 | 3375 | # Cascade unhide param in links for easy deletion browsing |
3374 | 3376 | $extraParams = array(); |
3375 | 3377 | if( $wgRequest->getVal('unhide') ) { |
— | — | @@ -3452,23 +3454,24 @@ |
3453 | 3455 | array( 'known', 'noclasses' ) |
3454 | 3456 | ); |
3455 | 3457 | |
3456 | | - $cdel=''; |
3457 | | - // Don't show useless link to people who cannot hide revisions |
3458 | | - if( $wgUser->isAllowed('deleterevision') || ($revision->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) { |
| 3458 | + $cdel = ''; |
| 3459 | + // User can delete revisions or view deleted revisions... |
| 3460 | + $canHide = $wgUser->isAllowed('deleterevision'); |
| 3461 | + if( $canHide || ($revision->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) { |
| 3462 | + // Is this hidden from Sysops? |
3459 | 3463 | if( !$revision->userCan( Revision::DELETED_RESTRICTED ) ) { |
3460 | | - // If revision was hidden from sysops |
3461 | | - $cdel = wfMsgHtml( 'rev-delundel' ); |
| 3464 | + $cdel = $sk->revDeleteLinkDisabled( $canHide ); |
3462 | 3465 | } else { |
3463 | 3466 | $query = array( |
3464 | 3467 | 'type' => 'revision', |
3465 | 3468 | 'target' => urlencode( $this->mTitle->getPrefixedDbkey() ), |
3466 | 3469 | 'ids' => urlencode( $oldid ) |
3467 | 3470 | ); |
3468 | | - $cdel = $sk->revDeleteLink( $query, $revision->isDeleted(File::DELETED_RESTRICTED) ); |
| 3471 | + $cdel = $sk->revDeleteLink( $query, $revision->isDeleted(File::DELETED_RESTRICTED), $canHide ); |
3469 | 3472 | } |
3470 | 3473 | $cdel .= ' '; |
3471 | 3474 | } |
3472 | | - $unhide = $wgRequest->getInt('unhide') == 1 && $wgUser->matchEditToken( $wgRequest->getVal('token'), $oldid ); |
| 3475 | + |
3473 | 3476 | # Show user links if allowed to see them. If hidden, then show them only if requested... |
3474 | 3477 | $userlinks = $sk->revUserTools( $revision, !$unhide ); |
3475 | 3478 | |
Index: trunk/phase3/includes/LogEventsList.php |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | // Precache various messages |
41 | 41 | if( !isset( $this->message ) ) { |
42 | 42 | $messages = array( 'revertmerge', 'protect_change', 'unblocklink', 'change-blocklink', |
43 | | - 'revertmove', 'undeletelink', 'undeleteviewlink', 'revdel-restore', 'rev-delundel', 'hist', 'diff', |
| 43 | + 'revertmove', 'undeletelink', 'undeleteviewlink', 'revdel-restore', 'hist', 'diff', |
44 | 44 | 'pipe-separator' ); |
45 | 45 | foreach( $messages as $msg ) { |
46 | 46 | $this->message[$msg] = wfMsgExt( $msg, array( 'escapenoentities' ) ); |
— | — | @@ -507,22 +507,24 @@ |
508 | 508 | * @return string |
509 | 509 | */ |
510 | 510 | private function getShowHideLinks( $row ) { |
| 511 | + global $wgUser; |
| 512 | + if( $row->log_type == 'suppress' ) { |
| 513 | + return ''; // No one can hide items from the oversight log |
| 514 | + } |
| 515 | + $canHide = $wgUser->isAllowed( 'deleterevision' ); |
511 | 516 | // If event was hidden from sysops |
512 | 517 | if( !self::userCan( $row, LogPage::DELETED_RESTRICTED ) ) { |
513 | | - $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), |
514 | | - '(' . $this->message['rev-delundel'] . ')' ); |
515 | | - } else if( $row->log_type == 'suppress' ) { |
516 | | - $del = ''; // No one should be hiding from the oversight log |
| 518 | + $del = $this->skin->revDeleteLinkDisabled( $canHide ); |
517 | 519 | } else { |
518 | 520 | $target = SpecialPage::getTitleFor( 'Log', $row->log_type ); |
519 | 521 | $page = Title::makeTitle( $row->log_namespace, $row->log_title ); |
520 | 522 | $query = array( |
521 | 523 | 'target' => $target->getPrefixedDBkey(), |
522 | | - 'type' => 'logging', |
523 | | - 'ids' => $row->log_id, |
| 524 | + 'type' => 'logging', |
| 525 | + 'ids' => $row->log_id, |
524 | 526 | ); |
525 | 527 | $del = $this->skin->revDeleteLink( $query, |
526 | | - self::isDeleted( $row, LogPage::DELETED_RESTRICTED ) ); |
| 528 | + self::isDeleted( $row, LogPage::DELETED_RESTRICTED ), $canHide ); |
527 | 529 | } |
528 | 530 | return $del; |
529 | 531 | } |
Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -861,21 +861,23 @@ |
862 | 862 | ); |
863 | 863 | } |
864 | 864 | # Link to hide content. Don't show useless link to people who cannot hide revisions. |
865 | | - if( $wgUser->isAllowed('deleterevision') || ($wgUser->isAllowed('deletedhistory') && $file->getVisibility()) ) { |
| 865 | + $canHide = $wgUser->isAllowed( 'deleterevision' ); |
| 866 | + if( $canHide || ($wgUser->isAllowed('deletedhistory') && $file->getVisibility()) ) { |
866 | 867 | if( $wgUser->isAllowed('delete') ) { |
867 | 868 | $row .= '<br/>'; |
868 | 869 | } |
869 | 870 | // If file is top revision or locked from this user, don't link |
870 | 871 | if( $iscur || !$file->userCan(File::DELETED_RESTRICTED) ) { |
871 | | - $del = wfMsgHtml( 'rev-delundel' ); |
| 872 | + $del = $this->skin->revDeleteLinkDisabled( $canHide ); |
872 | 873 | } else { |
873 | 874 | list( $ts, $name ) = explode( '!', $img, 2 ); |
874 | 875 | $query = array( |
875 | | - 'type' => 'oldimage', |
| 876 | + 'type' => 'oldimage', |
876 | 877 | 'target' => $wgTitle->getPrefixedText(), |
877 | | - 'ids' => $ts, |
| 878 | + 'ids' => $ts, |
878 | 879 | ); |
879 | | - $del = $this->skin->revDeleteLink( $query, $file->isDeleted(File::DELETED_RESTRICTED) ); |
| 880 | + $del = $this->skin->revDeleteLink( $query, |
| 881 | + $file->isDeleted(File::DELETED_RESTRICTED), $canHide ); |
880 | 882 | } |
881 | 883 | $row .= $del; |
882 | 884 | } |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -1636,17 +1636,31 @@ |
1637 | 1637 | * |
1638 | 1638 | * @param array $query Query parameters to be passed to link() |
1639 | 1639 | * @param bool $restricted Set to true to use a <strong> instead of a <span> |
| 1640 | + * @param bool $delete Set to true to use (show/hide) rather than (show) |
1640 | 1641 | * |
1641 | 1642 | * @return string HTML <a> link to Special:Revisiondelete, wrapped in a |
1642 | 1643 | * span to allow for customization of appearance with CSS |
1643 | 1644 | */ |
1644 | | - public function revDeleteLink( $query = array(), $restricted = false ) { |
| 1645 | + public function revDeleteLink( $query = array(), $restricted = false, $delete = true ) { |
1645 | 1646 | $sp = SpecialPage::getTitleFor( 'Revisiondelete' ); |
1646 | | - $text = wfMsgHtml( 'rev-delundel' ); |
| 1647 | + $text = $delete ? wfMsgHtml( 'rev-delundel' ) : wfMsgHtml( 'rev-showdeleted' ); |
1647 | 1648 | $tag = $restricted ? 'strong' : 'span'; |
1648 | 1649 | $link = $this->link( $sp, $text, array(), $query, array( 'known', 'noclasses' ) ); |
1649 | 1650 | return Xml::tags( $tag, array( 'class' => 'mw-revdelundel-link' ), "($link)" ); |
1650 | 1651 | } |
| 1652 | + |
| 1653 | + /** |
| 1654 | + * Creates a dead (show/hide) link for deleting revisions/log entries |
| 1655 | + * |
| 1656 | + * @param bool $delete Set to true to use (show/hide) rather than (show) |
| 1657 | + * |
| 1658 | + * @return string HTML text wrapped in a span to allow for customization |
| 1659 | + * of appearance with CSS |
| 1660 | + */ |
| 1661 | + public function revDeleteLinkDisabled( $delete = true ) { |
| 1662 | + $text = $delete ? wfMsgHtml( 'rev-delundel' ) : wfMsgHtml( 'rev-showdeleted' ); |
| 1663 | + return Xml::tags( 'span', array( 'class' => 'mw-revdelundel-link' ), "($text)" ); |
| 1664 | + } |
1651 | 1665 | |
1652 | 1666 | /* Deprecated methods */ |
1653 | 1667 | |
Index: trunk/phase3/includes/diff/DifferenceInterface.php |
— | — | @@ -315,34 +315,34 @@ |
316 | 316 | $rdel = ''; $ldel = ''; |
317 | 317 | # Handle RevisionDelete links... |
318 | 318 | if( $wgUser->isAllowed( 'deletedhistory' ) ) { |
| 319 | + $canHide = $wgUser->isAllowed( 'deleterevision' ); |
319 | 320 | // Don't show useless link to people who cannot hide revisions |
320 | | - if( $this->mOldRev->getVisibility() || $wgUser->isAllowed( 'deleterevision' ) ) { |
| 321 | + if( $canHide || $this->mOldRev->getVisibility() ) { |
321 | 322 | if( !$this->mOldRev->userCan( Revision::DELETED_RESTRICTED ) ) { |
322 | | - // If revision was hidden from sysops |
323 | | - $ldel = Xml::tags( 'span', array( 'class' => 'mw-revdelundel-link' ), |
324 | | - '(' . wfMsgHtml( 'rev-delundel' ) . ')' ); |
| 323 | + $ldel = $sk->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops |
325 | 324 | } else { |
326 | 325 | $query = array( |
327 | 326 | 'type' => 'revision', |
328 | 327 | 'target' => $this->mOldRev->mTitle->getPrefixedDbkey(), |
329 | 328 | 'ids' => $this->mOldRev->getId() |
330 | 329 | ); |
331 | | - $ldel = $sk->revDeleteLink( $query, $this->mOldRev->isDeleted( Revision::DELETED_RESTRICTED ) ); |
| 330 | + $ldel = $sk->revDeleteLink( $query, |
| 331 | + $this->mOldRev->isDeleted( Revision::DELETED_RESTRICTED ), $canHide ); |
332 | 332 | } |
333 | 333 | $ldel = " $ldel "; |
334 | 334 | } |
335 | 335 | // Don't show useless link to people who cannot hide revisions |
336 | 336 | if( $this->mNewRev->getVisibility() || $wgUser->isAllowed( 'deleterevision' ) ) { |
337 | 337 | if( !$this->mNewRev->userCan( Revision::DELETED_RESTRICTED ) ) { |
338 | | - // If revision was hidden from sysops |
339 | | - $rdel = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ), '('.wfMsgHtml( 'rev-delundel' ).')' ); |
| 338 | + $rdel = $sk->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops |
340 | 339 | } else { |
341 | 340 | $query = array( |
342 | 341 | 'type' => 'revision', |
343 | 342 | 'target' => $this->mNewRev->mTitle->getPrefixedDbkey(), |
344 | 343 | 'ids' => $this->mNewRev->getId() |
345 | 344 | ); |
346 | | - $rdel = $sk->revDeleteLink( $query, $this->mNewRev->isDeleted( Revision::DELETED_RESTRICTED ) ); |
| 345 | + $rdel = $sk->revDeleteLink( $query, |
| 346 | + $this->mNewRev->isDeleted( Revision::DELETED_RESTRICTED ), $canHide ); |
347 | 347 | } |
348 | 348 | $rdel = " $rdel "; |
349 | 349 | } |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1450,6 +1450,7 @@ |
1451 | 1451 | 'rev-suppressed-diff-view' => "One of the revisions of this diff has been '''suppressed'''. |
1452 | 1452 | As an administrator you can view this diff; there may be details in the [{{fullurl:{{#Special:Log}}/suppress|page={{FULLPAGENAMEE}}}} suppression log].", |
1453 | 1453 | 'rev-delundel' => 'show/hide', |
| 1454 | +'rev-showdeleted' => 'show', |
1454 | 1455 | 'revisiondelete' => 'Delete/undelete revisions', |
1455 | 1456 | 'revdelete-nooldid-title' => 'Invalid target revision', |
1456 | 1457 | 'revdelete-nooldid-text' => 'You have either not specified a target revision(s) to perform this |
Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -669,6 +669,7 @@ |
670 | 670 | 'rev-deleted-diff-view', |
671 | 671 | 'rev-suppressed-diff-view', |
672 | 672 | 'rev-delundel', |
| 673 | + 'rev-showdeleted', |
673 | 674 | 'revisiondelete', |
674 | 675 | 'revdelete-nooldid-title', |
675 | 676 | 'revdelete-nooldid-text', |