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