X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fresourceloader%2FResourceLoaderUserCSSPrefsModule.php;h=9c198d14a9345f2883490a9f9106f42f8f89042a;hb=40a628a501fc05bb00e834fe359ca4061925f320;hp=65d770e23f8e0112d19ff980b3981ed927971474;hpb=8195fd3551c484cfe140fd54ac9c16c2d8c4bc4a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/resourceloader/ResourceLoaderUserCSSPrefsModule.php b/includes/resourceloader/ResourceLoaderUserCSSPrefsModule.php index 65d770e23f..9c198d14a9 100644 --- a/includes/resourceloader/ResourceLoaderUserCSSPrefsModule.php +++ b/includes/resourceloader/ResourceLoaderUserCSSPrefsModule.php @@ -1,6 +1,6 @@ getConfig()->get( 'AllowUserCssPrefs' ) ) { - return array(); + return []; } $options = $context->getUserObj()->getOptions(); // Build CSS rules - $rules = array(); + $rules = []; - // Underline: 2 = browser default, 1 = always, 0 = never + // Underline: 2 = skin default, 1 = always, 0 = never if ( $options['underline'] < 2 ) { $rules[] = "a { text-decoration: " . ( $options['underline'] ? 'underline' : 'none' ) . "; }"; - } else { - # The scripts of these languages are very hard to read with underlines - $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 @@ -69,7 +65,16 @@ class ResourceLoaderUserCSSPrefsModule extends ResourceLoaderModule { if ( $this->getFlip( $context ) ) { $style = CSSJanus::transform( $style, true, false ); } - return array( 'all' => $style ); + return [ 'all' => $style ]; + } + + /** + * @param ResourceLoaderContext $context + * @return bool + */ + public function isKnownEmpty( ResourceLoaderContext $context ) { + $styles = $this->getStyles( $context ); + return isset( $styles['all'] ) && $styles['all'] === ''; } /**