Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -1115,7 +1115,9 @@ |
1116 | 1116 | $variableIDs: array of strings |
1117 | 1117 | |
1118 | 1118 | 'MakeGlobalVariablesScript': called right before Skin::makeVariablesScript |
1119 | | -is executed |
| 1119 | +is executed. Ideally, this hook should only be used to add variables that |
| 1120 | +depend on the current page/request; static configuration should be added |
| 1121 | +through ResourceLoaderConfigVars instead. |
1120 | 1122 | &$vars: variable (or multiple variables) to be added into the output |
1121 | 1123 | of Skin::makeVariablesScript |
1122 | 1124 | |
— | — | @@ -1376,9 +1378,15 @@ |
1377 | 1379 | &$obj: RawPage object |
1378 | 1380 | &$text: The text that's going to be the output |
1379 | 1381 | |
1380 | | -'RecentChange_save': called at the end of RecenChange::save() |
| 1382 | +'RecentChange_save': called at the end of RecentChange::save() |
1381 | 1383 | $recentChange: RecentChange object |
1382 | 1384 | |
| 1385 | +'ResourceLoaderConfigVars': called at the end of |
| 1386 | +ResourceLoaderStartUpModule::getConfig(). Use this to export static |
| 1387 | +configuration variables to JavaScript. Things that depend on the current |
| 1388 | +page/request state must be added through MakeGlobalVariablesScript instead. |
| 1389 | +&$vars: array( variable name => value ) |
| 1390 | + |
1383 | 1391 | 'RevisionInsertComplete': called after a revision is inserted into the DB |
1384 | 1392 | &$revision: the Revision |
1385 | 1393 | $data: the data stored in old_text. The meaning depends on $flags: if external |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderStartUpModule.php |
— | — | @@ -85,6 +85,8 @@ |
86 | 86 | $vars['wgMWSuggestTemplate'] = SearchEngine::getMWSuggestTemplate(); |
87 | 87 | } |
88 | 88 | |
| 89 | + wfRunHooks( 'ResourceLoaderGetConfigVars', array( &$vars ) ); |
| 90 | + |
89 | 91 | return $vars; |
90 | 92 | } |
91 | 93 | |