From b4255eab0bad160586994bd6c32b018aaabf739e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Mon, 5 Jan 2015 21:18:57 +0100 Subject: [PATCH] Add OutputPage::enableOOUI() to set up OOUI stuff when needed Initialize OOUI theme and set OOUI element directionality, load necessary RL modules. Bug: T85767 Change-Id: I9aa430969e4250bd2bd6c396b6133a35ca5bf46b --- includes/OutputPage.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index a10946a4d1..413c75fb11 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -3878,4 +3878,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' ); + } } -- 2.20.1