10 if( !defined( 'MEDIAWIKI' ) )
18 class SkinCologneBlue
extends Skin
{
20 private $searchboxes = '';
21 // How many search boxes have we made? Avoid duplicate id's.
23 function getStylesheet() {
24 return 'common/cologneblue.css';
26 function getSkinName() {
30 function doBeforeContent() {
33 $qb = $this->qbSetting();
34 $mainPageObj = Title
::newMainPage();
36 $s .= "\n<div id='content'>\n<div id='topbar'>" .
37 "<table width='100%' border='0' cellspacing='0' cellpadding='8'><tr>";
39 $s .= "<td class='top' align='left' valign='middle' nowrap='nowrap'>";
40 $s .= "<a href=\"" . $mainPageObj->escapeLocalURL() . "\">";
41 $s .= "<span id='sitetitle'>" . wfMsg( "sitetitle" ) . "</span></a>";
43 $s .= "</td><td class='top' align='right' valign='bottom' width='100%'>";
44 $s .= $this->sysLinks();
45 $s .= "</td></tr><tr><td valign='top'>";
47 $s .= "<font size='-1'><span id='sitesub'>";
48 $s .= htmlspecialchars( wfMsg( "sitesubtitle" ) ) . "</span></font>";
49 $s .= "</td><td align='right'>" ;
51 $s .= "<font size='-1'><span id='langlinks'>" ;
52 $s .= str_replace ( "<br />" , "" , $this->otherLanguages() );
53 $cat = $this->getCategoryLinks();
54 if( $cat ) $s .= "<br />$cat\n";
55 $s .= "<br />" . $this->pageTitleLinks();
56 $s .= "</span></font>";
58 $s .= "</td></tr></table>\n";
60 $s .= "\n</div>\n<div id='article'>";
62 $notice = wfGetSiteNotice();
64 $s .= "\n<div id='siteNotice'>$notice</div>\n";
66 $s .= $this->pageTitle();
67 $s .= $this->pageSubtitle() . "\n";
71 function doAfterContent()
75 $s = "\n</div><br clear='all' />\n";
77 $s .= "\n<div id='footer'>";
78 $s .= "<table width='98%' border='0' cellspacing='0'><tr>";
80 $qb = $this->qbSetting();
81 if ( 1 == $qb ||
3 == $qb ) { # Left
82 $s .= $this->getQuickbarCompensator();
84 $s .= "<td class='bottom' align='center' valign='top'>";
86 $s .= $this->bottomLinks();
87 $s .= "\n<br />" . $this->makeKnownLink( wfMsgForContent( "mainpage" ) ) . " | "
88 . $this->aboutLink() . " | "
89 . $this->searchForm( wfMsg( "qbfind" ) );
91 $s .= "\n<br />" . $this->pageStats();
94 if ( 2 == $qb ) { # Right
95 $s .= $this->getQuickbarCompensator();
97 $s .= "</tr></table>\n</div>\n</div>\n";
99 if ( 0 != $qb ) { $s .= $this->quickBar(); }
103 function doGetUserStyles() {
105 $s = parent
::doGetUserStyles();
106 $qb = $this->qbSetting();
108 if ( 2 == $qb ) { # Right
109 $s .= "#quickbar { position: absolute; right: 4px; }\n" .
110 "#article { margin-left: 4px; margin-right: 148px; }\n";
111 } else if ( 1 == $qb ) {
112 $s .= "#quickbar { position: absolute; left: 4px; }\n" .
113 "#article { margin-left: 148px; margin-right: 4px; }\n";
114 } else if ( 3 == $qb ) { # Floating left
115 $s .= "#quickbar { position:absolute; left:4px } \n" .
116 "#topbar { margin-left: 148px }\n" .
117 "#article { margin-left:148px; margin-right: 4px; } \n" .
118 "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;} \n"; # Hides from IE
119 } else if ( 4 == $qb ) { # Floating right
120 $s .= "#quickbar { position: fixed; right: 4px; } \n" .
121 "#topbar { margin-right: 148px }\n" .
122 "#article { margin-right: 148px; margin-left: 4px; } \n" .
123 "body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto ;bottom:4px;} \n"; # Hides from IE
128 function sysLinks() {
129 global $wgUser, $wgContLang, $wgTitle;
130 $li = $wgContLang->specialPage("Userlogin");
131 $lo = $wgContLang->specialPage("Userlogout");
133 $rt = $wgTitle->getPrefixedURL();
134 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
137 $q = "returnto={$rt}";
141 $this->makeKnownLink( wfMsgForContent( "mainpage" ), wfMsg( "mainpage" ) )
143 $this->makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) )
145 $this->makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) )
147 $this->makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") )
149 $this->specialLink( "specialpages" );
151 /* show links to different language variants */
152 $s .= $this->variantLinks();
153 $s .= $this->extensionTabLinks();
156 if ( $wgUser->isLoggedIn() ) {
157 $s .= $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
159 $s .= $this->makeKnownLink( $li, wfMsg( "login" ), $q );
166 * Compute the sidebar
171 global $wgOut, $wgTitle, $wgUser, $wgLang, $wgContLang, $wgEnableUploads;
173 $tns=$wgTitle->getNamespace();
175 $s = "\n<div id='quickbar'>";
178 $s .= $this->menuHead( "qbfind" );
179 $s .= $this->searchForm();
181 $s .= $this->menuHead( "qbbrowse" );
183 # Use the first heading from the Monobook sidebar as the "browse" section
184 $bar = $this->buildSidebar();
185 $browseLinks = reset( $bar );
187 foreach ( $browseLinks as $link ) {
188 if ( $link['text'] != '-' ) {
189 $s .= "<a href=\"{$link['href']}\">" .
190 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
194 if ( $wgOut->isArticle() ) {
195 $s .= $this->menuHead( "qbedit" );
196 $s .= "<strong>" . $this->editThisPage() . "</strong>";
198 $s .= $sep . $this->makeKnownLink( wfMsgForContent( "edithelppage" ), wfMsg( "edithelp" ) );
200 if( $wgUser->isLoggedIn() ) {
201 $s .= $sep . $this->moveThisPage();
203 if ( $wgUser->isAllowed('delete') ) {
204 $dtp = $this->deleteThisPage();
209 if ( $wgUser->isAllowed('protect') ) {
210 $ptp = $this->protectThisPage();
217 $s .= $this->menuHead( "qbpageoptions" );
218 $s .= $this->talkLink()
219 . $sep . $this->commentLink()
220 . $sep . $this->printableLink();
221 if ( $wgUser->isLoggedIn() ) {
222 $s .= $sep . $this->watchThisPage();
227 $s .= $this->menuHead("qbpageinfo")
228 . $this->historyLink()
229 . $sep . $this->whatLinksHere()
230 . $sep . $this->watchPageLinksLink();
232 if( $tns == NS_USER ||
$tns == NS_USER_TALK
) {
233 $id=User
::idFromName($wgTitle->getText());
235 $s .= $sep . $this->userContribsLink();
236 if( $this->showEmailUser( $id ) ) {
237 $s .= $sep . $this->emailUserLink();
244 $s .= $this->menuHead( "qbmyoptions" );
245 if ( $wgUser->isLoggedIn() ) {
246 $name = $wgUser->getName();
247 $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
249 if ( $wgUser->getNewtalk() ) {
253 $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(),
256 . $sep . $this->specialLink( "watchlist" )
257 . $sep . $this->makeKnownLinkObj( SpecialPage
::getSafeTitleFor( "Contributions", $wgUser->getName() ),
258 wfMsg( "mycontris" ) )
259 . $sep . $this->specialLink( "preferences" )
260 . $sep . $this->specialLink( "userlogout" );
262 $s .= $this->specialLink( "userlogin" );
265 $s .= $this->menuHead( "qbspecialpages" )
266 . $this->specialLink( "newpages" )
267 . $sep . $this->specialLink( "imagelist" )
268 . $sep . $this->specialLink( "statistics" )
269 . $sep . $this->bugReportsLink();
270 if ( $wgUser->isLoggedIn() && $wgEnableUploads ) {
271 $s .= $sep . $this->specialLink( "upload" );
273 global $wgSiteSupportPage;
274 if( $wgSiteSupportPage) {
275 $s .= $sep."<a href=\"".htmlspecialchars($wgSiteSupportPage)."\" class =\"internal\">"
276 .wfMsg( "sitesupport" )."</a>";
279 $s .= $sep . $this->makeKnownLinkObj(
280 SpecialPage
::getTitleFor( 'Specialpages' ),
281 wfMsg( 'moredotdotdot' ) );
283 $s .= $sep . "\n</div>\n";
287 function menuHead( $key )
289 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
293 function searchForm( $label = "" )
297 $search = $wgRequest->getText( 'search' );
298 $action = $this->escapeSearchLink();
299 $s = "<form id=\"searchform{$this->searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">";
300 if ( "" != $label ) { $s .= "{$label}: "; }
302 $s .= "<input type='text' id=\"searchInput{$this->searchboxes}\" class=\"mw-searchInput\" name=\"search\" size=\"14\" value=\""
303 . htmlspecialchars(substr($search,0,256)) . "\" /><br />"
304 . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( "searcharticle" ) ) . "\" />"
305 . "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" /></form>";
307 // Ensure unique id's for search boxes made after the first
308 $this->searchboxes
= $this->searchboxes
== '' ?
2 : $this->searchboxes +
1;