From: Roan Kattouw Date: Mon, 31 Oct 2011 13:19:38 +0000 (+0000) Subject: Followup r101354: pass $this to the PreferencesGetLegend hook so the callee will... X-Git-Tag: 1.31.0-rc.0~26813 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=a0a775a9b4bb1a5698af2eb848a312b41787b394;p=lhc%2Fweb%2Fwiklou.git Followup r101354: pass $this to the PreferencesGetLegend hook so the callee will have a ContextSource to work with --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 17e8c26eb7..cb0120ee70 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1487,6 +1487,7 @@ $subject : subject of the new section Return false and put the merged text into $text to override the default behavior. 'PreferencesGetLegend': Override the text used for the of a preferences section +$form: the PreferencesForm object. This is a ContextSource as well $key: the section name &$legend: the legend text. Defaults to wfMsg( "prefs-$key" ) but may be overridden diff --git a/includes/Preferences.php b/includes/Preferences.php index 6b2d919170..a1d35bed3e 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -1572,7 +1572,7 @@ class PreferencesForm extends HTMLForm { */ function getLegend( $key ) { $legend = parent::getLegend( $key ); - wfRunHooks( 'PreferencesGetLegend', array( $key, &$legend ) ); + wfRunHooks( 'PreferencesGetLegend', array( $this, $key, &$legend ) ); return $legend; } }