/** * ResourceLoaderGetConfigVars hook handler * This should be used for variables which vary with the html * and for variables this should work cross skin * @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderGetConfigVars * * @param array $vars * @return boolean */ public static function onResourceLoaderGetConfigVars(&$vars) { $context = MobileContext::singleton(); $config = $context->getMFConfig(); $vars += array('wgMFNearbyEndpoint' => $config->get('MFNearbyEndpoint'), 'wgMFThumbnailSizes' => array('tiny' => MobilePage::TINY_IMAGE_WIDTH, 'small' => MobilePage::SMALL_IMAGE_WIDTH), 'wgMFContentNamespace' => $config->get('MFContentNamespace'), 'wgMFEditorOptions' => $config->get('MFEditorOptions'), 'wgMFLicenseLink' => SkinMinerva::getLicenseLink('editor'), 'wgMFUploadLicenseLink' => SkinMinerva::getLicenseLink('upload')); // add CodeMirror specific things, if it is installed (for CodeMirror editor) if (class_exists('CodeMirrorHooks')) { $vars += CodeMirrorHooks::getGlobalVariables(MobileContext::singleton()); $vars['wgMFCodeMirror'] = true; } return true; }