valign=center changes to valign=middle (HTML4.0 Spec)
[lhc/web/wiklou.git] / includes / SkinCologneBlue.php
1 <?
2 # See skin.doc
3
4 class SkinCologneBlue extends Skin {
5
6 function initPage()
7 {
8 global $wgOut, $wgStyleSheetPath;
9
10 $wgOut->addLink( "stylesheet", "",
11 "{$wgStyleSheetPath}/cologneblue.css" );
12 }
13
14 function doBeforeContent()
15 {
16 global $wgUser, $wgOut, $wgTitle;
17
18 $s = "";
19 $qb = $this->qbSetting();
20
21 $s .= "\n<div id='content'>\n<div id='topbar'>" .
22 "<table width='98%' border=0 cellspacing=0 cellpadding=8><tr>";
23
24 $s .= "<td class='top' align=left valign=middle nowrap>";
25 $s .= "<a href=\"" . wfLocalUrlE( wfMsg( "mainpage" ) ) . "\">";
26 $s .= "<span id='sitetitle'>" . wfMsg( "sitetitle" ) . "</span></a>";
27
28 $s .= "</td><td class='top' align=right valign=bottom width='100%'>";
29 $s .= $this->sysLinks();
30 $s .= "</td></tr><tr><td valign=top>";
31
32 $s .= "<font size='-1'><span id='sitesub'>";
33 $s .= wfMsg( "sitesubtitle" ) . "</span></font>";
34 $s .= "</td><td align=right>" ;
35
36 $s .= "<font size='-1'><span id='langlinks'>" ;
37 $s .= str_replace ( "<br>" , "" , $this->otherLanguages() ) ;
38 $s .= "<br>" . $this->pageTitleLinks();
39 $s .= "</span></font>";
40
41 $s .= "</td></tr></table>\n";
42
43 $s .= "\n</div>\n<div id='article'>";
44
45 $s .= $this->pageTitle();
46 $s .= $this->pageSubtitle() . "\n<p>";
47 return $s;
48 }
49
50 function doAfterContent()
51 {
52 global $wgUser, $wgOut;
53
54 $s = "\n</div><br clear=all>\n";
55
56 $s .= "\n<div id='footer'>";
57 $s .= "<table width='98%' border=0 cellspacing=0><tr>";
58
59 $qb = $this->qbSetting();
60 if ( 1 == $qb || 3 == $qb ) { # Left
61 $s .= $this->getQuickbarCompensator();
62 }
63 $s .= "<td class='bottom' align=center valign=top>";
64
65 $s .= $this->bottomLinks();
66 $s .= "\n<br>" . $this->makeKnownLink( wfMsg( "mainpage" ),
67 wfMsg( "mainpage" ) ) . " | "
68 . $this->aboutLink() . " | "
69 . $this->searchForm( wfMsg( "qbfind" ) );
70
71 $s .= "\n<br>" . $this->pageStats();
72
73 $s .= "</td>";
74 if ( 2 == $qb ) { # Right
75 $s .= $this->getQuickbarCompensator();
76 }
77 $s .= "</tr></table>\n</div>\n</div>\n";
78
79 if ( 0 != $qb ) { $s .= $this->quickBar(); }
80 return $s;
81 }
82 function doGetUserStyles()
83 {
84 global $wgUser, $wgOut, $wgStyleSheetPath;
85
86 $s = parent::doGetUserStyles();
87 $qb = $this->qbSetting();
88
89 if ( 2 == $qb ) { # Right
90 $s .= "#quickbar { position: absolute; right: 4px; }\n" .
91 "#article { margin-left: 4px; margin-right: 148px; }\n";
92 } else if ( 1 == $qb || 3 == $qb ) {
93 $s .= "#quickbar { position: absolute; left: 4px; }\n" .
94 "#article { margin-left: 148px; margin-right: 4px; }\n";
95 }
96 return $s;
97 }
98 function sysLinks()
99 {
100 global $wgUser;
101 $s = "" .
102 $this->makeKnownLink( wfMsg( "mainpage" ), wfMsg( "mainpage" ) )
103 . " | " .
104 $this->makeKnownLink( wfMsg( "aboutpage" ), wfMsg( "about" ) )
105 . " | " .
106 $this->makeKnownLink( wfMsg( "helppage" ), wfMsg( "help" ) )
107 . " | " .
108 $this->makeKnownLink( wfMsg( "faqpage" ), wfMsg("faq") )
109 . " | " .
110 $this->specialLink( "specialpages" ) . " | " .
111 $this->specialLink( $wgUser->getID() ? "userlogout" : "userlogin" ) ;
112 return $s;
113 }
114
115 function quickBar()
116 {
117 global $wgOut, $wgTitle, $wgUser, $wgLang;
118
119 $s = "\n<div id='quickbar'>";
120
121 $sep = "<br>";
122 $s .= $this->menuHead( "qbfind" );
123 $s .= $this->searchForm();
124
125 $s .= $this->menuHead( "qbbrowse" )
126 . $this->mainPageLink()
127 . $sep . $this->specialLink( "recentchanges" )
128 . $sep . $this->specialLink( "randompage" )
129 . $sep . $this->specialLink( "newpages" )
130 . $sep . $this->specialLink( "imagelist" )
131 . $sep . $this->specialLink( "statistics" )
132 . $sep . $this->specialLink( "specialpages" )
133 . $sep . $this->bugReportsLink() ;
134 if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
135 $s .= "\n";
136
137 if ( $wgOut->isArticle() ) {
138 $s .= $this->menuHead( "qbedit" );
139 $s .= "<strong>" . $this->editThisPage() . "</strong>"
140 . $sep . $this->makeKnownLink( wfMsg( "edithelppage" ),
141 wfMsg( "edithelp" ) );
142
143 if ( 0 != $wgUser->getID() ) {
144 $s .= $sep . $this->specialLink( "upload" )
145 . $sep . $this->moveThisPage();
146 }
147 if ( $wgUser->isSysop() ) {
148 $s .= $sep . $this->deleteThisPage() .
149 $sep . $this->protectThisPage();
150 }
151 $s .= $sep;
152
153 $s .= $this->menuHead( "qbpageoptions" );
154 $s .= $this->talkLink()
155 . $sep . $this->printableLink();
156 if ( 0 != $wgUser->getID() ) {
157 $s .= $sep . $this->watchThisPage();
158 }
159 $s .= $sep;
160
161 $s .= $this->menuHead( "qbpageinfo" )
162 . $this->historyLink()
163 . $sep . $this->whatLinksHere()
164 . $sep . $this->watchPageLinksLink();
165
166 if ( Namespace::getUser() == $wgTitle->getNamespace() ) {
167 $s .= $sep . $this->userContribsLink();
168 if ( 0 != $wgUser->getID() ) {
169 $s .= $sep . $this->emailUserLink();
170 }
171 }
172 $s .= $sep;
173 }
174 $s .= $this->menuHead( "qbmyoptions" );
175 if ( 0 != $wgUser->getID() ) {
176 $name = $wgUser->getName();
177 $tl = $this->makeKnownLink( $wgLang->getNsText(
178 Namespace::getTalk( Namespace::getUser() ) ) . ":{$name}",
179 wfMsg( "mytalk" ) );
180 if ( 0 != $wgUser->getNewtalk() ) { $tl .= " *"; }
181
182 $s .= $this->makeKnownLink( $wgLang->getNsText(
183 Namespace::getUser() ) . ":{$name}", wfMsg( "mypage" ) )
184 . $sep . $tl
185 . $sep . $this->specialLink( "watchlist" )
186 . $sep . $this->specialLink( "preferences" )
187 . $sep . $this->specialLink( "userlogout" );
188 } else {
189 $s .= $this->specialLink( "userlogin" );
190 }
191 $s .= $sep . "\n</div>\n";
192 return $s;
193 }
194
195 function menuHead( $key )
196 {
197 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
198 return $s;
199 }
200
201 function searchForm( $label = "" )
202 {
203 global $search;
204 $s = "<form id=\"search\" method=\"get\" class=\"inline\" action=\"" .
205 wfLocalUrlE( "" ) . "\">";
206 if ( "" != $label ) { $s .= "{$label}: "; }
207
208 $s .= "<input type=text name=\"search\" size=10 value=\""
209 . htmlspecialchars(substr($search,0,256)) . "\">"
210 . "<input type=submit value=\"" . wfMsg( "ok" ) . "\"></form>";
211
212 return $s;
213 }
214 }
215
216 ?>