Index: trunk/extensions/regexBlock/regexBlockCore.php |
— | — | @@ -625,4 +625,22 @@ |
626 | 626 | |
627 | 627 | wfProfileOut( __METHOD__ ); |
628 | 628 | } |
| 629 | + |
| 630 | + /** |
| 631 | + * Add a link to Special:RegexBlock from Special:Contributions/USERNAME |
| 632 | + * pages if the user has 'regexblock' permission |
| 633 | + * @return true |
| 634 | + */ |
| 635 | + public static function loadContribsLink( $id, $nt, &$links ){ |
| 636 | + global $wgUser; |
| 637 | + if( $wgUser->isAllowed( 'regexblock' ) ) { |
| 638 | + wfLoadExtensionMessages( 'RegexBlock' ); |
| 639 | + $links[] = $wgUser->getSkin()->makeKnownLinkObj( |
| 640 | + SpecialPage::getTitleFor( 'RegexBlock' ), |
| 641 | + wfMsgHtml( 'regexblock' ), |
| 642 | + '&ip=' . urlencode( $nt->getText() ) ); |
| 643 | + } |
| 644 | + return true; |
| 645 | + } |
| 646 | + |
629 | 647 | } |
\ No newline at end of file |
Index: trunk/extensions/regexBlock/regexBlock.php |
— | — | @@ -57,7 +57,8 @@ |
58 | 58 | 'descriptionmsg' => 'regexblock-desc', |
59 | 59 | ); |
60 | 60 | |
61 | | -// add hook |
| 61 | +// Hooked functions |
| 62 | +$wgHooks['ContributionsToolLinks'][] = 'RegexBlock::loadContribsLink'; |
62 | 63 | $wgHooks['GetBlockedStatus'][] = 'RegexBlock::check'; |
63 | 64 | |
64 | 65 | // Set up the new special page |