3 * Cologne Blue: A nicer-looking alternative to Standard.
10 if( !defined( 'MEDIAWIKI' ) ) {
18 class SkinCologneBlue
extends Skin
{
20 function getSkinName() {
24 function doBeforeContent() {
25 $mainPageObj = Title
::newMainPage();
27 $s = "\n<div id='content'>\n<div id='topbar'>" .
28 '<table width="100%" border="0" cellspacing="0" cellpadding="8"><tr>';
30 $s .= '<td class="top" nowrap="nowrap">';
31 $s .= '<a href="' . $mainPageObj->escapeLocalURL() . '">';
32 $s .= '<span id="sitetitle">' . wfMsg( 'sitetitle' ) . '</span></a>';
34 $s .= '</td><td class="top" id="top-syslinks" width="100%">';
35 $s .= $this->sysLinks();
36 $s .= '</td></tr><tr><td class="top-linkcollection">';
38 $s .= '<font size="-1"><span id="sitesub">';
39 $s .= htmlspecialchars( wfMsg( 'sitesubtitle' ) ) . '</span></font>';
40 $s .= '</td><td class="top-linkcollection">';
42 $s .= '<font size="-1"><span id="langlinks">';
43 $s .= str_replace( '<br />', '', $this->otherLanguages() );
44 $cat = $this->getCategoryLinks();
48 $s .= '<br />' . $this->pageTitleLinks();
49 $s .= '</span></font>';
51 $s .= "</td></tr></table>\n";
53 $s .= "\n</div>\n<div id='article'>";
55 $notice = wfGetSiteNotice();
57 $s .= "\n<div id='siteNotice'>$notice</div>\n";
59 $s .= $this->pageTitle();
60 $s .= $this->pageSubtitle() . "\n";
64 function doAfterContent(){
67 $s = "\n</div><br clear='all' />\n";
69 $s .= "\n<div id='footer'>";
70 $s .= '<table width="98%" border="0" cellspacing="0"><tr>';
72 $qb = $this->qbSetting();
73 if ( 1 == $qb ||
3 == $qb ) { # Left
74 $s .= $this->getQuickbarCompensator();
76 $s .= '<td class="bottom">';
78 $s .= $this->bottomLinks();
79 $s .= $wgLang->pipeList( array(
80 "\n<br />" . $this->link(
85 array( 'known', 'noclasses' )
88 $this->searchForm( wfMsg( 'qbfind' ) )
91 $s .= "\n<br />" . $this->pageStats();
94 if ( 2 == $qb ) { # Right
95 $s .= $this->getQuickbarCompensator();
97 $s .= "</tr></table>\n</div>\n</div>\n";
100 $s .= $this->quickBar();
105 function setupSkinUserCss( OutputPage
$out ){
106 parent
::setupSkinUserCss( $out );
107 $out->addModuleStyles( 'skins.cologneblue' );
110 $qb = $this->qbSetting();
113 if ( 2 == $qb ) { # Right
114 $rules[] = "#quickbar { position: absolute; right: 4px; }";
115 $rules[] = "#article { margin-left: 4px; margin-right: 148px; }";
116 } elseif ( 1 == $qb ) {
117 $rules[] = "#quickbar { position: absolute; left: 4px; }";
118 $rules[] = "#article { margin-left: 148px; margin-right: 4px; }";
119 } elseif ( 3 == $qb ) { # Floating left
120 $rules[] = "#quickbar { position:absolute; left:4px }";
121 $rules[] = "#topbar { margin-left: 148px }";
122 $rules[] = "#article { margin-left:148px; margin-right: 4px; }";
123 $rules[] = "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;}"; # Hides from IE
124 } elseif ( 4 == $qb ) { # Floating right
125 $rules[] = "#quickbar { position: fixed; right: 4px; }";
126 $rules[] = "#topbar { margin-right: 148px }";
127 $rules[] = "#article { margin-right: 148px; margin-left: 4px; }";
128 $rules[] = "body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto ;bottom:4px;}"; # Hides from IE
130 $style = implode( "\n", $rules );
131 if ( $wgContLang->getDir() === 'rtl' ) {
132 $style = CSSJanus
::transform( $style, true, false );
134 $out->addInlineStyle( $style );
137 function sysLinks() {
138 global $wgUser, $wgLang;
139 $li = SpecialPage
::getTitleFor( 'Userlogin' );
140 $lo = SpecialPage
::getTitleFor( 'Userlogout' );
142 $rt = $this->mTitle
->getPrefixedURL();
143 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
146 $q = array( 'returnto' => $rt );
150 $this->mainPageLink(),
152 Title
::newFromText( wfMsgForContent( 'aboutpage' ) ),
156 Title
::newFromText( wfMsgForContent( 'helppage' ) ),
160 Title
::newFromText( wfMsgForContent( 'faqpage' ) ),
163 $this->specialLink( 'Specialpages' )
166 /* show links to different language variants */
167 if( $this->variantLinks() ) {
168 $s[] = $this->variantLinks();
170 if( $this->extensionTabLinks() ) {
171 $s[] = $this->extensionTabLinks();
173 if ( $wgUser->isLoggedIn() ) {
174 $s[] = $this->linkKnown(
181 $s[] = $this->linkKnown(
189 return $wgLang->pipeList( $s );
193 * Compute the sidebar
197 global $wgOut, $wgUser;
199 $tns = $this->mTitle
->getNamespace();
201 $s = "\n<div id='quickbar'>";
204 $s .= $this->menuHead( 'qbfind' );
205 $s .= $this->searchForm();
207 $s .= $this->menuHead( 'qbbrowse' );
209 # Use the first heading from the Monobook sidebar as the "browse" section
210 $bar = $this->buildSidebar();
211 unset( $bar['SEARCH'] );
212 unset( $bar['LANGUAGES'] );
213 unset( $bar['TOOLBOX'] );
214 $browseLinks = reset( $bar );
216 foreach ( $browseLinks as $link ) {
217 if ( $link['text'] != '-' ) {
218 $s .= "<a href=\"{$link['href']}\">" .
219 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
223 if ( $wgOut->isArticle() ) {
224 $s .= $this->menuHead( 'qbedit' );
225 $s .= '<strong>' . $this->editThisPage() . '</strong>';
227 $s .= $sep . $this->linkKnown(
228 Title
::newFromText( wfMsgForContent( 'edithelppage' ) ),
232 if( $wgUser->isLoggedIn() ) {
233 $s .= $sep . $this->moveThisPage();
235 if ( $wgUser->isAllowed( 'delete' ) ) {
236 $dtp = $this->deleteThisPage();
241 if ( $wgUser->isAllowed( 'protect' ) ) {
242 $ptp = $this->protectThisPage();
249 $s .= $this->menuHead( 'qbpageoptions' );
250 $s .= $this->talkLink()
251 . $sep . $this->commentLink()
252 . $sep . $this->printableLink();
253 if ( $wgUser->isLoggedIn() ) {
254 $s .= $sep . $this->watchThisPage();
259 $s .= $this->menuHead( 'qbpageinfo' )
260 . $this->historyLink()
261 . $sep . $this->whatLinksHere()
262 . $sep . $this->watchPageLinksLink();
264 if( $tns == NS_USER ||
$tns == NS_USER_TALK
) {
265 $id = User
::idFromName( $this->mTitle
->getText() );
267 $s .= $sep . $this->userContribsLink();
268 if( $this->showEmailUser( $id ) ) {
269 $s .= $sep . $this->emailUserLink();
276 $s .= $this->menuHead( 'qbmyoptions' );
277 if ( $wgUser->isLoggedIn() ) {
279 $wgUser->getTalkPage(),
283 array( 'known', 'noclasses' )
285 if ( $wgUser->getNewtalk() ) {
290 $wgUser->getUserPage(),
294 array( 'known', 'noclasses' )
295 ) . $sep . $tl . $sep . $this->specialLink( 'Watchlist' )
298 SpecialPage
::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
299 wfMsg( 'mycontris' ),
302 array( 'known', 'noclasses' )
303 ) . $sep . $this->specialLink( 'Preferences' )
304 . $sep . $this->specialLink( 'Userlogout' );
306 $s .= $this->specialLink( 'Userlogin' );
309 $s .= $this->menuHead( 'qbspecialpages' )
310 . $this->specialLink( 'Newpages' )
311 . $sep . $this->specialLink( 'Listfiles' )
312 . $sep . $this->specialLink( 'Statistics' );
313 if( UploadBase
::isEnabled() && UploadBase
::isAllowed( $wgUser ) === true ) {
314 $s .= $sep . $this->getUploadLink();
317 global $wgSiteSupportPage;
319 if( $wgSiteSupportPage ) {
320 $s .= $sep . '<a href="' . htmlspecialchars( $wgSiteSupportPage ) . '" class="internal">'
321 . wfMsg( 'sitesupport' ) . '</a>';
324 $s .= $sep . $this->link(
325 SpecialPage
::getTitleFor( 'Specialpages' ),
326 wfMsg( 'moredotdotdot' ),
329 array( 'known', 'noclasses' )
332 $s .= $sep . "\n</div>\n";
336 function menuHead( $key ) {
337 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
341 function searchForm( $label = '' ) {
342 global $wgRequest, $wgUseTwoButtonsSearchForm;
344 $search = $wgRequest->getText( 'search' );
345 $action = $this->escapeSearchLink();
346 $s = "<form id=\"searchform{$this->searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">";
351 $s .= "<input type='text' id=\"searchInput{$this->searchboxes}\" class=\"mw-searchInput\" name=\"search\" size=\"14\" value=\""
352 . htmlspecialchars( substr( $search, 0, 256 ) ) . "\" /><br />"
353 . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( 'searcharticle' ) ) . "\" />";
355 if( $wgUseTwoButtonsSearchForm ) {
356 $s .= "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( 'search' ) ) . "\" />\n";
358 $s .= '<div><a href="' . $action . '" rel="search">' . wfMsg( 'powersearch-legend' ) . "</a></div>\n";
363 // Ensure unique id's for search boxes made after the first
364 $this->searchboxes
= $this->searchboxes
== '' ?
2 : $this->searchboxes +
1;