same minor typo as in LocalSettings (in example config url)
[mediawiki.git] / includes / SkinCologneBlue.php
blob1d59b1c5f38158d677f95f52c97483d3ab6bbba1
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='100%' border=0 cellspacing=0 cellpadding=8><tr>";
24 $s .= "<td class='top' align=left valign=middle nowrap>";
25 $s .= "<a href=\"" . wfLocalUrlE( urlencode( 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, $wgDisableUploads;
141 $tns=$wgTitle->getNamespace();
143 $s = "\n<div id='quickbar'>";
145 $sep = "<br>";
146 $s .= $this->menuHead( "qbfind" );
147 $s .= $this->searchForm();
149 $s .= $this->menuHead( "qbbrowse" )
150 . $this->mainPageLink()
151 . $sep . $this->specialLink( "recentchanges" )
152 . $sep . $this->specialLink( "randompage" );
153 if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
154 $s .= "\n";
156 if ( $wgOut->isArticle() ) {
157 $s .= $this->menuHead( "qbedit" );
158 $s .= "<strong>" . $this->editThisPage() . "</strong>";
160 $s .= $sep . $this->makeKnownLink( wfMsg( "edithelppage" ), wfMsg( "edithelp" ) );
162 if ( 0 != $wgUser->getID() ) {
163 $s .= $sep . $this->moveThisPage();
165 if ( $wgUser->isSysop() ) {
166 $dtp = $this->deleteThisPage();
167 if ( "" != $dtp ) {
168 $s .= $sep . $dtp;
170 $ptp = $this->protectThisPage();
171 if ( "" != $ptp ) {
172 $s .= $sep . $ptp;
175 $s .= $sep;
177 $s .= $this->menuHead( "qbpageoptions" );
178 $s .= $this->talkLink()
179 . $sep . $this->commentLink()
180 . $sep . $this->printableLink();
181 if ( 0 != $wgUser->getID() ) {
182 $s .= $sep . $this->watchThisPage();
185 $s .= $sep;
187 $s .= $this->menuHead("qbpageinfo")
188 . $this->historyLink()
189 . $sep . $this->whatLinksHere()
190 . $sep . $this->watchPageLinksLink();
192 if ( Namespace::getUser() == $tns || Namespace::getTalk(Namespace::getUser()) == $tns ) {
193 $id=User::idFromName($wgTitle->getText());
194 if ($id != 0) {
195 $s .= $sep . $this->userContribsLink();
196 if ( 0 != $wgUser->getID() ) {
197 $s .= $sep . $this->emailUserLink();
201 $s .= $sep;
204 $s .= $this->menuHead( "qbmyoptions" );
205 if ( 0 != $wgUser->getID() ) {
206 $name = $wgUser->getName();
207 $tl = $this->makeKnownLink( $wgLang->getNsText(
208 Namespace::getTalk( Namespace::getUser() ) ) . ":{$name}",
209 wfMsg( "mytalk" ) );
210 if ( 0 != $wgUser->getNewtalk() ) { $tl .= " *"; }
212 $s .= $this->makeKnownLink( $wgLang->getNsText(
213 Namespace::getUser() ) . ":{$name}", wfMsg( "mypage" ) )
214 . $sep . $tl
215 . $sep . $this->specialLink( "watchlist" )
216 . $sep . $this->specialLink( "preferences" )
217 . $sep . $this->specialLink( "userlogout" );
218 } else {
219 $s .= $this->specialLink( "userlogin" );
222 $s .= $this->menuHead( "qbspecialpages" )
223 . $this->specialLink( "newpages" )
224 . $sep . $this->specialLink( "imagelist" )
225 . $sep . $this->specialLink( "statistics" )
226 . $sep . $this->bugReportsLink();
227 if ( 0 != $wgUser->getID() && !$wgDisableUploads ) {
228 $s .= $sep . $this->specialLink( "upload" );
231 $s .= $sep . $this->makeKnownLink( $wgLang->specialPage( "Specialpages" ), wfMsg("moredotdotdot") );
233 $s .= $sep . "\n</div>\n";
234 return $s;
237 function menuHead( $key )
239 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
240 return $s;
243 function searchForm( $label = "" )
245 global $search;
246 $s = "<form id=\"search\" method=\"get\" class=\"inline\" action=\"" .
247 wfLocalUrlE( "" ) . "\">";
248 if ( "" != $label ) { $s .= "{$label}: "; }
250 $s .= "<input type=text name=\"search\" size=14 value=\""
251 . htmlspecialchars(substr($search,0,256)) . "\">"
252 . "<br><input type=submit name=\"go\" value=\"" . wfMsg( "go" ) . "\"> <input type=submit value=\"" . wfMsg( "search" ) . "\"></form>";
254 return $s;