<?php
-# See skin.doc
-
+/**
+ * See skin.txt
+ *
+ * @todo document
+ * @package MediaWiki
+ * @subpackage Skins
+ */
+
+if( !defined( 'MEDIAWIKI' ) )
+ die();
+
+/**
+ * @todo document
+ * @package MediaWiki
+ * @subpackage Skins
+ */
class SkinCologneBlue extends Skin {
- function getStylesheet()
- {
- return "cologneblue.css";
+ function getStylesheet() {
+ return "common/cologneblue.css";
}
function getSkinName() {
return "cologneblue";
}
- function doBeforeContent()
- {
- global $wgUser, $wgOut, $wgTitle, $wgSiteNotice;
+ function doBeforeContent() {
+ global $wgOut, $wgTitle;
$s = "";
$qb = $this->qbSetting();
$s .= "</td><td align='right'>" ;
$s .= "<font size='-1'><span id='langlinks'>" ;
- $s .= str_replace ( "<br>" , "" , $this->otherLanguages() );
+ $s .= str_replace ( "<br />" , "" , $this->otherLanguages() );
$cat = $this->getCategoryLinks();
if( $cat ) $s .= "<br />$cat\n";
$s .= "<br />" . $this->pageTitleLinks();
$s .= "\n</div>\n<div id='article'>";
- if( $wgSiteNotice ) {
- $s .= "\n<div id='siteNotice'>$wgSiteNotice</div>\n";
+ $notice = wfGetSiteNotice();
+ if( $notice ) {
+ $s .= "\n<div id='siteNotice'>$notice</div>\n";
}
$s .= $this->pageTitle();
$s .= $this->pageSubtitle() . "\n";
function doAfterContent()
{
- global $wgUser, $wgOut;
+ global $wgOut;
$s = "\n</div><br clear='all' />\n";
$s .= "<td class='bottom' align='center' valign='top'>";
$s .= $this->bottomLinks();
- $s .= "\n<br />" . $this->makeKnownLink( wfMsg( "mainpage" ) ) . " | "
+ $s .= "\n<br />" . $this->makeKnownLink( wfMsgForContent( "mainpage" ) ) . " | "
. $this->aboutLink() . " | "
. $this->searchForm( wfMsg( "qbfind" ) );
if ( 0 != $qb ) { $s .= $this->quickBar(); }
return $s;
}
- function doGetUserStyles()
- {
- global $wgUser, $wgOut, $wgStyleSheetPath;
- $s = '';
+
+ function doGetUserStyles() {
+ global $wgOut, $wgStyleSheetPath;
+ $s = parent::doGetUserStyles();
$qb = $this->qbSetting();
if ( 2 == $qb ) { # Right
} else if ( 1 == $qb ) {
$s .= "#quickbar { position: absolute; left: 4px; }\n" .
"#article { margin-left: 148px; margin-right: 4px; }\n";
- } else if ( 3 == $qb ) { # Floating
+ } else if ( 3 == $qb ) { # Floating left
$s .= "#quickbar { position:absolute; left:4px } \n" .
"#topbar { margin-left: 148px }\n" .
"#article { margin-left:148px; margin-right: 4px; } \n" .
"body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;} \n"; # Hides from IE
+ } else if ( 4 == $qb ) { # Floating right
+ $s .= "#quickbar { position: fixed; right: 4px; } \n" .
+ "#topbar { margin-right: 148px }\n" .
+ "#article { margin-right: 148px; margin-left: 4px; } \n" .
+ "body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto ;bottom:4px;} \n"; # Hides from IE
}
- $s .= parent::doGetUserStyles();
return $s;
}
- function sysLinks()
- {
- global $wgUser, $wgLang, $wgTitle;
- $li = $wgLang->specialPage("Userlogin");
- $lo = $wgLang->specialPage("Userlogout");
+
+ function sysLinks() {
+ global $wgUser, $wgContLang, $wgTitle;
+ $li = $wgContLang->specialPage("Userlogin");
+ $lo = $wgContLang->specialPage("Userlogout");
$rt = $wgTitle->getPrefixedURL();
if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
}
$s = "" .
- $this->makeKnownLink( wfMsg( "mainpage" ), wfMsg( "mainpage" ) )
+ $this->makeKnownLink( wfMsgForContent( "mainpage" ), wfMsg( "mainpage" ) )
. " | " .
- $this->makeKnownLink( wfMsg( "aboutpage" ), wfMsg( "about" ) )
+ $this->makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) )
. " | " .
- $this->makeKnownLink( wfMsg( "helppage" ), wfMsg( "help" ) )
+ $this->makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) )
. " | " .
- $this->makeKnownLink( wfMsg( "faqpage" ), wfMsg("faq") )
+ $this->makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") )
. " | " .
$this->specialLink( "specialpages" ) . " | ";
- if ( $wgUser->getID() )
- {
+ if ( $wgUser->isLoggedIn() ) {
$s .= $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
- }
- else
- {
+ } else {
$s .= $this->makeKnownLink( $li, wfMsg( "login" ), $q );
}
+ /* show links to different language variants */
+ global $wgDisableLangConversion;
+ $variants = $wgContLang->getVariants();
+ if( !$wgDisableLangConversion && sizeof( $variants ) > 1 ) {
+ $actstr = '';
+ foreach( $variants as $code ) {
+ $varname = $wgContLang->getVariantname( $code );
+ if( $varname == 'disable' )
+ continue;
+ $s .= ' | <a href="' . $wgTitle->getLocalUrl( 'variant=' . $code ) . '">' . $varname . '</a>';
+ }
+ }
+
+
+
return $s;
}
+ /**
+ * Compute the sidebar
+ * @private
+ */
function quickBar()
{
- global $wgOut, $wgTitle, $wgUser, $wgLang, $wgDisableUploads;
+ global $wgOut, $wgTitle, $wgUser, $wgLang, $wgContLang, $wgEnableUploads;
$tns=$wgTitle->getNamespace();
$s .= $this->menuHead( "qbfind" );
$s .= $this->searchForm();
- $s .= $this->menuHead( "qbbrowse" )
- . $this->mainPageLink()
- . $sep . $this->specialLink( "recentchanges" )
- . $sep . $this->specialLink( "randompage" );
- if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
- $s .= "\n";
+ $s .= $this->menuHead( "qbbrowse" );
+ # Use the first heading from the Monobook sidebar as the "browse" section
+ $bar = $this->buildSidebar();
+ $browseLinks = reset( $bar );
+
+ foreach ( $browseLinks as $link ) {
+ if ( $link['text'] != '-' ) {
+ $s .= "<a href=\"{$link['href']}\">" .
+ htmlspecialchars( $link['text'] ) . '</a>' . $sep;
+ }
+ }
+
if ( $wgOut->isArticle() ) {
$s .= $this->menuHead( "qbedit" );
$s .= "<strong>" . $this->editThisPage() . "</strong>";
- $s .= $sep . $this->makeKnownLink( wfMsg( "edithelppage" ), wfMsg( "edithelp" ) );
+ $s .= $sep . $this->makeKnownLink( wfMsgForContent( "edithelppage" ), wfMsg( "edithelp" ) );
- if ( 0 != $wgUser->getID() ) {
+ if( $wgUser->isLoggedIn() ) {
$s .= $sep . $this->moveThisPage();
}
- if ( $wgUser->isSysop() ) {
+ if ( $wgUser->isAllowed('delete') ) {
$dtp = $this->deleteThisPage();
if ( "" != $dtp ) {
$s .= $sep . $dtp;
}
+ }
+ if ( $wgUser->isAllowed('protect') ) {
$ptp = $this->protectThisPage();
if ( "" != $ptp ) {
$s .= $sep . $ptp;
$s .= $this->talkLink()
. $sep . $this->commentLink()
. $sep . $this->printableLink();
- if ( 0 != $wgUser->getID() ) {
+ if ( $wgUser->isLoggedIn() ) {
$s .= $sep . $this->watchThisPage();
}
. $sep . $this->whatLinksHere()
. $sep . $this->watchPageLinksLink();
- if ( Namespace::getUser() == $tns || Namespace::getTalk(Namespace::getUser()) == $tns ) {
+ if( $tns == NS_USER || $tns == NS_USER_TALK ) {
$id=User::idFromName($wgTitle->getText());
if ($id != 0) {
$s .= $sep . $this->userContribsLink();
- if ( 0 != $wgUser->getID() ) {
+ if( $this->showEmailUser( $id ) ) {
$s .= $sep . $this->emailUserLink();
}
}
}
$s .= $this->menuHead( "qbmyoptions" );
- if ( 0 != $wgUser->getID() ) {
+ if ( $wgUser->isLoggedIn() ) {
$name = $wgUser->getName();
- $tl = $this->makeKnownLink( $wgLang->getNsText(
- Namespace::getTalk( Namespace::getUser() ) ) . ":{$name}",
- wfMsg( "mytalk" ) );
- if ( 0 != $wgUser->getNewtalk() ) { $tl .= " *"; }
+ $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
+ wfMsg( 'mytalk' ) );
+ if ( $wgUser->getNewtalk() ) {
+ $tl .= " *";
+ }
- $s .= $this->makeKnownLink( $wgLang->getNsText(
- Namespace::getUser() ) . ":{$name}", wfMsg( "mypage" ) )
+ $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(),
+ wfMsg( "mypage" ) )
. $sep . $tl
. $sep . $this->specialLink( "watchlist" )
- . $sep . $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
+ . $sep . $this->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, "Contributions" ),
wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) )
. $sep . $this->specialLink( "preferences" )
. $sep . $this->specialLink( "userlogout" );
. $sep . $this->specialLink( "imagelist" )
. $sep . $this->specialLink( "statistics" )
. $sep . $this->bugReportsLink();
- if ( 0 != $wgUser->getID() && !$wgDisableUploads ) {
+ if ( $wgUser->isLoggedIn() && $wgEnableUploads ) {
$s .= $sep . $this->specialLink( "upload" );
}
global $wgSiteSupportPage;
.wfMsg( "sitesupport" )."</a>";
}
- $s .= $sep . $this->makeKnownLink( $wgLang->specialPage( "Specialpages" ), wfMsg("moredotdotdot") );
+ $s .= $sep . $this->makeKnownLinkObj(
+ Title::makeTitle( NS_SPECIAL, 'Specialpages' ),
+ wfMsg( 'moredotdotdot' ) );
$s .= $sep . "\n</div>\n";
return $s;