Various additions and fixes
[mediawiki.git] / includes / SkinStandard.php
blob013dd64d73f36eb9cca8a5ca6a6cf80af61f4b90
1 <?
2 # See skin.doc
4 class SkinStandard extends Skin {
6 function getHeadScripts()
8 global $wgStyleSheetPath;
10 $s = parent::getHeadScripts();
11 if ( 3 == $this->qbSetting() ) { # Floating left
12 $s .= "<script language='javascript' type='text/javascript' " .
13 "src='{$wgStyleSheetPath}/sticky.js'></script>\n";
15 return $s;
18 function getUserStyles()
20 global $wgStyleSheetPath;
22 $s = parent::getUserStyles();
23 if ( 3 == $this->qbSetting() ) { # Floating left
24 $s .= "<style type='text/css'>\n" .
25 "@import '{$wgStyleSheetPath}/quickbar.css';\n</style>\n";
27 return $s;
30 function doGetUserStyles()
32 global $wgUser, $wgOut, $wgStyleSheetPath;
34 $s = parent::doGetUserStyles();
35 $qb = $this->qbSetting();
37 if ( 2 == $qb ) { # Right
38 $s .= "#quickbar { position: absolute; top: 4px; right: 4px; " .
39 "border-left: 2px solid #000000; }\n" .
40 "#article { margin-left: 4px; margin-right: 152px; }\n";
41 } else if ( 1 == $qb || 3 == $qb ) {
42 $s .= "#quickbar { position: absolute; top: 4px; left: 4px; " .
43 "border-right: 1px solid gray; }\n" .
44 "#article { margin-left: 152px; margin-right: 4px; }\n";
46 return $s;
49 function getBodyOptions()
51 $a = parent::getBodyOptions();
53 if ( 3 == $this->qbSetting() ) { # Floating left
54 $qb = "setup(\"quickbar\")";
55 if($a["onload"]) {
56 $a["onload"] .= ";$qb";
57 } else {
58 $a["onload"] = $qb;
61 return $a;