Index: trunk/extensions/Renameuser/Renameuser.i18n.php |
— | — | @@ -9,6 +9,8 @@ |
10 | 10 | |
11 | 11 | $messages['en'] = array( |
12 | 12 | 'renameuser' => 'Rename user', |
| 13 | + 'renameuser-linkoncontribs' => 'rename user', |
| 14 | + 'renameuser-linkoncontribs-text' => 'Rename this user', |
13 | 15 | 'renameuser-desc' => 'Adds a [[Special:Renameuser|special page]] to rename a user (need \'\'renameuser\'\' right)', |
14 | 16 | 'renameuser-summary' => '', # do not translate or duplicate this message to other languages |
15 | 17 | 'renameuserold' => 'Current username:', |
— | — | @@ -53,6 +55,8 @@ |
54 | 56 | * @author Siebrand |
55 | 57 | */ |
56 | 58 | $messages['qqq'] = array( |
| 59 | + 'renameuser-linkoncontribs' => 'Link description used on Special:Contributions and Special:DeletedContributions. Only added if a user has rights to rename users.', |
| 60 | + 'renameuser-linkoncontribs-text' => 'Tooltip for {{msg-mw|renameuser-linkoncontribs}}.', |
57 | 61 | 'renameuser-desc' => 'Short description of the Renameuser extension, shown on [[Special:Version]]. Do not translate or change links.', |
58 | 62 | 'renameuserreserve' => 'Option to block the old username (after it has been renamed) from being used again.', |
59 | 63 | 'renameuserwarnings' => '{{Identical|Warning}}', |
Index: trunk/extensions/Renameuser/Renameuser.php |
— | — | @@ -62,6 +62,7 @@ |
63 | 63 | $wgJobClasses['renameUser'] = 'RenameUserJob'; |
64 | 64 | |
65 | 65 | $wgHooks['ShowMissingArticle'][] = 'wfRenameUserShowLog'; |
| 66 | +$wgHooks['ContributionsToolLinks'][] = 'wfRenameuserOnContribsLink'; |
66 | 67 | |
67 | 68 | function wfRenameUserShowLog( $article ) { |
68 | 69 | global $wgOut; |
— | — | @@ -74,3 +75,18 @@ |
75 | 76 | } |
76 | 77 | return true; |
77 | 78 | } |
| 79 | + |
| 80 | +function wfRenameuserOnContribsLink( $id, $nt, &$tools ) { |
| 81 | + global $wgUser; |
| 82 | + |
| 83 | + if ( $wgUser->isAllowed( 'renameuser' ) ) { |
| 84 | + $sk = $wgUser->getSkin(); |
| 85 | + $tools[] = $sk->link( |
| 86 | + SpecialPage::getTitleFor( 'Renameuser' ), |
| 87 | + wfMsg( 'renameuser-linkoncontribs' ), |
| 88 | + array( 'title' => wfMsgExt( 'renameuser-linkoncontribs-text', 'parseinline' ) ), |
| 89 | + array( 'oldusername' => $nt->getText() ) |
| 90 | + ); |
| 91 | + } |
| 92 | + return true; |
| 93 | +} |