3 * Cologne Blue: A nicer-looking alternative to Standard.
10 if( !defined( 'MEDIAWIKI' ) ) {
18 class SkinCologneBlue
extends Skin
{
20 function getStylesheet() {
21 return 'common/cologneblue.css';
24 function getSkinName() {
28 function doBeforeContent() {
29 $qb = $this->qbSetting();
30 $mainPageObj = Title
::newMainPage();
32 $s = "\n<div id='content'>\n<div id='topbar'>" .
33 '<table width="100%" border="0" cellspacing="0" cellpadding="8"><tr>';
35 $s .= '<td class="top" align="left" valign="middle" nowrap="nowrap">';
36 $s .= '<a href="' . $mainPageObj->escapeLocalURL() . '">';
37 $s .= '<span id="sitetitle">' . wfMsg( 'sitetitle' ) . '</span></a>';
39 $s .= '</td><td class="top" align="right" valign="bottom" width="100%">';
40 $s .= $this->sysLinks();
41 $s .= '</td></tr><tr><td valign="top">';
43 $s .= '<font size="-1"><span id="sitesub">';
44 $s .= htmlspecialchars( wfMsg( 'sitesubtitle' ) ) . '</span></font>';
45 $s .= '</td><td align="right">';
47 $s .= '<font size="-1"><span id="langlinks">';
48 $s .= str_replace( '<br />', '', $this->otherLanguages() );
49 $cat = $this->getCategoryLinks();
53 $s .= '<br />' . $this->pageTitleLinks();
54 $s .= '</span></font>';
56 $s .= "</td></tr></table>\n";
58 $s .= "\n</div>\n<div id='article'>";
60 $notice = wfGetSiteNotice();
62 $s .= "\n<div id='siteNotice'>$notice</div>\n";
64 $s .= $this->pageTitle();
65 $s .= $this->pageSubtitle() . "\n";
69 function doAfterContent(){
72 $s = "\n</div><br clear='all' />\n";
74 $s .= "\n<div id='footer'>";
75 $s .= '<table width="98%" border="0" cellspacing="0"><tr>';
77 $qb = $this->qbSetting();
78 if ( 1 == $qb ||
3 == $qb ) { # Left
79 $s .= $this->getQuickbarCompensator();
81 $s .= '<td class="bottom" align="center" valign="top">';
83 $s .= $this->bottomLinks();
84 $s .= $wgLang->pipeList( array(
85 "\n<br />" . $this->link(
90 array( 'known', 'noclasses' )
93 $this->searchForm( wfMsg( 'qbfind' ) )
96 $s .= "\n<br />" . $this->pageStats();
99 if ( 2 == $qb ) { # Right
100 $s .= $this->getQuickbarCompensator();
102 $s .= "</tr></table>\n</div>\n</div>\n";
105 $s .= $this->quickBar();
110 function reallyGenerateUserStylesheet() {
111 $s = parent
::reallyGenerateUserStylesheet();
112 $qb = $this->qbSetting();
114 if ( 2 == $qb ) { # Right
115 $s .= "#quickbar { position: absolute; right: 4px; }\n" .
116 "#article { margin-left: 4px; margin-right: 148px; }\n";
117 } elseif ( 1 == $qb ) {
118 $s .= "#quickbar { position: absolute; left: 4px; }\n" .
119 "#article { margin-left: 148px; margin-right: 4px; }\n";
120 } elseif ( 3 == $qb ) { # Floating left
121 $s .= "#quickbar { position:absolute; left:4px } \n" .
122 "#topbar { margin-left: 148px }\n" .
123 "#article { margin-left:148px; margin-right: 4px; } \n" .
124 "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;} \n"; # Hides from IE
125 } elseif ( 4 == $qb ) { # Floating right
126 $s .= "#quickbar { position: fixed; right: 4px; } \n" .
127 "#topbar { margin-right: 148px }\n" .
128 "#article { margin-right: 148px; margin-left: 4px; } \n" .
129 "body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto ;bottom:4px;} \n"; # Hides from IE
134 function sysLinks() {
135 global $wgUser, $wgLang, $wgContLang;
136 $li = SpecialPage
::getTitleFor( 'Userlogin' );
137 $lo = SpecialPage
::getTitleFor( 'Userlogout' );
139 $rt = $this->mTitle
->getPrefixedURL();
140 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
143 $q = array( 'returnto' => $rt );
147 $this->mainPageLink(),
149 Title
::newFromText( wfMsgForContent( 'aboutpage' ) ),
153 Title
::newFromText( wfMsgForContent( 'helppage' ) ),
157 Title
::newFromText( wfMsgForContent( 'faqpage' ) ),
160 $this->specialLink( 'specialpages' )
163 /* show links to different language variants */
164 if( $this->variantLinks() ) {
165 $s[] = $this->variantLinks();
167 if( $this->extensionTabLinks() ) {
168 $s[] = $this->extensionTabLinks();
170 if ( $wgUser->isLoggedIn() ) {
171 $s[] = $this->linkKnown(
178 $s[] = $this->linkKnown(
186 return $wgLang->pipeList( $s );
190 * Compute the sidebar
194 global $wgOut, $wgUser, $wgEnableUploads;
196 $tns = $this->mTitle
->getNamespace();
198 $s = "\n<div id='quickbar'>";
201 $s .= $this->menuHead( 'qbfind' );
202 $s .= $this->searchForm();
204 $s .= $this->menuHead( 'qbbrowse' );
206 # Use the first heading from the Monobook sidebar as the "browse" section
207 $bar = $this->buildSidebar();
208 unset( $bar['SEARCH'] );
209 unset( $bar['LANGUAGES'] );
210 unset( $bar['TOOLBOX'] );
211 $browseLinks = reset( $bar );
213 foreach ( $browseLinks as $link ) {
214 if ( $link['text'] != '-' ) {
215 $s .= "<a href=\"{$link['href']}\">" .
216 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
220 if ( $wgOut->isArticle() ) {
221 $s .= $this->menuHead( 'qbedit' );
222 $s .= '<strong>' . $this->editThisPage() . '</strong>';
224 $s .= $sep . $this->linkKnown(
225 Title
::newFromText( wfMsgForContent( 'edithelppage' ) ),
229 if( $wgUser->isLoggedIn() ) {
230 $s .= $sep . $this->moveThisPage();
232 if ( $wgUser->isAllowed( 'delete' ) ) {
233 $dtp = $this->deleteThisPage();
238 if ( $wgUser->isAllowed( 'protect' ) ) {
239 $ptp = $this->protectThisPage();
246 $s .= $this->menuHead( 'qbpageoptions' );
247 $s .= $this->talkLink()
248 . $sep . $this->commentLink()
249 . $sep . $this->printableLink();
250 if ( $wgUser->isLoggedIn() ) {
251 $s .= $sep . $this->watchThisPage();
256 $s .= $this->menuHead( 'qbpageinfo' )
257 . $this->historyLink()
258 . $sep . $this->whatLinksHere()
259 . $sep . $this->watchPageLinksLink();
261 if( $tns == NS_USER ||
$tns == NS_USER_TALK
) {
262 $id = User
::idFromName( $this->mTitle
->getText() );
264 $s .= $sep . $this->userContribsLink();
265 if( $this->showEmailUser( $id ) ) {
266 $s .= $sep . $this->emailUserLink();
273 $s .= $this->menuHead( 'qbmyoptions' );
274 if ( $wgUser->isLoggedIn() ) {
275 $name = $wgUser->getName();
277 $wgUser->getTalkPage(),
281 array( 'known', 'noclasses' )
283 if ( $wgUser->getNewtalk() ) {
288 $wgUser->getUserPage(),
292 array( 'known', 'noclasses' )
293 ) . $sep . $tl . $sep . $this->specialLink( 'watchlist' )
296 SpecialPage
::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
297 wfMsg( 'mycontris' ),
300 array( 'known', 'noclasses' )
301 ) . $sep . $this->specialLink( 'preferences' )
302 . $sep . $this->specialLink( 'userlogout' );
304 $s .= $this->specialLink( 'userlogin' );
307 $s .= $this->menuHead( 'qbspecialpages' )
308 . $this->specialLink( 'newpages' )
309 . $sep . $this->specialLink( 'listfiles' )
310 . $sep . $this->specialLink( 'statistics' );
311 if ( $wgUser->isLoggedIn() && $wgEnableUploads ) {
312 $s .= $sep . $this->specialLink( 'upload' );
315 global $wgSiteSupportPage;
317 if( $wgSiteSupportPage ) {
318 $s .= $sep . '<a href="' . htmlspecialchars( $wgSiteSupportPage ) . '" class="internal">'
319 . wfMsg( 'sitesupport' ) . '</a>';
322 $s .= $sep . $this->link(
323 SpecialPage
::getTitleFor( 'Specialpages' ),
324 wfMsg( 'moredotdotdot' ),
327 array( 'known', 'noclasses' )
330 $s .= $sep . "\n</div>\n";
334 function menuHead( $key ) {
335 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
339 function searchForm( $label = '' ) {
340 global $wgRequest, $wgUseTwoButtonsSearchForm;
342 $search = $wgRequest->getText( 'search' );
343 $action = $this->escapeSearchLink();
344 $s = "<form id=\"searchform{$this->searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">";
349 $s .= "<input type='text' id=\"searchInput{$this->searchboxes}\" class=\"mw-searchInput\" name=\"search\" size=\"14\" value=\""
350 . htmlspecialchars( substr( $search, 0, 256 ) ) . "\" /><br />"
351 . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( 'searcharticle' ) ) . "\" />";
353 if( $wgUseTwoButtonsSearchForm ) {
354 $s .= "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( 'search' ) ) . "\" />\n";
356 $s .= '<div><a href="' . $action . '" rel="search">' . wfMsg( 'powersearch-legend' ) . "</a></div>\n";
361 // Ensure unique id's for search boxes made after the first
362 $this->searchboxes
= $this->searchboxes
== '' ?
2 : $this->searchboxes +
1;