r49791 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49790‎ | r49791 | r49792 >
Date:01:53, 24 April 2009
Author:werdna
Status:ok
Tags:
Comment:
(bug 18423) Add link to filtered abuse log on Contributions. Patch by Simon Walker, with minor fixes for double-escaping and wikitext in messages.
Modified paths:
  • /trunk/extensions/AbuseFilter/AbuseFilter.hooks.php (modified) (history)
  • /trunk/extensions/AbuseFilter/AbuseFilter.i18n.php (modified) (history)
  • /trunk/extensions/AbuseFilter/AbuseFilter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/AbuseFilter.php
@@ -67,6 +67,7 @@
6868 $wgHooks['RecentChange_save'][] = 'AbuseFilterHooks::onRecentChangeSave';
6969 $wgHooks['ListDefinedTags'][] = 'AbuseFilterHooks::onListDefinedTags';
7070 $wgHooks['LoadExtensionSchemaUpdates'][] = 'AbuseFilterHooks::onLoadExtensionSchemaUpdates';
 71+$wgHooks['ContributionsToolLinks'][] = 'AbuseFilterHooks::onContributionsToolLinks';
7172
7273 $wgAvailableRights[] = 'abusefilter-modify';
7374 $wgAvailableRights[] = 'abusefilter-log-detail';
Index: trunk/extensions/AbuseFilter/AbuseFilter.i18n.php
@@ -95,7 +95,8 @@
9696 'abusefilter-log-details-ip' => 'Originating IP address',
9797 'abusefilter-log-noactions' => 'none',
9898 'abusefilter-log-details-diff' => 'Changes made in edit',
99 -
 99+ 'abusefilter-log-linkoncontribs' => 'abuse log',
 100+ 'abusefilter-log-linkoncontribs-text' => 'Abuse Log for this user',
100101 // Abuse filter management
101102 'abusefilter-management' => 'Abuse filter management',
102103 'abusefilter-list' => 'All filters',
Index: trunk/extensions/AbuseFilter/AbuseFilter.hooks.php
@@ -181,4 +181,21 @@
182182 }
183183 return true;
184184 }
 185+
 186+ public static function onContributionsToolLinks( $id, $nt, &$tools )
 187+ {
 188+ global $wgUser;
 189+ wfLoadExtensionMessages( 'AbuseFilter' );
 190+ if( $wgUser->isAllowed( 'abusefilter-log' ) ) {
 191+ $sk = $wgUser->getSkin();
 192+ $tools[] = $sk->link(
 193+ SpecialPage::getTitleFor( 'AbuseLog' ),
 194+ wfMsg( 'abusefilter-log-linkoncontribs' ),
 195+ array( 'title' =>
 196+ wfMsgExt( 'abusefilter-log-linkoncontribs-text', 'parseinline' ) ),
 197+ array( 'wpSearchUser' => $nt->getText() )
 198+ );
 199+ }
 200+ return true;
 201+ }
185202 }

Status & tagging log