/** * Generates an in-line addMessege call for page output. * For use with OutputPage when the script-loader is disabled. * * @param {String} $resourceName of resource to get inline messages for. * @return in-line msg javascript text or empty string if no msgs need to be localized. */ function getResourceMessageJS($resourceName) { $scriptText = $this->getResourceText($resourceName); $moduleName = NamedResourceLoader::getModuleNameForResource($resourceName); return $this->getAddMessagesFromScriptText($scriptText, $moduleName); }
/** * Process loader content * * parses the loader files and adds * * @param String $fileContent content of loader.js file */ private static function proccessLoaderContent(&$fileContent, $moduleName) { // Add the mwEmbed loader js to its global collector: self::$combinedLoadersJs .= $fileContent; // Is there a way to pass arguments in preg_replace_callback ? self::$currentModuleName = $moduleName; // Run the replace callback: preg_replace_callback(self::$classReplaceExp, 'NamedResourceLoader::preg_classPathLoader', $fileContent); }