Index: trunk/extensions/DeletedContributions/SpecialDeletedContributions.php |
— | — | @@ -15,6 +15,25 @@ |
16 | 16 | # Internationalisation |
17 | 17 | $wgExtensionFunctions[] = 'efLoadDeletedContribsMessages'; |
18 | 18 | |
| 19 | +global $wgHooks; |
| 20 | +$wgHooks['SpecialContribsSubEnd'][] = 'wfLoadContribsLink'; |
| 21 | + |
| 22 | +/** |
| 23 | + * Add a "Deleted contributions" link to Special:Contributions for sysops. |
| 24 | + */ |
| 25 | +function wfLoadContribsLink( $nt, &$links ) { |
| 26 | + global $wgUser; |
| 27 | + |
| 28 | + # Only sysops (or those who can see deleted contribs) need the link. |
| 29 | + if ( !$wgUser->isAllowed( 'deletedhistory' ) ) return true; |
| 30 | + |
| 31 | + $sk = $wgUser->getSkin(); |
| 32 | + |
| 33 | + $links[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'DeletedContributions'), |
| 34 | + wfMsg('deletedcontributions'), 'target=' . $nt->getPartialURL() ); |
| 35 | + return true; |
| 36 | +} |
| 37 | + |
19 | 38 | function efLoadDeletedContribsMessages() { |
20 | 39 | global $wgMessageCache, $wgDeletedContribsMessages; |
21 | 40 | # Internationalization |