Is there a good way to add a global variable to Skins.php: makeGlobalVariablesScript() without modifying core MediaWiki code? This is MW 1.13.
Thanks, DanB
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Daniel Barrett wrote:
Is there a good way to add a global variable to Skins.php: makeGlobalVariablesScript() without modifying core MediaWiki code? This is MW 1.13.
There's a hook in there for 1.14, but it didn't make it in to 1.13 it looks like.
In most cases it'll be quite sufficient to just add another <head> script defining your variable. Something like this should do, if I'm not mistaken:
$wgOut->addInlineScript("var wgMyVariable=" . Xml::encodeJsVar($var));
- -- brion
mediawiki-l@lists.wikimedia.org