From: Krinkle Date: Thu, 1 Sep 2011 17:23:13 +0000 (+0000) Subject: Pass OutputPage instance to MakeGlobalVariablesScript. Allows extensions to getTitle... X-Git-Tag: 1.31.0-rc.0~27965 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=f1b79b7eba4b0a10e553f0fd3b634b95ea52a4d6;p=lhc%2Fweb%2Fwiklou.git Pass OutputPage instance to MakeGlobalVariablesScript. Allows extensions to getTitle()->equals( .. ) and add config vars depending on title --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 20979f57b7..44a01b5286 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1221,6 +1221,8 @@ depend on the current page/request; static configuration should be added through ResourceLoaderGetConfigVars instead. &$vars: variable (or multiple variables) to be added into the output of Skin::makeVariablesScript +&$out: The OutputPage which called the hook, + can be used to get the real title 'MarkPatrolled': before an edit is marked patrolled $rcid: ID of the revision to be marked patrolled diff --git a/includes/OutputPage.php b/includes/OutputPage.php index a957e54954..a45a3ad547 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2658,7 +2658,7 @@ $distantTemplates } // Allow extensions to add their custom variables to the global JS variables - wfRunHooks( 'MakeGlobalVariablesScript', array( &$vars ) ); + wfRunHooks( 'MakeGlobalVariablesScript', array( &$vars, &$this ) ); return $vars; }