10 if( !defined( 'MEDIAWIKI' ) )
17 class SkinCologneBlue extends Skin {
19 function getStylesheet() {
20 return 'common/cologneblue.css';
22 function getSkinName() {
26 function doBeforeContent() {
29 $qb = $this->qbSetting();
30 $mainPageObj = Title::newMainPage();
32 $s .= "\n<div id='content'>\n<div id='topbar'>" .
33 "<table width='100%' border='0' cellspacing='0' cellpadding='8'><tr>";
35 $s .= "<td class='top' align='left' valign='middle' nowrap='nowrap'>";
36 $s .= "<a href=\"" . $mainPageObj->escapeLocalURL() . "\">";
37 $s .= "<span id='sitetitle'>" . wfMsg( "sitetitle" ) . "</span></a>";
39 $s .= "</td><td class='top' align='right' valign='bottom' width='100%'>";
40 $s .= $this->sysLinks();
41 $s .= "</td></tr><tr><td valign='top'>";
43 $s .= "<font size='-1'><span id='sitesub'>";
44 $s .= htmlspecialchars( wfMsg( "sitesubtitle" ) ) . "</span></font>";
45 $s .= "</td><td align='right'>" ;
47 $s .= "<font size='-1'><span id='langlinks'>" ;
48 $s .= str_replace ( "<br />" , "" , $this->otherLanguages() );
49 $cat = $this->getCategoryLinks();
50 if( $cat ) $s .= "<br />$cat\n";
51 $s .= "<br />" . $this->pageTitleLinks();
52 $s .= "</span></font>";
54 $s .= "</td></tr></table>\n";
56 $s .= "\n</div>\n<div id='article'>";
58 $notice = wfGetSiteNotice();
60 $s .= "\n<div id='siteNotice'>$notice</div>\n";
62 $s .= $this->pageTitle();
63 $s .= $this->pageSubtitle() . "\n";
67 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 .= "\n<br />" . $this->makeKnownLinkObj( Title::newMainPage() ) . " | "
84 . $this->aboutLink() . " | "
85 . $this->searchForm( wfMsg( "qbfind" ) );
87 $s .= "\n<br />" . $this->pageStats();
90 if ( 2 == $qb ) { # Right
91 $s .= $this->getQuickbarCompensator();
93 $s .= "</tr></table>\n</div>\n</div>\n";
95 if ( 0 != $qb ) { $s .= $this->quickBar(); }
99 function reallyGenerateUserStylesheet() {
100 $s = parent::reallyGenerateUserStylesheet();
101 $qb = $this->qbSetting();
103 if ( 2 == $qb ) { # Right
104 $s .= "#quickbar { position: absolute; right: 4px; }\n" .
105 "#article { margin-left: 4px; margin-right: 148px; }\n";
106 } else if ( 1 == $qb ) {
107 $s .= "#quickbar { position: absolute; left: 4px; }\n" .
108 "#article { margin-left: 148px; margin-right: 4px; }\n";
109 } else if ( 3 == $qb ) { # Floating left
110 $s .= "#quickbar { position:absolute; left:4px } \n" .
111 "#topbar { margin-left: 148px }\n" .
112 "#article { margin-left:148px; margin-right: 4px; } \n" .
113 "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;} \n"; # Hides from IE
114 } else if ( 4 == $qb ) { # Floating right
115 $s .= "#quickbar { position: fixed; right: 4px; } \n" .
116 "#topbar { margin-right: 148px }\n" .
117 "#article { margin-right: 148px; margin-left: 4px; } \n" .
118 "body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto ;bottom:4px;} \n"; # Hides from IE
123 function sysLinks() {
124 global $wgUser, $wgContLang, $wgTitle;
125 $li = $wgContLang->specialPage("Userlogin");
126 $lo = $wgContLang->specialPage("Userlogout");
128 $rt = $wgTitle->getPrefixedURL();
129 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
132 $q = "returnto={$rt}";
136 $this->mainPageLink()
138 $this->makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) )
140 $this->makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) )
142 $this->makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") )
144 $this->specialLink( "specialpages" );
146 /* show links to different language variants */
147 $s .= $this->variantLinks();
148 $s .= $this->extensionTabLinks();
151 if ( $wgUser->isLoggedIn() ) {
152 $s .= $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
154 $s .= $this->makeKnownLink( $li, wfMsg( "login" ), $q );
161 * Compute the sidebar
166 global $wgOut, $wgTitle, $wgUser, $wgLang, $wgContLang, $wgEnableUploads;
168 $tns=$wgTitle->getNamespace();
170 $s = "\n<div id='quickbar'>";
173 $s .= $this->menuHead( "qbfind" );
174 $s .= $this->searchForm();
176 $s .= $this->menuHead( "qbbrowse" );
178 # Use the first heading from the Monobook sidebar as the "browse" section
179 $bar = $this->buildSidebar();
180 unset( $bar['SEARCH'] );
181 unset( $bar['LANGUAGES'] );
182 unset( $bar['TOOLBOX'] );
183 $browseLinks = reset( $bar );
185 foreach ( $browseLinks as $link ) {
186 if ( $link['text'] != '-' ) {
187 $s .= "<a href=\"{$link['href']}\">" .
188 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
192 if ( $wgOut->isArticle() ) {
193 $s .= $this->menuHead( "qbedit" );
194 $s .= "<strong>" . $this->editThisPage() . "</strong>";
196 $s .= $sep . $this->makeKnownLink( wfMsgForContent( "edithelppage" ), wfMsg( "edithelp" ) );
198 if( $wgUser->isLoggedIn() ) {
199 $s .= $sep . $this->moveThisPage();
201 if ( $wgUser->isAllowed('delete') ) {
202 $dtp = $this->deleteThisPage();
207 if ( $wgUser->isAllowed('protect') ) {
208 $ptp = $this->protectThisPage();
215 $s .= $this->menuHead( "qbpageoptions" );
216 $s .= $this->talkLink()
217 . $sep . $this->commentLink()
218 . $sep . $this->printableLink();
219 if ( $wgUser->isLoggedIn() ) {
220 $s .= $sep . $this->watchThisPage();
225 $s .= $this->menuHead("qbpageinfo")
226 . $this->historyLink()
227 . $sep . $this->whatLinksHere()
228 . $sep . $this->watchPageLinksLink();
230 if( $tns == NS_USER || $tns == NS_USER_TALK ) {
231 $id=User::idFromName($wgTitle->getText());
233 $s .= $sep . $this->userContribsLink();
234 if( $this->showEmailUser( $id ) ) {
235 $s .= $sep . $this->emailUserLink();
242 $s .= $this->menuHead( "qbmyoptions" );
243 if ( $wgUser->isLoggedIn() ) {
244 $name = $wgUser->getName();
245 $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
247 if ( $wgUser->getNewtalk() ) {
251 $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(),
254 . $sep . $this->specialLink( "watchlist" )
255 . $sep . $this->makeKnownLinkObj( SpecialPage::getSafeTitleFor( "Contributions", $wgUser->getName() ),
256 wfMsg( "mycontris" ) )
257 . $sep . $this->specialLink( "preferences" )
258 . $sep . $this->specialLink( "userlogout" );
260 $s .= $this->specialLink( "userlogin" );
263 $s .= $this->menuHead( "qbspecialpages" )
264 . $this->specialLink( "newpages" )
265 . $sep . $this->specialLink( "imagelist" )
266 . $sep . $this->specialLink( "statistics" );
267 if ( $wgUser->isLoggedIn() && $wgEnableUploads ) {
268 $s .= $sep . $this->specialLink( "upload" );
270 global $wgSiteSupportPage;
271 if( $wgSiteSupportPage) {
272 $s .= $sep."<a href=\"".htmlspecialchars($wgSiteSupportPage)."\" class =\"internal\">"
273 .wfMsg( "sitesupport" )."</a>";
276 $s .= $sep . $this->makeKnownLinkObj(
277 SpecialPage::getTitleFor( 'Specialpages' ),
278 wfMsg( 'moredotdotdot' ) );
280 $s .= $sep . "\n</div>\n";
284 function menuHead( $key )
286 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
290 function searchForm( $label = "" )
294 $search = $wgRequest->getText( 'search' );
295 $action = $this->escapeSearchLink();
296 $s = "<form id=\"searchform{$this->searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">";
297 if ( "" != $label ) { $s .= "{$label}: "; }
299 $s .= "<input type='text' id=\"searchInput{$this->searchboxes}\" class=\"mw-searchInput\" name=\"search\" size=\"14\" value=\""
300 . htmlspecialchars(substr($search,0,256)) . "\" /><br />"
301 . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( "searcharticle" ) ) . "\" />"
302 . "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" /></form>";
304 // Ensure unique id's for search boxes made after the first
305 $this->searchboxes = $this->searchboxes == '' ? 2 : $this->searchboxes + 1;