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