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