From: Bartosz DziewoƄski Date: Mon, 5 Jan 2015 20:18:57 +0000 (+0100) Subject: Add OutputPage::enableOOUI() to set up OOUI stuff when needed X-Git-Tag: 1.31.0-rc.0~12578^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=b4255eab0bad160586994bd6c32b018aaabf739e;p=lhc%2Fweb%2Fwiklou.git 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 --- 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' ); + } }