Merge "Add OutputPage::enableOOUI() to set up OOUI stuff when needed"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 28 Jan 2015 23:33:50 +0000 (23:33 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 28 Jan 2015 23:33:50 +0000 (23:33 +0000)
includes/OutputPage.php

index 4101d09..5c146e4 100644 (file)
@@ -3885,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' );
+       }
 }