10 if( !defined( 'MEDIAWIKI' ) )
18 class SkinCologneBlue
extends Skin
{
20 function getStylesheet() {
21 return "common/cologneblue.css?4";
23 function getSkinName() {
27 function doBeforeContent() {
30 $qb = $this->qbSetting();
31 $mainPageObj = Title
::newMainPage();
33 $s .= "\n<div id='content'>\n<div id='topbar'>" .
34 "<table width='100%' border='0' cellspacing='0' cellpadding='8'><tr>";
36 $s .= "<td class='top' align='left' valign='middle' nowrap='nowrap'>";
37 $s .= "<a href=\"" . $mainPageObj->escapeLocalURL() . "\">";
38 $s .= "<span id='sitetitle'>" . wfMsg( "sitetitle" ) . "</span></a>";
40 $s .= "</td><td class='top' align='right' valign='bottom' width='100%'>";
41 $s .= $this->sysLinks();
42 $s .= "</td></tr><tr><td valign='top'>";
44 $s .= "<font size='-1'><span id='sitesub'>";
45 $s .= htmlspecialchars( wfMsg( "sitesubtitle" ) ) . "</span></font>";
46 $s .= "</td><td align='right'>" ;
48 $s .= "<font size='-1'><span id='langlinks'>" ;
49 $s .= str_replace ( "<br />" , "" , $this->otherLanguages() );
50 $cat = $this->getCategoryLinks();
51 if( $cat ) $s .= "<br />$cat\n";
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()
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 .= "\n<br />" . $this->makeKnownLink( wfMsgForContent( "mainpage" ) ) . " | "
85 . $this->aboutLink() . " | "
86 . $this->searchForm( wfMsg( "qbfind" ) );
88 $s .= "\n<br />" . $this->pageStats();
91 if ( 2 == $qb ) { # Right
92 $s .= $this->getQuickbarCompensator();
94 $s .= "</tr></table>\n</div>\n</div>\n";
96 if ( 0 != $qb ) { $s .= $this->quickBar(); }
100 function doGetUserStyles() {
102 $s = parent
::doGetUserStyles();
103 $qb = $this->qbSetting();
105 if ( 2 == $qb ) { # Right
106 $s .= "#quickbar { position: absolute; right: 4px; }\n" .
107 "#article { margin-left: 4px; margin-right: 148px; }\n";
108 } else if ( 1 == $qb ) {
109 $s .= "#quickbar { position: absolute; left: 4px; }\n" .
110 "#article { margin-left: 148px; margin-right: 4px; }\n";
111 } else if ( 3 == $qb ) { # Floating left
112 $s .= "#quickbar { position:absolute; left:4px } \n" .
113 "#topbar { margin-left: 148px }\n" .
114 "#article { margin-left:148px; margin-right: 4px; } \n" .
115 "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;} \n"; # Hides from IE
116 } else if ( 4 == $qb ) { # Floating right
117 $s .= "#quickbar { position: fixed; right: 4px; } \n" .
118 "#topbar { margin-right: 148px }\n" .
119 "#article { margin-right: 148px; margin-left: 4px; } \n" .
120 "body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto ;bottom:4px;} \n"; # Hides from IE
125 function sysLinks() {
126 global $wgUser, $wgContLang, $wgTitle;
127 $li = $wgContLang->specialPage("Userlogin");
128 $lo = $wgContLang->specialPage("Userlogout");
130 $rt = $wgTitle->getPrefixedURL();
131 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
134 $q = "returnto={$rt}";
138 $this->makeKnownLink( wfMsgForContent( "mainpage" ), wfMsg( "mainpage" ) )
140 $this->makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) )
142 $this->makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) )
144 $this->makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") )
146 $this->specialLink( "specialpages" ) . " | ";
148 if ( $wgUser->isLoggedIn() ) {
149 $s .= $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
151 $s .= $this->makeKnownLink( $li, wfMsg( "login" ), $q );
154 /* show links to different language variants */
155 global $wgDisableLangConversion;
156 $variants = $wgContLang->getVariants();
157 if( !$wgDisableLangConversion && sizeof( $variants ) > 1 ) {
159 foreach( $variants as $code ) {
160 $varname = $wgContLang->getVariantname( $code );
161 if( $varname == 'disable' )
163 $s .= ' | <a href="' . $wgTitle->getLocalUrl( 'variant=' . $code ) . '">' . $varname . '</a>';
171 * Compute the sidebar
176 global $wgOut, $wgTitle, $wgUser, $wgLang, $wgContLang, $wgEnableUploads;
178 $tns=$wgTitle->getNamespace();
180 $s = "\n<div id='quickbar'>";
183 $s .= $this->menuHead( "qbfind" );
184 $s .= $this->searchForm();
186 $s .= $this->menuHead( "qbbrowse" );
188 # Use the first heading from the Monobook sidebar as the "browse" section
189 $bar = $this->buildSidebar();
190 $browseLinks = reset( $bar );
192 foreach ( $browseLinks as $link ) {
193 if ( $link['text'] != '-' ) {
194 $s .= "<a href=\"{$link['href']}\">" .
195 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
199 if ( $wgOut->isArticle() ) {
200 $s .= $this->menuHead( "qbedit" );
201 $s .= "<strong>" . $this->editThisPage() . "</strong>";
203 $s .= $sep . $this->makeKnownLink( wfMsgForContent( "edithelppage" ), wfMsg( "edithelp" ) );
205 if( $wgUser->isLoggedIn() ) {
206 $s .= $sep . $this->moveThisPage();
208 if ( $wgUser->isAllowed('delete') ) {
209 $dtp = $this->deleteThisPage();
214 if ( $wgUser->isAllowed('protect') ) {
215 $ptp = $this->protectThisPage();
222 $s .= $this->menuHead( "qbpageoptions" );
223 $s .= $this->talkLink()
224 . $sep . $this->commentLink()
225 . $sep . $this->printableLink();
226 if ( $wgUser->isLoggedIn() ) {
227 $s .= $sep . $this->watchThisPage();
232 $s .= $this->menuHead("qbpageinfo")
233 . $this->historyLink()
234 . $sep . $this->whatLinksHere()
235 . $sep . $this->watchPageLinksLink();
237 if( $tns == NS_USER ||
$tns == NS_USER_TALK
) {
238 $id=User
::idFromName($wgTitle->getText());
240 $s .= $sep . $this->userContribsLink();
241 if( $this->showEmailUser( $id ) ) {
242 $s .= $sep . $this->emailUserLink();
249 $s .= $this->menuHead( "qbmyoptions" );
250 if ( $wgUser->isLoggedIn() ) {
251 $name = $wgUser->getName();
252 $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
254 if ( $wgUser->getNewtalk() ) {
258 $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(),
261 . $sep . $this->specialLink( "watchlist" )
262 . $sep . $this->makeKnownLinkObj( Title
::makeTitle( NS_SPECIAL
, "Contributions" ),
263 wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) )
264 . $sep . $this->specialLink( "preferences" )
265 . $sep . $this->specialLink( "userlogout" );
267 $s .= $this->specialLink( "userlogin" );
270 $s .= $this->menuHead( "qbspecialpages" )
271 . $this->specialLink( "newpages" )
272 . $sep . $this->specialLink( "imagelist" )
273 . $sep . $this->specialLink( "statistics" )
274 . $sep . $this->bugReportsLink();
275 if ( $wgUser->isLoggedIn() && $wgEnableUploads ) {
276 $s .= $sep . $this->specialLink( "upload" );
278 global $wgSiteSupportPage;
279 if( $wgSiteSupportPage) {
280 $s .= $sep."<a href=\"".htmlspecialchars($wgSiteSupportPage)."\" class =\"internal\">"
281 .wfMsg( "sitesupport" )."</a>";
284 $s .= $sep . $this->makeKnownLinkObj(
285 Title
::makeTitle( NS_SPECIAL
, 'Specialpages' ),
286 wfMsg( 'moredotdotdot' ) );
288 $s .= $sep . "\n</div>\n";
292 function menuHead( $key )
294 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
298 function searchForm( $label = "" )
302 $search = $wgRequest->getText( 'search' );
303 $action = $this->escapeSearchLink();
304 $s = "<form id=\"search\" method=\"get\" class=\"inline\" action=\"$action\">";
305 if ( "" != $label ) { $s .= "{$label}: "; }
307 $s .= "<input type='text' name=\"search\" size='14' value=\""
308 . htmlspecialchars(substr($search,0,256)) . "\" />"
309 . "<br /><input type='submit' name=\"go\" value=\"" . htmlspecialchars( wfMsg( "searcharticle" ) ) . "\" /> <input type='submit' name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" /></form>";