fixtags hack slightly cleaned up
[lhc/web/wiklou.git] / includes / SkinCologneBlue.php
1 <?php
2 # See skin.doc
3
4 class SkinCologneBlue extends Skin {
5
6 function initPage()
7 {
8 global $wgOut, $wgStyleSheetPath;
9 }
10
11 function getStylesheet()
12 {
13 return "cologneblue.css";
14 }
15
16 function doBeforeContent()
17 {
18 global $wgUser, $wgOut, $wgTitle;
19
20 $s = "";
21 $qb = $this->qbSetting();
22 $mainPageObj = Title::newMainPage();
23
24 $s .= "\n<div id='content'>\n<div id='topbar'>" .
25 "<table width='100%' border=0 cellspacing=0 cellpadding=8><tr>";
26
27 $s .= "<td class='top' align=left valign=middle nowrap>";
28 $s .= "<a href=\"" . $mainPageObj->escapeLocalURL() . "\">";
29 $s .= "<span id='sitetitle'>" . wfMsg( "sitetitle" ) . "</span></a>";
30
31 $s .= "</td><td class='top' align=right valign=bottom width='100%'>";
32 $s .= $this->sysLinks();
33 $s .= "</td></tr><tr><td valign=top>";
34
35 $s .= "<font size='-1'><span id='sitesub'>";
36 $s .= wfMsg( "sitesubtitle" ) . "</span></font>";
37 $s .= "</td><td align=right>" ;
38
39 $s .= "<font size='-1'><span id='langlinks'>" ;
40 $s .= str_replace ( "<br>" , "" , $this->otherLanguages() ) ;
41 $s .= "<br>" . $this->pageTitleLinks();
42 $s .= "</span></font>";
43
44 $s .= "</td></tr></table>\n";
45
46 $s .= "\n</div>\n<div id='article'>";
47
48 $s .= $this->pageTitle();
49 $s .= $this->pageSubtitle() . "\n<p>";
50 return $s;
51 }
52
53 function doAfterContent()
54 {
55 global $wgUser, $wgOut;
56
57 $s = "\n</div><br clear=all>\n";
58
59 $s .= "\n<div id='footer'>";
60 $s .= "<table width='98%' border=0 cellspacing=0><tr>";
61
62 $qb = $this->qbSetting();
63 if ( 1 == $qb || 3 == $qb ) { # Left
64 $s .= $this->getQuickbarCompensator();
65 }
66 $s .= "<td class='bottom' align=center valign=top>";
67
68 $s .= $this->bottomLinks();
69 $s .= "\n<br>" . $this->makeKnownLink( wfMsg( "mainpage" ),
70 wfMsg( "mainpage" ) ) . " | "
71 . $this->aboutLink() . " | "
72 . $this->searchForm( wfMsg( "qbfind" ) );
73
74 $s .= "\n<br>" . $this->pageStats();
75
76 $s .= "</td>";
77 if ( 2 == $qb ) { # Right
78 $s .= $this->getQuickbarCompensator();
79 }
80 $s .= "</tr></table>\n</div>\n</div>\n";
81
82 if ( 0 != $qb ) { $s .= $this->quickBar(); }
83 return $s;
84 }
85 function doGetUserStyles()
86 {
87 global $wgUser, $wgOut, $wgStyleSheetPath;
88
89 $s = parent::doGetUserStyles();
90 $qb = $this->qbSetting();
91
92 if ( 2 == $qb ) { # Right
93 $s .= "#quickbar { position: absolute; right: 4px; }\n" .
94 "#article { margin-left: 4px; margin-right: 148px; }\n";
95 } else if ( 1 == $qb || 3 == $qb ) {
96 $s .= "#quickbar { position: absolute; left: 4px; }\n" .
97 "#article { margin-left: 148px; margin-right: 4px; }\n";
98 }
99 return $s;
100 }
101 function sysLinks()
102 {
103 global $wgUser, $wgLang, $wgTitle;
104 $li = $wgLang->specialPage("Userlogin");
105 $lo = $wgLang->specialPage("Userlogout");
106
107 $rt = $wgTitle->getPrefixedURL();
108 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
109 $q = "";
110 } else {
111 $q = "returnto={$rt}";
112 }
113
114 $s .= "\n<br>" . $this->makeKnownLink( $li,
115 wfMsg( "login" ), $q );
116
117 $s = "" .
118 $this->makeKnownLink( wfMsg( "mainpage" ), wfMsg( "mainpage" ) )
119 . " | " .
120 $this->makeKnownLink( wfMsg( "aboutpage" ), wfMsg( "about" ) )
121 . " | " .
122 $this->makeKnownLink( wfMsg( "helppage" ), wfMsg( "help" ) )
123 . " | " .
124 $this->makeKnownLink( wfMsg( "faqpage" ), wfMsg("faq") )
125 . " | " .
126 $this->specialLink( "specialpages" ) . " | ";
127
128 if ( $wgUser->getID() )
129 {
130 $s .= $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
131 }
132 else
133 {
134 $s .= $this->makeKnownLink( $li, wfMsg( "login" ), $q );
135 }
136
137 return $s;
138 }
139
140 function quickBar()
141 {
142 global $wgOut, $wgTitle, $wgUser, $wgLang, $wgDisableUploads;
143
144 $tns=$wgTitle->getNamespace();
145
146 $s = "\n<div id='quickbar'>";
147
148 $sep = "<br>";
149 $s .= $this->menuHead( "qbfind" );
150 $s .= $this->searchForm();
151
152 $s .= $this->menuHead( "qbbrowse" )
153 . $this->mainPageLink()
154 . $sep . $this->specialLink( "recentchanges" )
155 . $sep . $this->specialLink( "randompage" );
156 if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
157 $s .= "\n";
158
159 if ( $wgOut->isArticle() ) {
160 $s .= $this->menuHead( "qbedit" );
161 $s .= "<strong>" . $this->editThisPage() . "</strong>";
162
163 $s .= $sep . $this->makeKnownLink( wfMsg( "edithelppage" ), wfMsg( "edithelp" ) );
164
165 if ( 0 != $wgUser->getID() ) {
166 $s .= $sep . $this->moveThisPage();
167 }
168 if ( $wgUser->isSysop() ) {
169 $dtp = $this->deleteThisPage();
170 if ( "" != $dtp ) {
171 $s .= $sep . $dtp;
172 }
173 $ptp = $this->protectThisPage();
174 if ( "" != $ptp ) {
175 $s .= $sep . $ptp;
176 }
177 }
178 $s .= $sep;
179
180 $s .= $this->menuHead( "qbpageoptions" );
181 $s .= $this->talkLink()
182 . $sep . $this->commentLink()
183 . $sep . $this->printableLink();
184 if ( 0 != $wgUser->getID() ) {
185 $s .= $sep . $this->watchThisPage();
186 }
187
188 $s .= $sep;
189
190 $s .= $this->menuHead("qbpageinfo")
191 . $this->historyLink()
192 . $sep . $this->whatLinksHere()
193 . $sep . $this->watchPageLinksLink();
194
195 if ( Namespace::getUser() == $tns || Namespace::getTalk(Namespace::getUser()) == $tns ) {
196 $id=User::idFromName($wgTitle->getText());
197 if ($id != 0) {
198 $s .= $sep . $this->userContribsLink();
199 if ( 0 != $wgUser->getID() ) {
200 $s .= $sep . $this->emailUserLink();
201 }
202 }
203 }
204 $s .= $sep;
205 }
206
207 $s .= $this->menuHead( "qbmyoptions" );
208 if ( 0 != $wgUser->getID() ) {
209 $name = $wgUser->getName();
210 $tl = $this->makeKnownLink( $wgLang->getNsText(
211 Namespace::getTalk( Namespace::getUser() ) ) . ":{$name}",
212 wfMsg( "mytalk" ) );
213 if ( 0 != $wgUser->getNewtalk() ) { $tl .= " *"; }
214
215 $s .= $this->makeKnownLink( $wgLang->getNsText(
216 Namespace::getUser() ) . ":{$name}", wfMsg( "mypage" ) )
217 . $sep . $tl
218 . $sep . $this->specialLink( "watchlist" )
219 . $sep . $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
220 wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) )
221 . $sep . $this->specialLink( "preferences" )
222 . $sep . $this->specialLink( "userlogout" );
223 } else {
224 $s .= $this->specialLink( "userlogin" );
225 }
226
227 $s .= $this->menuHead( "qbspecialpages" )
228 . $this->specialLink( "newpages" )
229 . $sep . $this->specialLink( "imagelist" )
230 . $sep . $this->specialLink( "statistics" )
231 . $sep . $this->bugReportsLink();
232 if ( 0 != $wgUser->getID() && !$wgDisableUploads ) {
233 $s .= $sep . $this->specialLink( "upload" );
234 }
235 global $wgSiteSupportPage;
236 if( $wgSiteSupportPage) {
237 $s .= $sep."<a href=\"".htmlspecialchars($wgSiteSupportPage)."\" class =\"internal\">"
238 .wfMsg( "sitesupport" )."</a>";
239 }
240
241 $s .= $sep . $this->makeKnownLink( $wgLang->specialPage( "Specialpages" ), wfMsg("moredotdotdot") );
242
243 $s .= $sep . "\n</div>\n";
244 return $s;
245 }
246
247 function menuHead( $key )
248 {
249 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
250 return $s;
251 }
252
253 function searchForm( $label = "" )
254 {
255 global $wgRequest;
256
257 $search = $wgRequest->getText( 'search' );
258 $s = "<form id=\"search\" method=\"get\" class=\"inline\" action=\"" .
259 wfLocalUrlE( "" ) . "\">";
260 if ( "" != $label ) { $s .= "{$label}: "; }
261
262 $s .= "<input type=text name=\"search\" size=14 value=\""
263 . htmlspecialchars(substr($search,0,256)) . "\">"
264 . "<br><input type=submit name=\"go\" value=\"" . wfMsg( "go" ) . "\"> <input type=submit name=\"fulltext\" value=\"" . wfMsg( "search" ) . "\"></form>";
265
266 return $s;
267 }
268 }
269
270 ?>