Finish porting the Simple skin to resourceloader.
[lhc/web/wiklou.git] / skins / Simple.php
1 <?php
2 /**
3 * Simple: A lightweight skin with a simple white-background sidebar and no
4 * top bar.
5 *
6 * @file
7 * @ingroup Skins
8 */
9
10 if( !defined( 'MEDIAWIKI' ) )
11 die( -1 );
12
13 /** */
14 require_once( dirname(__FILE__) . '/MonoBook.php' );
15
16 /**
17 * Inherit main code from SkinTemplate, set the CSS and template filter.
18 * @ingroup Skins
19 */
20 class SkinSimple extends SkinTemplate {
21 var $skinname = 'simple', $stylename = 'simple',
22 $template = 'MonoBookTemplate', $useHeadElement = true;
23
24 function setupSkinUserCss( OutputPage $out ) {
25 parent::setupSkinUserCss( $out );
26
27 $out->addModuleStyles( 'skins.simple' );
28
29 /* Add some userprefs specific CSS styling */
30 global $wgUser, $wgContLang;
31 $rules = array();
32 $underline = "";
33
34 if ( $wgUser->getOption( 'underline' ) < 2 ) {
35 $underline = "text-decoration: " . $wgUser->getOption( 'underline' ) ? 'underline' : 'none' . ";";
36 }
37
38 /* Also inherits from resourceloader */
39 if( !$wgUser->getOption( 'highlightbroken' ) ) {
40 $rules[] = "a.new, a.stub { color: inherit; text-decoration: inherit;}";
41 $rules[] = "a.new:after { color: #CC2200; $underline;}";
42 $rules[] = "a.stub:after { $underline; }";
43 }
44 $style = implode( "\n", $rules );
45 if ( $wgContLang->getDir() === 'rtl' ) {
46 $style = CSSJanus::transform( $style, true, false );
47 }
48 $out->addInlineStyle( $style );
49
50 }
51 }