URL-escape the main page link on the logo
[mediawiki.git] / includes / SkinCologneBlue.php
blob0b0d96420a6ac760d4d3b19bc223025ede1004f1
1 <?
2 # See skin.doc
4 class SkinCologneBlue extends Skin {
6 function initPage()
8 global $wgOut, $wgStyleSheetPath;
10 $wgOut->addLink( "stylesheet", "",
11 "{$wgStyleSheetPath}/cologneblue.css" );
14 function doBeforeContent()
16 global $wgUser, $wgOut, $wgTitle;
18 $s = "";
19 $qb = $this->qbSetting();
21 $s .= "\n<div id='content'>\n<div id='topbar'>" .
22 "<table width='98%' border=0 cellspacing=0 cellpadding=8><tr>";
24 $s .= "<td class='top' align=left valign=middle nowrap>";
25 $s .= "<a href=\"" . wfLocalUrlE( wfMsg( "mainpage" ) ) . "\">";
26 $s .= "<span id='sitetitle'>" . wfMsg( "sitetitle" ) . "</span></a>";
28 $s .= "</td><td class='top' align=right valign=bottom width='100%'>";
29 $s .= $this->sysLinks();
30 $s .= "</td></tr><tr><td valign=top>";
32 $s .= "<font size='-1'><span id='sitesub'>";
33 $s .= wfMsg( "sitesubtitle" ) . "</span></font>";
34 $s .= "</td><td align=right>" ;
36 $s .= "<font size='-1'><span id='langlinks'>" ;
37 $s .= str_replace ( "<br>" , "" , $this->otherLanguages() ) ;
38 $s .= "<br>" . $this->pageTitleLinks();
39 $s .= "</span></font>";
41 $s .= "</td></tr></table>\n";
43 $s .= "\n</div>\n<div id='article'>";
45 $s .= $this->pageTitle();
46 $s .= $this->pageSubtitle() . "\n<p>";
47 return $s;
50 function doAfterContent()
52 global $wgUser, $wgOut;
54 $s = "\n</div><br clear=all>\n";
56 $s .= "\n<div id='footer'>";
57 $s .= "<table width='98%' border=0 cellspacing=0><tr>";
59 $qb = $this->qbSetting();
60 if ( 1 == $qb || 3 == $qb ) { # Left
61 $s .= $this->getQuickbarCompensator();
63 $s .= "<td class='bottom' align=center valign=top>";
65 $s .= $this->bottomLinks();
66 $s .= "\n<br>" . $this->makeKnownLink( wfMsg( "mainpage" ),
67 wfMsg( "mainpage" ) ) . " | "
68 . $this->aboutLink() . " | "
69 . $this->searchForm( wfMsg( "qbfind" ) );
71 $s .= "\n<br>" . $this->pageStats();
73 $s .= "</td>";
74 if ( 2 == $qb ) { # Right
75 $s .= $this->getQuickbarCompensator();
77 $s .= "</tr></table>\n</div>\n</div>\n";
79 if ( 0 != $qb ) { $s .= $this->quickBar(); }
80 return $s;
82 function doGetUserStyles()
84 global $wgUser, $wgOut, $wgStyleSheetPath;
86 $s = parent::doGetUserStyles();
87 $qb = $this->qbSetting();
89 if ( 2 == $qb ) { # Right
90 $s .= "#quickbar { position: absolute; right: 4px; }\n" .
91 "#article { margin-left: 4px; margin-right: 148px; }\n";
92 } else if ( 1 == $qb || 3 == $qb ) {
93 $s .= "#quickbar { position: absolute; left: 4px; }\n" .
94 "#article { margin-left: 148px; margin-right: 4px; }\n";
96 return $s;
98 function sysLinks()
100 global $wgUser, $wgLang, $wgTitle;
101 $li = $wgLang->specialPage("Userlogin");
102 $lo = $wgLang->specialPage("Userlogout");
104 $rt = $wgTitle->getPrefixedURL();
105 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
106 $q = "";
107 } else {
108 $q = "returnto={$rt}";
111 $s .= "\n<br>" . $this->makeKnownLink( $li,
112 wfMsg( "login" ), $q );
114 $s = "" .
115 $this->makeKnownLink( wfMsg( "mainpage" ), wfMsg( "mainpage" ) )
116 . " | " .
117 $this->makeKnownLink( wfMsg( "aboutpage" ), wfMsg( "about" ) )
118 . " | " .
119 $this->makeKnownLink( wfMsg( "helppage" ), wfMsg( "help" ) )
120 . " | " .
121 $this->makeKnownLink( wfMsg( "faqpage" ), wfMsg("faq") )
122 . " | " .
123 $this->specialLink( "specialpages" ) . " | ";
125 if ( $wgUser->getID() )
127 $s .= $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
129 else
131 $s .= $this->makeKnownLink( $li, wfMsg( "login" ), $q );
134 return $s;
137 function quickBar()
139 global $wgOut, $wgTitle, $wgUser, $wgLang;
141 $s = "\n<div id='quickbar'>";
143 $sep = "<br>";
144 $s .= $this->menuHead( "qbfind" );
145 $s .= $this->searchForm();
147 $s .= $this->menuHead( "qbbrowse" )
148 . $this->mainPageLink()
149 . $sep . $this->specialLink( "recentchanges" )
150 . $sep . $this->specialLink( "randompage" )
151 . $sep . $this->specialLink( "newpages" )
152 . $sep . $this->specialLink( "imagelist" )
153 . $sep . $this->specialLink( "statistics" )
154 . $sep . $this->specialLink( "specialpages" )
155 . $sep . $this->bugReportsLink() ;
156 if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
157 $s .= "\n";
159 if ( $wgOut->isArticle() ) {
160 $s .= $this->menuHead( "qbedit" );
161 $s .= "<strong>" . $this->editThisPage() . "</strong>"
162 . $sep . $this->makeKnownLink( wfMsg( "edithelppage" ),
163 wfMsg( "edithelp" ) );
165 if ( 0 != $wgUser->getID() ) {
166 $s .= $sep . $this->specialLink( "upload" )
167 . $sep . $this->moveThisPage();
169 if ( $wgUser->isSysop() ) {
170 $s .= $sep . $this->deleteThisPage() .
171 $sep . $this->protectThisPage();
173 $s .= $sep;
175 $s .= $this->menuHead( "qbpageoptions" );
176 $s .= $this->talkLink()
177 . $sep . $this->printableLink();
178 if ( 0 != $wgUser->getID() ) {
179 $s .= $sep . $this->watchThisPage();
181 $s .= $sep;
183 $s .= $this->menuHead( "qbpageinfo" )
184 . $this->historyLink()
185 . $sep . $this->whatLinksHere()
186 . $sep . $this->watchPageLinksLink();
188 if ( Namespace::getUser() == $wgTitle->getNamespace() ) {
189 $s .= $sep . $this->userContribsLink();
190 if ( 0 != $wgUser->getID() ) {
191 $s .= $sep . $this->emailUserLink();
194 $s .= $sep;
196 $s .= $this->menuHead( "qbmyoptions" );
197 if ( 0 != $wgUser->getID() ) {
198 $name = $wgUser->getName();
199 $tl = $this->makeKnownLink( $wgLang->getNsText(
200 Namespace::getTalk( Namespace::getUser() ) ) . ":{$name}",
201 wfMsg( "mytalk" ) );
202 if ( 0 != $wgUser->getNewtalk() ) { $tl .= " *"; }
204 $s .= $this->makeKnownLink( $wgLang->getNsText(
205 Namespace::getUser() ) . ":{$name}", wfMsg( "mypage" ) )
206 . $sep . $tl
207 . $sep . $this->specialLink( "watchlist" )
208 . $sep . $this->specialLink( "preferences" )
209 . $sep . $this->specialLink( "userlogout" );
210 } else {
211 $s .= $this->specialLink( "userlogin" );
213 $s .= $sep . "\n</div>\n";
214 return $s;
217 function menuHead( $key )
219 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
220 return $s;
223 function searchForm( $label = "" )
225 global $search;
226 $s = "<form id=\"search\" method=\"get\" class=\"inline\" action=\"" .
227 wfLocalUrlE( "" ) . "\">";
228 if ( "" != $label ) { $s .= "{$label}: "; }
230 $s .= "<input type=text name=\"search\" size=10 value=\""
231 . htmlspecialchars(substr($search,0,256)) . "\">"
232 . "<input type=submit value=\"" . wfMsg( "ok" ) . "\"></form>";
234 return $s;