- /**
- * Get <script> tags for <head> whose source is inline.
- *
- * @since 1.25
- * @return string HTML fragment
- */
- public function getInlineHeadScript() {
- // Load config before anything else.
- $html = ResourceLoader::makeInlineScript(
- ResourceLoader::makeConfigSetScript( $this->getJSVars() )
- );
-
- // Load embeddable private modules before any loader links.
- $inlineModulesLink = $this->makeResourceLoaderLink(
- array( 'user.options', 'user.tokens' ), ResourceLoaderModule::TYPE_COMBINED
- );
- $html .= "\n" . self::getHtmlFromLoaderLinks( array( $inlineModulesLink ) );
-
- // Construct mw.loader.load() call for top-loaded modules.
- // Client-side code will request these modules and their dependencies.
- $topModules = $this->getModules( true, 'top' );
- if ( $topModules ) {
- $html .= ResourceLoader::makeInlineScript(
- Xml::encodeJsCall( 'mw.loader.load', array( $topModules ) )
- ) . "\n";
- }
-
- return $html;
- }
-