Merge "Convert mediawiki.toc and mediawiki.user to using mw.cookie"
[lhc/web/wiklou.git] / includes / OutputPage.php
index 8f9f9c6..db22166 100644 (file)
@@ -162,9 +162,6 @@ class OutputPage extends ContextSource {
        /** @var array */
        protected $mModuleStyles = array();
 
-       /** @var array */
-       protected $mModuleMessages = array();
-
        /** @var ResourceLoader */
        protected $mResourceLoader;
 
@@ -613,24 +610,24 @@ class OutputPage extends ContextSource {
        /**
         * Get the list of module messages to include on this page
         *
+        * @deprecated since 1.26 Obsolete
         * @param bool $filter
         * @param string|null $position
-        *
         * @return array Array of module names
         */
        public function getModuleMessages( $filter = false, $position = null ) {
-               return $this->getModules( $filter, $position, 'mModuleMessages' );
+               wfDeprecated( __METHOD__, '1.26' );
+               return array();
        }
 
        /**
-        * Add only messages of one or more modules recognized by the resource loader.
-        * Module messages added through this function will be loaded by the resource
-        * loader when the page loads.
+        * Load messages of one or more ResourceLoader modules.
         *
+        * @deprecated since 1.26 Use addModules() instead
         * @param string|array $modules Module name (string) or array of module names
         */
        public function addModuleMessages( $modules ) {
-               $this->mModuleMessages = array_merge( $this->mModuleMessages, (array)$modules );
+               wfDeprecated( __METHOD__, '1.26' );
        }
 
        /**
@@ -1401,8 +1398,10 @@ class OutputPage extends ContextSource {
 
        /**
         * Adds help link with an icon via page indicators.
-        * @param string $to
-        * @param bool $overrideBaseUrl
+        * Link target can be overridden by a local message containing a wikilink:
+        * the message key is: lowercase action or special page name + '-helppage'.
+        * @param string $to Target MediaWiki.org page title or encoded URL.
+        * @param bool $overrideBaseUrl Whether $url is a full URL, to avoid MW.o.
         * @since 1.25
         */
        public function addHelpLink( $to, $overrideBaseUrl = false ) {
@@ -1415,6 +1414,7 @@ class OutputPage extends ContextSource {
                        $toUrlencoded = wfUrlencode( str_replace( ' ', '_', $to ) );
                        $helpUrl = "//www.mediawiki.org/wiki/Special:MyLanguage/$toUrlencoded";
                }
+
                $link = Html::rawElement(
                        'a',
                        array(
@@ -1758,7 +1758,6 @@ class OutputPage extends ContextSource {
                $this->addModules( $parserOutput->getModules() );
                $this->addModuleScripts( $parserOutput->getModuleScripts() );
                $this->addModuleStyles( $parserOutput->getModuleStyles() );
-               $this->addModuleMessages( $parserOutput->getModuleMessages() );
                $this->addJsConfigVars( $parserOutput->getJsConfigVars() );
                $this->mPreventClickjacking = $this->mPreventClickjacking
                        || $parserOutput->preventClickjacking();
@@ -1805,7 +1804,6 @@ class OutputPage extends ContextSource {
                $this->addModules( $parserOutput->getModules() );
                $this->addModuleScripts( $parserOutput->getModuleScripts() );
                $this->addModuleStyles( $parserOutput->getModuleStyles() );
-               $this->addModuleMessages( $parserOutput->getModuleMessages() );
 
                $this->addJsConfigVars( $parserOutput->getJsConfigVars() );
        }
@@ -2980,11 +2978,6 @@ class OutputPage extends ContextSource {
                $links[] = $this->makeResourceLoaderLink( $embedScripts, ResourceLoaderModule::TYPE_COMBINED );
 
                // Scripts and messages "only" requests marked for top inclusion
-               // Messages should go first
-               $links[] = $this->makeResourceLoaderLink(
-                       $this->getModuleMessages( true, 'top' ),
-                       ResourceLoaderModule::TYPE_MESSAGES
-               );
                $links[] = $this->makeResourceLoaderLink(
                        $this->getModuleScripts( true, 'top' ),
                        ResourceLoaderModule::TYPE_SCRIPTS
@@ -3018,14 +3011,9 @@ class OutputPage extends ContextSource {
         * @return string
         */
        function getScriptsForBottomQueue( $inHead ) {
-               // Scripts and messages "only" requests marked for bottom inclusion
+               // Scripts "only" requests marked for bottom inclusion
                // If we're in the <head>, use load() calls rather than <script src="..."> tags
-               // Messages should go first
                $links = array();
-               $links[] = $this->makeResourceLoaderLink( $this->getModuleMessages( true, 'bottom' ),
-                       ResourceLoaderModule::TYPE_MESSAGES, /* $useESI = */ false, /* $extraQuery = */ array(),
-                       /* $loadCall = */ $inHead
-               );
                $links[] = $this->makeResourceLoaderLink( $this->getModuleScripts( true, 'bottom' ),
                        ResourceLoaderModule::TYPE_SCRIPTS, /* $useESI = */ false, /* $extraQuery = */ array(),
                        /* $loadCall = */ $inHead