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 $mainPageObj = Title
::newMainPage();
31 $s = "\n<div id='content'>\n<div id='topbar'>" .
32 '<table width="100%" border="0" cellspacing="0" cellpadding="8"><tr>';
34 $s .= '<td class="top" align="left" valign="middle" nowrap="nowrap">';
35 $s .= '<a href="' . $mainPageObj->escapeLocalURL() . '">';
36 $s .= '<span id="sitetitle">' . wfMsg( 'sitetitle' ) . '</span></a>';
38 $s .= '</td><td class="top" align="right" valign="bottom" width="100%">';
39 $s .= $this->sysLinks();
40 $s .= '</td></tr><tr><td valign="top">';
42 $s .= '<font size="-1"><span id="sitesub">';
43 $s .= htmlspecialchars( wfMsg( 'sitesubtitle' ) ) . '</span></font>';
44 $s .= '</td><td align="right">';
46 $s .= '<font size="-1"><span id="langlinks">';
47 $s .= str_replace( '<br />', '', $this->otherLanguages() );
48 $cat = $this->getCategoryLinks();
52 $s .= '<br />' . $this->pageTitleLinks();
53 $s .= '</span></font>';
55 $s .= "</td></tr></table>\n";
57 $s .= "\n</div>\n<div id='article'>";
59 $notice = wfGetSiteNotice();
61 $s .= "\n<div id='siteNotice'>$notice</div>\n";
63 $s .= $this->pageTitle();
64 $s .= $this->pageSubtitle() . "\n";
68 function doAfterContent(){
71 $s = "\n</div><br clear='all' />\n";
73 $s .= "\n<div id='footer'>";
74 $s .= '<table width="98%" border="0" cellspacing="0"><tr>';
76 $qb = $this->qbSetting();
77 if ( 1 == $qb ||
3 == $qb ) { # Left
78 $s .= $this->getQuickbarCompensator();
80 $s .= '<td class="bottom" align="center" valign="top">';
82 $s .= $this->bottomLinks();
83 $s .= $wgLang->pipeList( array(
84 "\n<br />" . $this->link(
89 array( 'known', 'noclasses' )
92 $this->searchForm( wfMsg( 'qbfind' ) )
95 $s .= "\n<br />" . $this->pageStats();
98 if ( 2 == $qb ) { # Right
99 $s .= $this->getQuickbarCompensator();
101 $s .= "</tr></table>\n</div>\n</div>\n";
104 $s .= $this->quickBar();
109 function setupSkinUserCss( OutputPage
$out ){
111 $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 );
135 parent
::setupSkinUserCss( $out );
138 function sysLinks() {
139 global $wgUser, $wgLang;
140 $li = SpecialPage
::getTitleFor( 'Userlogin' );
141 $lo = SpecialPage
::getTitleFor( 'Userlogout' );
143 $rt = $this->mTitle
->getPrefixedURL();
144 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
147 $q = array( 'returnto' => $rt );
151 $this->mainPageLink(),
153 Title
::newFromText( wfMsgForContent( 'aboutpage' ) ),
157 Title
::newFromText( wfMsgForContent( 'helppage' ) ),
161 Title
::newFromText( wfMsgForContent( 'faqpage' ) ),
164 $this->specialLink( 'Specialpages' )
167 /* show links to different language variants */
168 if( $this->variantLinks() ) {
169 $s[] = $this->variantLinks();
171 if( $this->extensionTabLinks() ) {
172 $s[] = $this->extensionTabLinks();
174 if ( $wgUser->isLoggedIn() ) {
175 $s[] = $this->linkKnown(
182 $s[] = $this->linkKnown(
190 return $wgLang->pipeList( $s );
194 * Compute the sidebar
198 global $wgOut, $wgUser;
200 $tns = $this->mTitle
->getNamespace();
202 $s = "\n<div id='quickbar'>";
205 $s .= $this->menuHead( 'qbfind' );
206 $s .= $this->searchForm();
208 $s .= $this->menuHead( 'qbbrowse' );
210 # Use the first heading from the Monobook sidebar as the "browse" section
211 $bar = $this->buildSidebar();
212 unset( $bar['SEARCH'] );
213 unset( $bar['LANGUAGES'] );
214 unset( $bar['TOOLBOX'] );
215 $browseLinks = reset( $bar );
217 foreach ( $browseLinks as $link ) {
218 if ( $link['text'] != '-' ) {
219 $s .= "<a href=\"{$link['href']}\">" .
220 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
224 if ( $wgOut->isArticle() ) {
225 $s .= $this->menuHead( 'qbedit' );
226 $s .= '<strong>' . $this->editThisPage() . '</strong>';
228 $s .= $sep . $this->linkKnown(
229 Title
::newFromText( wfMsgForContent( 'edithelppage' ) ),
233 if( $wgUser->isLoggedIn() ) {
234 $s .= $sep . $this->moveThisPage();
236 if ( $wgUser->isAllowed( 'delete' ) ) {
237 $dtp = $this->deleteThisPage();
242 if ( $wgUser->isAllowed( 'protect' ) ) {
243 $ptp = $this->protectThisPage();
250 $s .= $this->menuHead( 'qbpageoptions' );
251 $s .= $this->talkLink()
252 . $sep . $this->commentLink()
253 . $sep . $this->printableLink();
254 if ( $wgUser->isLoggedIn() ) {
255 $s .= $sep . $this->watchThisPage();
260 $s .= $this->menuHead( 'qbpageinfo' )
261 . $this->historyLink()
262 . $sep . $this->whatLinksHere()
263 . $sep . $this->watchPageLinksLink();
265 if( $tns == NS_USER ||
$tns == NS_USER_TALK
) {
266 $id = User
::idFromName( $this->mTitle
->getText() );
268 $s .= $sep . $this->userContribsLink();
269 if( $this->showEmailUser( $id ) ) {
270 $s .= $sep . $this->emailUserLink();
277 $s .= $this->menuHead( 'qbmyoptions' );
278 if ( $wgUser->isLoggedIn() ) {
280 $wgUser->getTalkPage(),
284 array( 'known', 'noclasses' )
286 if ( $wgUser->getNewtalk() ) {
291 $wgUser->getUserPage(),
295 array( 'known', 'noclasses' )
296 ) . $sep . $tl . $sep . $this->specialLink( 'Watchlist' )
299 SpecialPage
::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
300 wfMsg( 'mycontris' ),
303 array( 'known', 'noclasses' )
304 ) . $sep . $this->specialLink( 'Preferences' )
305 . $sep . $this->specialLink( 'Userlogout' );
307 $s .= $this->specialLink( 'Userlogin' );
310 $s .= $this->menuHead( 'qbspecialpages' )
311 . $this->specialLink( 'Newpages' )
312 . $sep . $this->specialLink( 'Listfiles' )
313 . $sep . $this->specialLink( 'Statistics' );
314 if( UploadBase
::isEnabled() && UploadBase
::isAllowed( $wgUser ) === true ) {
315 $s .= $sep . $this->getUploadLink();
318 global $wgSiteSupportPage;
320 if( $wgSiteSupportPage ) {
321 $s .= $sep . '<a href="' . htmlspecialchars( $wgSiteSupportPage ) . '" class="internal">'
322 . wfMsg( 'sitesupport' ) . '</a>';
325 $s .= $sep . $this->link(
326 SpecialPage
::getTitleFor( 'Specialpages' ),
327 wfMsg( 'moredotdotdot' ),
330 array( 'known', 'noclasses' )
333 $s .= $sep . "\n</div>\n";
337 function menuHead( $key ) {
338 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
342 function searchForm( $label = '' ) {
343 global $wgRequest, $wgUseTwoButtonsSearchForm;
345 $search = $wgRequest->getText( 'search' );
346 $action = $this->escapeSearchLink();
347 $s = "<form id=\"searchform{$this->searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">";
352 $s .= "<input type='text' id=\"searchInput{$this->searchboxes}\" class=\"mw-searchInput\" name=\"search\" size=\"14\" value=\""
353 . htmlspecialchars( substr( $search, 0, 256 ) ) . "\" /><br />"
354 . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( 'searcharticle' ) ) . "\" />";
356 if( $wgUseTwoButtonsSearchForm ) {
357 $s .= "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( 'search' ) ) . "\" />\n";
359 $s .= '<div><a href="' . $action . '" rel="search">' . wfMsg( 'powersearch-legend' ) . "</a></div>\n";
364 // Ensure unique id's for search boxes made after the first
365 $this->searchboxes
= $this->searchboxes
== '' ?
2 : $this->searchboxes +
1;