r24141 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24140‎ | r24141 | r24142 >
Date:01:12, 16 July 2007
Author:amidaniel
Status:old
Tags:
Comment:
Add a "Deleted Contributions" link to Special:Contributions for sysops.
Modified paths:
  • /trunk/extensions/DeletedContributions/SpecialDeletedContributions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DeletedContributions/SpecialDeletedContributions.php
@@ -15,6 +15,25 @@
1616 # Internationalisation
1717 $wgExtensionFunctions[] = 'efLoadDeletedContribsMessages';
1818
 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+
1938 function efLoadDeletedContribsMessages() {
2039 global $wgMessageCache, $wgDeletedContribsMessages;
2140 # Internationalization

Status & tagging log