diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
commit | ca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch) | |
tree | ec04cc15b867bc21eedca904cea9af0254531a11 /includes/resourceloader/ResourceLoaderContext.php | |
parent | a22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (diff) |
Update to MediaWiki 1.18.0
* also update ArchLinux skin to chagnes in MonoBook
* Use only css to hide our menu bar when printing
Diffstat (limited to 'includes/resourceloader/ResourceLoaderContext.php')
-rw-r--r-- | includes/resourceloader/ResourceLoaderContext.php | 50 |
1 files changed, 47 insertions, 3 deletions
diff --git a/includes/resourceloader/ResourceLoaderContext.php b/includes/resourceloader/ResourceLoaderContext.php index bf059b46..326b7c4a 100644 --- a/includes/resourceloader/ResourceLoaderContext.php +++ b/includes/resourceloader/ResourceLoaderContext.php @@ -73,6 +73,8 @@ class ResourceLoaderContext { */ public static function expandModuleNames( $modules ) { $retval = array(); + // For backwards compatibility with an earlier hack, replace ! with . + $modules = str_replace( '!', '.', $modules ); $exploded = explode( '|', $modules ); foreach ( $exploded as $group ) { if ( strpos( $group, ',' ) === false ) { @@ -98,18 +100,30 @@ class ResourceLoaderContext { return $retval; } + /** + * @return ResourceLoader + */ public function getResourceLoader() { return $this->resourceLoader; } - + + /** + * @return WebRequest + */ public function getRequest() { return $this->request; } + /** + * @return array + */ public function getModules() { return $this->modules; } + /** + * @return string + */ public function getLanguage() { if ( $this->language === null ) { global $wgLang; @@ -121,49 +135,79 @@ class ResourceLoaderContext { return $this->language; } + /** + * @return string + */ public function getDirection() { if ( $this->direction === null ) { $this->direction = $this->request->getVal( 'dir' ); if ( !$this->direction ) { - global $wgContLang; - $this->direction = $wgContLang->getDir(); + # directionality based on user language (see bug 6100) + $this->direction = Language::factory( $this->language )->getDir(); } } return $this->direction; } + /** + * @return string + */ public function getSkin() { return $this->skin; } + /** + * @return string + */ public function getUser() { return $this->user; } + /** + * @return bool + */ public function getDebug() { return $this->debug; } + /** + * @return String + */ public function getOnly() { return $this->only; } + /** + * @return String + */ public function getVersion() { return $this->version; } + /** + * @return bool + */ public function shouldIncludeScripts() { return is_null( $this->only ) || $this->only === 'scripts'; } + /** + * @return bool + */ public function shouldIncludeStyles() { return is_null( $this->only ) || $this->only === 'styles'; } + /** + * @return bool + */ public function shouldIncludeMessages() { return is_null( $this->only ) || $this->only === 'messages'; } + /** + * @return string + */ public function getHash() { if ( !isset( $this->hash ) ) { $this->hash = implode( '|', array( |