From c1f9b1f7b1b77776192048005dcc66dcf3df2bfb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 27 Dec 2014 15:41:37 +0100 Subject: Update to MediaWiki 1.24.1 --- .../ResourceLoaderUserCSSPrefsModule.php | 31 ++++++++-------------- 1 file changed, 11 insertions(+), 20 deletions(-) (limited to 'includes/resourceloader/ResourceLoaderUserCSSPrefsModule.php') diff --git a/includes/resourceloader/ResourceLoaderUserCSSPrefsModule.php b/includes/resourceloader/ResourceLoaderUserCSSPrefsModule.php index bda86539..40274c63 100644 --- a/includes/resourceloader/ResourceLoaderUserCSSPrefsModule.php +++ b/includes/resourceloader/ResourceLoaderUserCSSPrefsModule.php @@ -36,27 +36,27 @@ class ResourceLoaderUserCSSPrefsModule extends ResourceLoaderModule { /* Methods */ /** - * @param $context ResourceLoaderContext - * @return array|int|Mixed + * @param ResourceLoaderContext $context + * @return array|int|mixed */ public function getModifiedTime( ResourceLoaderContext $context ) { $hash = $context->getHash(); - if ( isset( $this->modifiedTime[$hash] ) ) { - return $this->modifiedTime[$hash]; + if ( !isset( $this->modifiedTime[$hash] ) ) { + global $wgUser; + $this->modifiedTime[$hash] = wfTimestamp( TS_UNIX, $wgUser->getTouched() ); } - global $wgUser; - return $this->modifiedTime[$hash] = wfTimestamp( TS_UNIX, $wgUser->getTouched() ); + return $this->modifiedTime[$hash]; } /** - * @param $context ResourceLoaderContext + * @param ResourceLoaderContext $context * @return array */ public function getStyles( ResourceLoaderContext $context ) { - global $wgAllowUserCssPrefs, $wgUser; + global $wgUser; - if ( !$wgAllowUserCssPrefs ) { + if ( !$this->getConfig()->get( 'AllowUserCssPrefs' ) ) { return array(); } @@ -71,17 +71,8 @@ class ResourceLoaderUserCSSPrefsModule extends ResourceLoaderModule { ( $options['underline'] ? 'underline' : 'none' ) . "; }"; } else { # The scripts of these languages are very hard to read with underlines - $rules[] = 'a:lang(ar), a:lang(ckb), a:lang(kk-arab), ' . - 'a:lang(mzn), a:lang(ps), a:lang(ur) { text-decoration: none; }'; - } - if ( $options['justify'] ) { - $rules[] = "#article, #bodyContent, #mw_content { text-align: justify; }\n"; - } - if ( !$options['showtoc'] ) { - $rules[] = "#toc { display: none; }\n"; - } - if ( !$options['editsection'] ) { - $rules[] = ".mw-editsection { display: none; }\n"; + $rules[] = 'a:lang(ar), a:lang(kk-arab), a:lang(mzn), ' . + 'a:lang(ps), a:lang(ur) { text-decoration: none; }'; } if ( $options['editfont'] !== 'default' ) { // Double-check that $options['editfont'] consists of safe characters only -- cgit v1.2.3-54-g00ecf