* Adding a space to the left of #ca-print like there is for #ca-watch,
[lhc/web/wiklou.git] / skins / CologneBlue.php
1 <?php
2 /**
3 * See skin.txt
4 *
5 * @todo document
6 * @package MediaWiki
7 * @subpackage Skins
8 */
9
10 if( !defined( 'MEDIAWIKI' ) )
11 die();
12
13 /**
14 * @todo document
15 * @package MediaWiki
16 * @subpackage Skins
17 */
18 class SkinCologneBlue extends Skin {
19
20 function getStylesheet() {
21 return "common/cologneblue.css";
22 }
23 function getSkinName() {
24 return "cologneblue";
25 }
26
27 function doBeforeContent() {
28 global $wgOut, $wgTitle;
29
30 $s = "";
31 $qb = $this->qbSetting();
32 $mainPageObj = Title::newMainPage();
33
34 $s .= "\n<div id='content'>\n<div id='topbar'>" .
35 "<table width='100%' border='0' cellspacing='0' cellpadding='8'><tr>";
36
37 $s .= "<td class='top' align='left' valign='middle' nowrap='nowrap'>";
38 $s .= "<a href=\"" . $mainPageObj->escapeLocalURL() . "\">";
39 $s .= "<span id='sitetitle'>" . wfMsg( "sitetitle" ) . "</span></a>";
40
41 $s .= "</td><td class='top' align='right' valign='bottom' width='100%'>";
42 $s .= $this->sysLinks();
43 $s .= "</td></tr><tr><td valign='top'>";
44
45 $s .= "<font size='-1'><span id='sitesub'>";
46 $s .= htmlspecialchars( wfMsg( "sitesubtitle" ) ) . "</span></font>";
47 $s .= "</td><td align='right'>" ;
48
49 $s .= "<font size='-1'><span id='langlinks'>" ;
50 $s .= str_replace ( "<br />" , "" , $this->otherLanguages() );
51 $cat = $this->getCategoryLinks();
52 if( $cat ) $s .= "<br />$cat\n";
53 $s .= "<br />" . $this->pageTitleLinks();
54 $s .= "</span></font>";
55
56 $s .= "</td></tr></table>\n";
57
58 $s .= "\n</div>\n<div id='article'>";
59
60 $notice = wfGetSiteNotice();
61 if( $notice ) {
62 $s .= "\n<div id='siteNotice'>$notice</div>\n";
63 }
64 $s .= $this->pageTitle();
65 $s .= $this->pageSubtitle() . "\n";
66 return $s;
67 }
68
69 function doAfterContent()
70 {
71 global $wgOut;
72
73 $s = "\n</div><br clear='all' />\n";
74
75 $s .= "\n<div id='footer'>";
76 $s .= "<table width='98%' border='0' cellspacing='0'><tr>";
77
78 $qb = $this->qbSetting();
79 if ( 1 == $qb || 3 == $qb ) { # Left
80 $s .= $this->getQuickbarCompensator();
81 }
82 $s .= "<td class='bottom' align='center' valign='top'>";
83
84 $s .= $this->bottomLinks();
85 $s .= "\n<br />" . $this->makeKnownLink( wfMsgForContent( "mainpage" ) ) . " | "
86 . $this->aboutLink() . " | "
87 . $this->searchForm( wfMsg( "qbfind" ) );
88
89 $s .= "\n<br />" . $this->pageStats();
90
91 $s .= "</td>";
92 if ( 2 == $qb ) { # Right
93 $s .= $this->getQuickbarCompensator();
94 }
95 $s .= "</tr></table>\n</div>\n</div>\n";
96
97 if ( 0 != $qb ) { $s .= $this->quickBar(); }
98 return $s;
99 }
100
101 function doGetUserStyles() {
102 global $wgOut, $wgStyleSheetPath;
103 $s = parent::doGetUserStyles();
104 $qb = $this->qbSetting();
105
106 if ( 2 == $qb ) { # Right
107 $s .= "#quickbar { position: absolute; right: 4px; }\n" .
108 "#article { margin-left: 4px; margin-right: 148px; }\n";
109 } else if ( 1 == $qb ) {
110 $s .= "#quickbar { position: absolute; left: 4px; }\n" .
111 "#article { margin-left: 148px; margin-right: 4px; }\n";
112 } else if ( 3 == $qb ) { # Floating
113 $s .= "#quickbar { position:absolute; left:4px } \n" .
114 "#topbar { margin-left: 148px }\n" .
115 "#article { margin-left:148px; margin-right: 4px; } \n" .
116 "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;} \n"; # Hides from IE
117 }
118 return $s;
119 }
120
121 function sysLinks() {
122 global $wgUser, $wgContLang, $wgTitle;
123 $li = $wgContLang->specialPage("Userlogin");
124 $lo = $wgContLang->specialPage("Userlogout");
125
126 $rt = $wgTitle->getPrefixedURL();
127 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
128 $q = "";
129 } else {
130 $q = "returnto={$rt}";
131 }
132
133 $s = "" .
134 $this->makeKnownLink( wfMsgForContent( "mainpage" ), wfMsg( "mainpage" ) )
135 . " | " .
136 $this->makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) )
137 . " | " .
138 $this->makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) )
139 . " | " .
140 $this->makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") )
141 . " | " .
142 $this->specialLink( "specialpages" ) . " | ";
143
144 if ( $wgUser->isLoggedIn() ) {
145 $s .= $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
146 } else {
147 $s .= $this->makeKnownLink( $li, wfMsg( "login" ), $q );
148 }
149
150 /* show links to different language variants */
151 global $wgDisableLangConversion;
152 $variants = $wgContLang->getVariants();
153 if( !$wgDisableLangConversion && sizeof( $variants ) > 1 ) {
154 $actstr = '';
155 foreach( $variants as $code ) {
156 $varname = $wgContLang->getVariantname( $code );
157 if( $varname == 'disable' )
158 continue;
159 $s .= ' | <a href="' . $wgTitle->getLocalUrl( 'variant=' . $code ) . '">' . $varname . '</a>';
160 }
161 }
162
163
164
165 return $s;
166 }
167
168 /**
169 * Compute the sidebar
170 * @private
171 */
172 function quickBar()
173 {
174 global $wgOut, $wgTitle, $wgUser, $wgLang, $wgContLang, $wgEnableUploads;
175
176 $tns=$wgTitle->getNamespace();
177
178 $s = "\n<div id='quickbar'>";
179
180 $sep = "<br />";
181 $s .= $this->menuHead( "qbfind" );
182 $s .= $this->searchForm();
183
184 $s .= $this->menuHead( "qbbrowse" );
185
186 if ( $wgOut->isArticle() ) {
187 $s .= $this->menuHead( "qbedit" );
188 $s .= "<strong>" . $this->editThisPage() . "</strong>";
189
190 $s .= $sep . $this->makeKnownLink( wfMsgForContent( "edithelppage" ), wfMsg( "edithelp" ) );
191
192 if( $wgUser->isLoggedIn() ) {
193 $s .= $sep . $this->moveThisPage();
194 }
195 if ( $wgUser->isAllowed('delete') ) {
196 $dtp = $this->deleteThisPage();
197 if ( "" != $dtp ) {
198 $s .= $sep . $dtp;
199 }
200 }
201 if ( $wgUser->isAllowed('protect') ) {
202 $ptp = $this->protectThisPage();
203 if ( "" != $ptp ) {
204 $s .= $sep . $ptp;
205 }
206 }
207 $s .= $sep;
208
209 $s .= $this->menuHead( "qbpageoptions" );
210 $s .= $this->talkLink()
211 . $sep . $this->commentLink()
212 . $sep . $this->printableLink();
213 if ( $wgUser->isLoggedIn() ) {
214 $s .= $sep . $this->watchThisPage();
215 }
216
217 $s .= $sep;
218
219 $s .= $this->menuHead("qbpageinfo")
220 . $this->historyLink()
221 . $sep . $this->whatLinksHere()
222 . $sep . $this->watchPageLinksLink();
223
224 if( $tns == NS_USER || $tns == NS_USER_TALK ) {
225 $id=User::idFromName($wgTitle->getText());
226 if ($id != 0) {
227 $s .= $sep . $this->userContribsLink();
228 if( $this->showEmailUser( $id ) ) {
229 $s .= $sep . $this->emailUserLink();
230 }
231 }
232 }
233 $s .= $sep;
234 }
235
236 $s .= $this->menuHead( "qbmyoptions" );
237 if ( $wgUser->isLoggedIn() ) {
238 $name = $wgUser->getName();
239 $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
240 wfMsg( 'mytalk' ) );
241 if ( $wgUser->getNewtalk() ) {
242 $tl .= " *";
243 }
244
245 $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(),
246 wfMsg( "mypage" ) )
247 . $sep . $tl
248 . $sep . $this->specialLink( "watchlist" )
249 . $sep . $this->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, "Contributions" ),
250 wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) )
251 . $sep . $this->specialLink( "preferences" )
252 . $sep . $this->specialLink( "userlogout" );
253 } else {
254 $s .= $this->specialLink( "userlogin" );
255 }
256
257 $s .= $this->menuHead( "qbspecialpages" )
258 . $this->specialLink( "newpages" )
259 . $sep . $this->specialLink( "imagelist" )
260 . $sep . $this->specialLink( "statistics" )
261 . $sep . $this->bugReportsLink();
262 if ( $wgUser->isLoggedIn() && $wgEnableUploads ) {
263 $s .= $sep . $this->specialLink( "upload" );
264 }
265 global $wgSiteSupportPage;
266 if( $wgSiteSupportPage) {
267 $s .= $sep."<a href=\"".htmlspecialchars($wgSiteSupportPage)."\" class =\"internal\">"
268 .wfMsg( "sitesupport" )."</a>";
269 }
270
271 $s .= $sep . $this->makeKnownLinkObj(
272 Title::makeTitle( NS_SPECIAL, 'Specialpages' ),
273 wfMsg( 'moredotdotdot' ) );
274
275 $s .= $sep . "\n</div>\n";
276 return $s;
277 }
278
279 function menuHead( $key )
280 {
281 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
282 return $s;
283 }
284
285 function searchForm( $label = "" )
286 {
287 global $wgRequest;
288
289 $search = $wgRequest->getText( 'search' );
290 $action = $this->escapeSearchLink();
291 $s = "<form id=\"search\" method=\"get\" class=\"inline\" action=\"$action\">";
292 if ( "" != $label ) { $s .= "{$label}: "; }
293
294 $s .= "<input type='text' name=\"search\" size='14' value=\""
295 . htmlspecialchars(substr($search,0,256)) . "\" />"
296 . "<br /><input type='submit' name=\"go\" value=\"" . htmlspecialchars( wfMsg( "go" ) ) . "\" /> <input type='submit' name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" /></form>";
297
298 return $s;
299 }
300 }
301
302 ?>