addModuleStyles( 'skins.cologneblue' );
$qb = $this->qbSetting();
$rules = array();
if ( 2 == $qb ) { # Right
$rules[] = "/* @noflip */#quickbar { position: absolute; right: 4px; }";
$rules[] = "/* @noflip */#article { margin-left: 4px; margin-right: 148px; }";
$rules[] = "/* @noflip */#footer { margin-right: 152px; }";
} elseif ( 1 == $qb ) {
$rules[] = "/* @noflip */#quickbar { position: absolute; left: 4px; }";
$rules[] = "/* @noflip */#article { margin-left: 148px; margin-right: 4px; }";
$rules[] = "/* @noflip */#footer { margin-left: 152px; }";
} elseif ( 3 == $qb ) { # Floating left
$rules[] = "/* @noflip */#quickbar { position:absolute; left:4px }";
$rules[] = "/* @noflip */#topbar { margin-left: 148px }";
$rules[] = "/* @noflip */#article { margin-left:148px; margin-right: 4px; }";
$rules[] = "/* @noflip */body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto; bottom:4px;}"; # Hides from IE
$rules[] = "/* @noflip */#footer { margin-left: 152px; }";
} elseif ( 4 == $qb ) { # Floating right
$rules[] = "/* @noflip */#quickbar { position: fixed; right: 4px; }";
$rules[] = "/* @noflip */#topbar { margin-right: 148px }";
$rules[] = "/* @noflip */#article { margin-right: 148px; margin-left: 4px; }";
$rules[] = "/* @noflip */body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto; bottom:4px;}"; # Hides from IE
$rules[] = "/* @noflip */#footer { margin-right: 152px; }";
}
$style = implode( "\n", $rules );
$out->addInlineStyle( $style, 'flip' );
}
}
class CologneBlueTemplate extends LegacyTemplate {
/**
* @return string
*/
function doBeforeContent() {
$mainPageObj = Title::newMainPage();
$s = "\n
\n
" .
'
';
$s .= '';
$s .= '';
$s .= '' . wfMsg( 'sitetitle' ) . '';
$s .= ' | ';
$s .= $this->sysLinks();
$s .= ' |
';
$s .= '';
$s .= str_replace( ' ', '', $this->otherLanguages() );
$s .= $this->getSkin()->getCategories();
$s .= ' ' . $this->pageTitleLinks();
$s .= '';
$s .= " |
\n";
$s .= "\n
\n
";
$notice = $this->getSkin()->getSiteNotice();
if( $notice ) {
$s .= "\n
$notice
\n";
}
$s .= $this->pageTitle();
$s .= $this->pageSubtitle() . "\n";
return $s;
}
/**
* @return string
*/
function doAfterContent(){
$s = "\n
\n";
$s .= "\n\n
\n";
if ( $this->getSkin()->qbSetting() != 0 ) {
$s .= $this->quickBar();
}
return $s;
}
/**
* @return string
*/
function sysLinks() {
$li = SpecialPage::getTitleFor( 'Userlogin' );
$lo = SpecialPage::getTitleFor( 'Userlogout' );
$rt = $this->getSkin()->getTitle()->getPrefixedURL();
if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
$q = array();
} else {
$q = array( 'returnto' => $rt );
}
$s = array(
$this->getSkin()->mainPageLink(),
Linker::linkKnown(
Title::newFromText( wfMsgForContent( 'aboutpage' ) ),
wfMsg( 'about' )
),
Linker::linkKnown(
Title::newFromText( wfMsgForContent( 'helppage' ) ),
wfMsg( 'help' )
),
Linker::linkKnown(
Title::newFromText( wfMsgForContent( 'faqpage' ) ),
wfMsg( 'faq' )
),
Linker::specialLink( 'Specialpages' )
);
/* show links to different language variants */
if( $this->variantLinks() ) {
$s[] = $this->variantLinks();
}
if( $this->extensionTabLinks() ) {
$s[] = $this->extensionTabLinks();
}
if ( $this->data['loggedin'] ) {
$s[] = Linker::linkKnown(
$lo,
wfMsg( 'logout' ),
array(),
$q
);
} else {
$s[] = Linker::linkKnown(
$li,
wfMsg( 'login' ),
array(),
$q
);
}
return $this->getSkin()->getLanguage()->pipeList( $s );
}
/**
* Compute the sidebar
* @access private
*
* @return string
*/
function quickBar(){
$s = "\n";
$sep = '
';
$s .= $this->menuHead( 'qbfind' );
$s .= $this->searchForm();
$s .= $this->menuHead( 'qbbrowse' );
# Use the first heading from the Monobook sidebar as the "browse" section
$bar = $this->getSkin()->buildSidebar();
unset( $bar['SEARCH'] );
unset( $bar['LANGUAGES'] );
unset( $bar['TOOLBOX'] );
$barnumber = 1;
foreach ( $bar as $heading => $browseLinks ) {
if ( $barnumber > 1 ) {
$headingMsg = wfMessage( $heading );
if ( $headingMsg->exists() ) {
$h = $headingMsg->text();
} else {
$h = $heading;
}
$s .= "\n
" . htmlspecialchars( $h ) . "
";
}
if( is_array( $browseLinks ) ) {
foreach ( $browseLinks as $link ) {
if ( $link['text'] != '-' ) {
$s .= "
" .
htmlspecialchars( $link['text'] ) . '' . $sep;
}
}
}
$barnumber++;
}
$user = $this->getSkin()->getUser();
if ( $this->data['isarticle'] ) {
$s .= $this->menuHead( 'qbedit' );
$s .= '
' . $this->editThisPage() . '';
$s .= $sep . Linker::linkKnown(
Title::newFromText( wfMsgForContent( 'edithelppage' ) ),
wfMsg( 'edithelp' )
);
if( $this->data['loggedin'] ) {
$s .= $sep . $this->moveThisPage();
}
if ( $user->isAllowed( 'delete' ) ) {
$dtp = $this->deleteThisPage();
if ( $dtp != '' ) {
$s .= $sep . $dtp;
}
}
if ( $user->isAllowed( 'protect' ) ) {
$ptp = $this->protectThisPage();
if ( $ptp != '' ) {
$s .= $sep . $ptp;
}
}
$s .= $sep;
$s .= $this->menuHead( 'qbpageoptions' );
$s .= $this->talkLink()
. $sep . $this->commentLink()
. $sep . $this->printableLink();
if ( $this->data['loggedin'] ) {
$s .= $sep . $this->watchThisPage();
}
$s .= $sep;
$s .= $this->menuHead( 'qbpageinfo' )
. $this->historyLink()
. $sep . $this->whatLinksHere()
. $sep . $this->watchPageLinksLink();
$title = $this->getSkin()->getTitle();
$tns = $title->getNamespace();
if ( $tns == NS_USER || $tns == NS_USER_TALK ) {
$id = User::idFromName( $title->getText() );
if( $id != 0 ) {
$s .= $sep . $this->userContribsLink();
if( $this->getSkin()->showEmailUser( $id ) ) {
$s .= $sep . $this->emailUserLink();
}
}
}
$s .= $sep;
}
$s .= $this->menuHead( 'qbmyoptions' );
if ( $this->data['loggedin'] ) {
$tl = Linker::link(
$user->getTalkPage(),
wfMsg( 'mytalk' ),
array(),
array(),
array( 'known', 'noclasses' )
);
if ( $user->getNewtalk() ) {
$tl .= ' *';
}
$s .= Linker::link(
$user->getUserPage(),
wfMsg( 'mypage' ),
array(),
array(),
array( 'known', 'noclasses' )
) . $sep . $tl . $sep . Linker::specialLink( 'Watchlist' )
. $sep .
Linker::link(
SpecialPage::getSafeTitleFor( 'Contributions', $user->getName() ),
wfMsg( 'mycontris' ),
array(),
array(),
array( 'known', 'noclasses' )
) . $sep . Linker::specialLink( 'Preferences' )
. $sep . Linker::specialLink( 'Userlogout' );
} else {
$s .= Linker::specialLink( 'Userlogin' );
}
$s .= $this->menuHead( 'qbspecialpages' )
. Linker::specialLink( 'Newpages' )
. $sep . Linker::specialLink( 'Listfiles' )
. $sep . Linker::specialLink( 'Statistics' );
if( UploadBase::isEnabled() && UploadBase::isAllowed( $user ) === true ) {
$s .= $sep . $this->getUploadLink();
}
global $wgSiteSupportPage;
if( $wgSiteSupportPage ) {
$s .= $sep . '
'
. wfMsg( 'sitesupport' ) . '';
}
$s .= $sep . Linker::link(
SpecialPage::getTitleFor( 'Specialpages' ),
wfMsg( 'moredotdotdot' ),
array(),
array(),
array( 'known', 'noclasses' )
);
$s .= $sep . "\n
\n";
return $s;
}
/**
* @param $key string
* @return string
*/
function menuHead( $key ) {
$s = "\n