r24160 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24159‎ | r24160 | r24161 >
Date:11:35, 16 July 2007
Author:robchurch
Status:old
Tags:
Comment:
Reflect renamed hook, and fix label escaping
Modified paths:
  • /trunk/extensions/DeletedContributions/SpecialDeletedContributions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DeletedContributions/SpecialDeletedContributions.php
@@ -2,7 +2,7 @@
33 /**
44 @ Extension based on SpecialContributions for arhived revisions
55 @ Modifications made to SpecialContributions.php
6 - @ copyright � 2007 Aaron Schulz
 6+ @ copyright 2007 Aaron Schulz
77 */
88
99 $wgExtensionCredits['specialpage'][] = array(
@@ -16,21 +16,20 @@
1717 $wgExtensionFunctions[] = 'efLoadDeletedContribsMessages';
1818
1919 global $wgHooks;
20 -$wgHooks['SpecialContribsSubEnd'][] = 'wfLoadContribsLink';
 20+$wgHooks['ContributionsToolLinks'][] = 'wfLoadContribsLink';
2121
2222 /**
2323 * Add a "Deleted contributions" link to Special:Contributions for sysops.
2424 */
25 -function wfLoadContribsLink( $nt, &$links ) {
 25+function wfLoadContribsLink( $id, $nt, &$links ) {
2626 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() );
 27+ if( $wgUser->isAllowed( 'deletedhistory' ) ) {
 28+ $links[] = $wgUser->getSkin()->makeKnownLinkObj(
 29+ SpecialPage::getTitleFor( 'DeletedContributions' ),
 30+ wfMsgHtml( 'deletedcontributions' ),
 31+ 'target=' . $nt->getPartialUrl()
 32+ );
 33+ }
3534 return true;
3635 }
3736

Status & tagging log