Merge "Add i18n for the infamous "Fatal exception of type MWException" errorbox"
[lhc/web/wiklou.git] / includes / OutputPage.php
index 7b79506..5c146e4 100644 (file)
@@ -1685,7 +1685,6 @@ class OutputPage extends ContextSource {
        ) {
                global $wgParser;
 
-
                $popts = $this->parserOptions();
                $oldTidy = $popts->setTidy( $tidy );
                $popts->setInterfaceMessage( (bool)$interface );
@@ -2171,7 +2170,6 @@ class OutputPage extends ContextSource {
                        return;
                }
 
-
                $response = $this->getRequest()->response();
                $config = $this->getConfig();
 
@@ -2619,7 +2617,6 @@ class OutputPage extends ContextSource {
        public function headElement( Skin $sk, $includeStyle = true ) {
                global $wgContLang;
 
-
                $userdir = $this->getLanguage()->getDir();
                $sitedir = $wgContLang->getDir();
 
@@ -3287,6 +3284,13 @@ class OutputPage extends ContextSource {
                        'content' => "MediaWiki $wgVersion",
                ) );
 
+               if ( $config->get( 'ReferrerPolicy' ) !== false ) {
+                       $tags['meta-referrer'] = Html::element( 'meta', array(
+                               'name' => 'referrer',
+                               'content' => $config->get( 'ReferrerPolicy' )
+                       ) );
+               }
+
                $p = "{$this->mIndexPolicy},{$this->mFollowPolicy}";
                if ( $p !== 'index,follow' ) {
                        // http://www.robotstxt.org/wc/meta-user.html
@@ -3789,12 +3793,13 @@ class OutputPage extends ContextSource {
         * This function takes a number of message/argument specifications, wraps them in
         * some overall structure, and then parses the result and adds it to the output.
         *
-        * In the $wrap, $1 is replaced with the first message, $2 with the second, and so
-        * on. The subsequent arguments may either be strings, in which case they are the
-        * message names, or arrays, in which case the first element is the message name,
-        * and subsequent elements are the parameters to that message.
+        * In the $wrap, $1 is replaced with the first message, $2 with the second,
+        * and so on. The subsequent arguments may be either
+        * 1) strings, in which case they are message names, or
+        * 2) arrays, in which case, within each array, the first element is the message
+        *    name, and subsequent elements are the parameters to that message.
         *
-        * Don't use this for messages that are not in users interface language.
+        * Don't use this for messages that are not in the user's interface language.
         *
         * For example:
         *
@@ -3805,7 +3810,7 @@ class OutputPage extends ContextSource {
         *    $wgOut->addWikiText( "<div class='error'>\n"
         *        . wfMessage( 'some-error' )->plain() . "\n</div>" );
         *
-        * The newline after opening div is needed in some wikitext. See bug 19226.
+        * The newline after the opening div is needed in some wikitext. See bug 19226.
         *
         * @param string $wrap
         */
@@ -3880,4 +3885,16 @@ class OutputPage extends ContextSource {
        public function sectionEditLinksEnabled() {
                return $this->mEnableSectionEditLinks;
        }
+
+       /**
+        * Add ResourceLoader module styles for OOUI and set up the PHP implementation of it for use with
+        * MediaWiki and this OutputPage instance.
+        *
+        * @since 1.25
+        */
+       public function enableOOUI() {
+               OOUI\Theme::setSingleton( new OOUI\MediaWikiTheme() );
+               OOUI\Element::setDefaultDir( $this->getLanguage()->getDir() );
+               $this->addModuleStyles( 'oojs-ui.styles' );
+       }
 }