From f1b79b7eba4b0a10e553f0fd3b634b95ea52a4d6 Mon Sep 17 00:00:00 2001 From: Krinkle Date: Thu, 1 Sep 2011 17:23:13 +0000 Subject: [PATCH] Pass OutputPage instance to MakeGlobalVariablesScript. Allows extensions to getTitle()->equals( .. ) and add config vars depending on title --- docs/hooks.txt | 2 ++ includes/OutputPage.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.20.1