Localisation updates from https://translatewiki.net.
[lhc/web/wiklou.git] / includes / OutputPage.php
index 34d3ce6..3bb2175 100644 (file)
@@ -122,6 +122,9 @@ class OutputPage extends ContextSource {
        /** @var array */
        protected $mCategories = array();
 
+       /** @var array */
+       protected $mIndicators = array();
+
        /** @var array Array of Interwiki Prefixed (non DB key) Titles (e.g. 'fr:Test page') */
        private $mLanguageLinks = array();
 
@@ -1329,6 +1332,32 @@ class OutputPage extends ContextSource {
                return $this->mCategories;
        }
 
+       /**
+        * Add an array of indicators, with their identifiers as array keys and HTML contents as values.
+        *
+        * In case of duplicate keys, existing values are overwritten.
+        *
+        * @param array $indicators
+        * @since 1.25
+        */
+       public function setIndicators( array $indicators ) {
+               $this->mIndicators = $indicators + $this->mIndicators;
+               // Keep ordered by key
+               ksort( $this->mIndicators );
+       }
+
+       /**
+        * Get the indicators associated with this page.
+        *
+        * The array will be internally ordered by item keys.
+        *
+        * @return array Keys: identifiers, values: HTML contents
+        * @since 1.25
+        */
+       public function getIndicators() {
+               return $this->mIndicators;
+       }
+
        /**
         * Restrict the page to loading modules bundled the software.
         *
@@ -1641,6 +1670,7 @@ class OutputPage extends ContextSource {
        public function addParserOutputMetadata( $parserOutput ) {
                $this->mLanguageLinks += $parserOutput->getLanguageLinks();
                $this->addCategoryLinks( $parserOutput->getCategories() );
+               $this->setIndicators( $parserOutput->getIndicators() );
                $this->mNewSectionLink = $parserOutput->getNewSection();
                $this->mHideNewSectionLink = $parserOutput->getHideNewSection();
 
@@ -2085,8 +2115,6 @@ class OutputPage extends ContextSource {
         * the object, let's actually output it:
         */
        public function output() {
-               global $wgLanguageCode;
-
                if ( $this->mDoNothing ) {
                        return;
                }
@@ -2140,7 +2168,7 @@ class OutputPage extends ContextSource {
                ob_start();
 
                $response->header( 'Content-type: ' . $config->get( 'MimeType' ) . '; charset=UTF-8' );
-               $response->header( 'Content-language: ' . $wgLanguageCode );
+               $response->header( 'Content-language: ' . $config->get( 'LanguageCode' ) );
 
                // Avoid Internet Explorer "compatibility view" in IE 8-10, so that
                // jQuery etc. can work correctly.
@@ -3514,7 +3542,9 @@ class OutputPage extends ContextSource {
                $moduleStyles[] = 'user.groups';
 
                // Per-user custom styles
-               if ( $this->getConfig()->get( 'AllowUserCss' ) && $this->getTitle()->isCssSubpage() && $this->userCanPreview() ) {
+               if ( $this->getConfig()->get( 'AllowUserCss' ) && $this->getTitle()->isCssSubpage()
+                       && $this->userCanPreview()
+               ) {
                        // We're on a preview of a CSS subpage
                        // Exclude this page from the user module in case it's in there (bug 26283)
                        $link = $this->makeResourceLoaderLink( 'user', ResourceLoaderModule::TYPE_STYLES, false,