%PDF- %PDF-
Direktori : /www/varak.net/wiki.varak.net/extensions/CookiePolicy/ |
Current File : /www/varak.net/wiki.varak.net/extensions/CookiePolicy/CookiePolicy.hooks.php |
<?php /** * CookiePolicy's hooked functions, i.e. any and all PHP logic this extension * currently has. * * @file * @ingroup Extensions * @author Liz Lee <liz@wikia-inc.com> * @author Jack Phoenix <jack@countervandalism.net> */ class CookiePolicyHooks { /** * Add JS module to the output * * @param OutputPage $out * @return bool */ public static function onBeforePageDisplay( OutputPage $out ) { // use ResourceLoader to load the JS $out->addModules( 'ext.cookiepolicy' ); return true; } /** * Exposes the GeoIP service URL to JS so that cookiePolicy.js can use it. * * @param array $vars Pre-existing JS global variables * @param OutputPage $outputPage * @return bool */ public static function onMakeGlobalVariablesScript( &$vars, $outputPage ) { global $wgCookiePolicyGeoIPServiceURL; $vars['wgCookiePolicyGeoIPServiceURL'] = $wgCookiePolicyGeoIPServiceURL; return true; } }