Throw an exception instead of low-level PHP fatal error if something invokes the...
[mediawiki.git] / skins / Simple.php
blob61564c2d6efb8ac50c6d71b81bef857963b27065
1 <?php
2 /**
3 * Simple: A lightweight skin with a simple white-background sidebar and no
4 * top bar.
6 * @file
7 * @ingroup Skins
8 */
10 if( !defined( 'MEDIAWIKI' ) )
11 die( -1 );
13 /** */
14 require_once( dirname(__FILE__) . '/MonoBook.php' );
16 /**
17 * Inherit main code from SkinTemplate, set the CSS and template filter.
18 * @ingroup Skins
20 class SkinSimple extends SkinTemplate {
21 var $skinname = 'simple', $stylename = 'simple',
22 $template = 'MonoBookTemplate', $useHeadElement = true;
24 function setupSkinUserCss( OutputPage $out ){
25 parent::setupSkinUserCss( $out );
27 $out->addStyle( 'simple/main.css', 'screen' );
28 $out->addStyle( 'simple/rtl.css', '', '', 'rtl' );
31 function reallyGenerateUserStylesheet() {
32 global $wgUser;
33 $s = '';
34 if( ( $undopt = $wgUser->getOption( 'underline' ) ) != 2 ) {
35 $underline = $undopt ? 'underline' : 'none';
36 $s .= "a { text-decoration: $underline; }\n";
38 if( $wgUser->getOption( 'highlightbroken' ) ) {
39 $s .= "a.new, #quickbar a.new { text-decoration: line-through; }\n";
40 } else {
41 $s .= <<<CSS
42 a.new, #quickbar a.new,
43 a.stub, #quickbar a.stub {
44 color: inherit;
45 text-decoration: inherit;
47 a.new:after, #quickbar a.new:after {
48 content: "?";
49 color: #CC2200;
50 text-decoration: $underline;
52 a.stub:after, #quickbar a.stub:after {
53 content: "!";
54 color: #772233;
55 text-decoration: $underline;
57 CSS;
59 if( $wgUser->getOption( 'justify' ) ) {
60 $s .= "#article, #bodyContent { text-align: justify; }\n";
62 if( !$wgUser->getOption( 'showtoc' ) ) {
63 $s .= "#toc { display: none; }\n";
65 if( !$wgUser->getOption( 'editsection' ) ) {
66 $s .= ".editsection { display: none; }\n";
68 return $s;