From: Sam Reed Date: Tue, 24 Aug 2010 01:31:28 +0000 (+0000) Subject: Update SkinAfterContent hook to pass the current skin too X-Git-Tag: 1.31.0-rc.0~35354 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=b31d0cb7583f1ab1b0d6120da5f8452d5d7da4b0;p=lhc%2Fweb%2Fwiklou.git Update SkinAfterContent hook to pass the current skin too So we don't need nasty $wgTitle globals --- diff --git a/docs/hooks.txt b/docs/hooks.txt index b0ae26ff2d..6c26a1f1e8 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1416,6 +1416,7 @@ Append to $text to add additional text/scripts after the stock bottom scripts. 'SkinAfterContent': Allows extensions to add text after the page content and article metadata. &$data: (string) Text to be printed out directly (without parsing) +$skin: Skin object This hook should work in all skins. Just set the &$data variable to the text you're going to add. diff --git a/includes/Skin.php b/includes/Skin.php index f000fbfffe..99926b70ae 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -911,7 +911,7 @@ CSS; protected function afterContentHook() { $data = ''; - if( wfRunHooks( 'SkinAfterContent', array( &$data ) ) ) { + if( wfRunHooks( 'SkinAfterContent', array( &$data, $this ) ) ) { // adding just some spaces shouldn't toggle the output // of the whole
, so we use trim() here if( trim( $data ) != '' ) {