From: Kunal Mehta Date: Tue, 12 Nov 2013 23:30:04 +0000 (-0800) Subject: Add GetLogTypesOnUser hook X-Git-Tag: 1.31.0-rc.0~18175^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=9d5ce74eb8d86547edf250797bead9b36a1eab10;p=lhc%2Fweb%2Fwiklou.git Add GetLogTypesOnUser hook Allows extensions to modify the list at SpecialLog::$typeOnUser This is useful for extensions like Thanks where the target is a userpage. Change-Id: I77e1e59d7e3666802d0eeb0c48a0ec211dba0a2a --- diff --git a/docs/hooks.txt b/docs/hooks.txt index ec6ce730cb..22f61b6e26 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1213,6 +1213,9 @@ without any fancy queries or variants. $title: Title object of page &$url: string value as output (out parameter, can modify) +'GetLogTypesOnUser': Add log types where the target is a userpage +&$types: Array of log types + 'GetMetadataVersion': Modify the image metadata version currently in use. This is used when requesting image metadata from a ForeignApiRepo. Media handlers that need to have versioned metadata should add an element to the end of the diff --git a/includes/specials/SpecialLog.php b/includes/specials/SpecialLog.php index 2ffdd89d2a..5265403f3c 100644 --- a/includes/specials/SpecialLog.php +++ b/includes/specials/SpecialLog.php @@ -98,6 +98,7 @@ class SpecialLog extends SpecialPage { # Some log types are only for a 'User:' title but we might have been given # only the username instead of the full title 'User:username'. This part try # to lookup for a user by that name and eventually fix user input. See bug 1697. + wfRunHooks( 'GetLogTypesOnUser', array( &$this->typeOnUser ) ); if ( in_array( $opts->getValue( 'type' ), $this->typeOnUser ) ) { # ok we have a type of log which expect a user title. $target = Title::newFromText( $opts->getValue( 'page' ) );