From 48fe5241a539e1d5afcc75a40a9d23f53d092ed4 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Tue, 27 Oct 2009 14:08:02 +0000 Subject: [PATCH] New hook getOtherBlockLogLink, called in Special:IPBlockList to show links to block logs of other blocking extensions, i.e. GlobalBlocking --- RELEASE-NOTES | 2 ++ docs/hooks.txt | 5 +++++ includes/specials/SpecialIpblocklist.php | 14 ++++++++++++++ languages/messages/MessagesEn.php | 1 + maintenance/language/messages.inc | 1 + 5 files changed, 23 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e9dcc56a54..aac8533b6c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -263,6 +263,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN contains the number of revisions in the history * $wgStylePath and $wgLogo are now set in the default LocalSettings.php file. * (bug 20186) Allow filtering history for revision deletion. +* New hook getOtherBlockLogLink, called in Special:IPBlockList to show links + to block logs of other blocking extensions, i.e. GlobalBlocking === Bug fixes in 1.16 === diff --git a/docs/hooks.txt b/docs/hooks.txt index ca3cda4d2d..238a35b97a 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -782,6 +782,11 @@ $title: Title object of page $url: string value as output (out parameter, can modify) $query: query options passed to Title::getLocalURL() +'getOtherBlockLogLink': Get links to the block log from extensions which blocks + users and/or IP addresses too +$otherBlockLink: An array with links to other block logs +$$this->ip: The requested IP address or username + 'GetPreferences': modify user preferences $user: User whose preferences are being modified. &$preferences: Preferences description array, to be fed to an HTMLForm object diff --git a/includes/specials/SpecialIpblocklist.php b/includes/specials/SpecialIpblocklist.php index c81ae49eea..010375a011 100644 --- a/includes/specials/SpecialIpblocklist.php +++ b/includes/specials/SpecialIpblocklist.php @@ -311,6 +311,20 @@ class IPUnblockForm { $wgOut->addHTML( $this->searchForm() ); $wgOut->addWikiMsg( 'ipblocklist-empty' ); } + + $otherBlockLink = array(); + wfRunHooks( 'getOtherBlockLogLink', array( &$otherBlockLink, $this->ip ) ); + if( count( $otherBlockLink ) ) { + $wgOut->addHTML( + Html::rawElement( 'h2', array(), wfMsg( 'ipblocklist-otherblocks' ) ) . "\n" + ); + $list = ''; + foreach( $otherBlockLink as $link ) { + $list .= Html::rawElement( 'li', array(), $link ) . "\n"; + } + $wgOut->addHTML( Html::rawElement( 'ul', array( 'class' => 'mw-ipblocklist-otherblocks' ), $list ) . "\n" ); + } + } function searchForm() { diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 2b1933cad2..b3eaebb3f8 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2953,6 +2953,7 @@ See [[Special:IPBlockList|IP block list]] to review blocks.', 'ipblocklist-sh-addressblocks' => '$1 single IP blocks', 'ipblocklist-summary' => '', # do not translate or duplicate this message to other languages 'ipblocklist-submit' => 'Search', +'ipblocklist-otherblocks' => 'Other blocks', 'blocklistline' => '$1, $2 blocked $3 ($4)', 'infiniteblock' => 'infinite', 'expiringblock' => 'expires on $1 at $2', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index f6d7536bca..9dbaefdb3d 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1988,6 +1988,7 @@ $wgMessageStructure = array( 'ipblocklist-sh-addressblocks', 'ipblocklist-summary', 'ipblocklist-submit', + 'ipblocklist-otherblocks', 'blocklistline', 'infiniteblock', 'expiringblock', -- 2.20.1