Adjust UTF-8 generator for correctness. (Upper private use area, probably affects...
[mediawiki.git] / includes / SkinCologneBlue.php
blobb2f99aa275581e595efa139d167b66b2d1fcbfcd
1 <?php
2 # See skin.doc
4 class SkinCologneBlue extends Skin {
6 function getStylesheet()
8 return "cologneblue.css";
10 function getSkinName() {
11 return "cologneblue";
14 function doBeforeContent()
16 global $wgUser, $wgOut, $wgTitle, $wgSiteNotice;
18 $s = "";
19 $qb = $this->qbSetting();
20 $mainPageObj = Title::newMainPage();
22 $s .= "\n<div id='content'>\n<div id='topbar'>" .
23 "<table width='100%' border='0' cellspacing='0' cellpadding='8'><tr>";
25 $s .= "<td class='top' align='left' valign='middle' nowrap='nowrap'>";
26 $s .= "<a href=\"" . $mainPageObj->escapeLocalURL() . "\">";
27 $s .= "<span id='sitetitle'>" . wfMsg( "sitetitle" ) . "</span></a>";
29 $s .= "</td><td class='top' align='right' valign='bottom' width='100%'>";
30 $s .= $this->sysLinks();
31 $s .= "</td></tr><tr><td valign='top'>";
33 $s .= "<font size='-1'><span id='sitesub'>";
34 $s .= htmlspecialchars( wfMsg( "sitesubtitle" ) ) . "</span></font>";
35 $s .= "</td><td align='right'>" ;
37 $s .= "<font size='-1'><span id='langlinks'>" ;
38 $s .= str_replace ( "<br>" , "" , $this->otherLanguages() );
39 $cat = $this->getCategoryLinks();
40 if( $cat ) $s .= "<br />$cat\n";
41 $s .= "<br />" . $this->pageTitleLinks();
42 $s .= "</span></font>";
44 $s .= "</td></tr></table>\n";
46 $s .= "\n</div>\n<div id='article'>";
48 if( $wgSiteNotice ) {
49 $s .= "\n<div id='siteNotice'>$wgSiteNotice</div>\n";
51 $s .= $this->pageTitle();
52 $s .= $this->pageSubtitle() . "\n";
53 return $s;
56 function doAfterContent()
58 global $wgUser, $wgOut;
60 $s = "\n</div><br clear='all' />\n";
62 $s .= "\n<div id='footer'>";
63 $s .= "<table width='98%' border='0' cellspacing='0'><tr>";
65 $qb = $this->qbSetting();
66 if ( 1 == $qb || 3 == $qb ) { # Left
67 $s .= $this->getQuickbarCompensator();
69 $s .= "<td class='bottom' align='center' valign='top'>";
71 $s .= $this->bottomLinks();
72 $s .= "\n<br />" . $this->makeKnownLink( wfMsg( "mainpage" ) ) . " | "
73 . $this->aboutLink() . " | "
74 . $this->searchForm( wfMsg( "qbfind" ) );
76 $s .= "\n<br />" . $this->pageStats();
78 $s .= "</td>";
79 if ( 2 == $qb ) { # Right
80 $s .= $this->getQuickbarCompensator();
82 $s .= "</tr></table>\n</div>\n</div>\n";
84 if ( 0 != $qb ) { $s .= $this->quickBar(); }
85 return $s;
87 function doGetUserStyles()
89 global $wgUser, $wgOut, $wgStyleSheetPath;
90 $s = '';
91 $qb = $this->qbSetting();
93 if ( 2 == $qb ) { # Right
94 $s .= "#quickbar { position: absolute; right: 4px; }\n" .
95 "#article { margin-left: 4px; margin-right: 148px; }\n";
96 } else if ( 1 == $qb ) {
97 $s .= "#quickbar { position: absolute; left: 4px; }\n" .
98 "#article { margin-left: 148px; margin-right: 4px; }\n";
99 } else if ( 3 == $qb ) { # Floating
100 $s .= "#quickbar { position:absolute; left:4px } \n" .
101 "#topbar { margin-left: 148px }\n" .
102 "#article { margin-left:148px; margin-right: 4px; } \n" .
103 "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;} \n"; # Hides from IE
105 $s .= parent::doGetUserStyles();
106 return $s;
108 function sysLinks()
110 global $wgUser, $wgLang, $wgTitle;
111 $li = $wgLang->specialPage("Userlogin");
112 $lo = $wgLang->specialPage("Userlogout");
114 $rt = $wgTitle->getPrefixedURL();
115 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
116 $q = "";
117 } else {
118 $q = "returnto={$rt}";
121 $s = "" .
122 $this->makeKnownLink( wfMsg( "mainpage" ), wfMsg( "mainpage" ) )
123 . " | " .
124 $this->makeKnownLink( wfMsg( "aboutpage" ), wfMsg( "about" ) )
125 . " | " .
126 $this->makeKnownLink( wfMsg( "helppage" ), wfMsg( "help" ) )
127 . " | " .
128 $this->makeKnownLink( wfMsg( "faqpage" ), wfMsg("faq") )
129 . " | " .
130 $this->specialLink( "specialpages" ) . " | ";
132 if ( $wgUser->getID() )
134 $s .= $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
136 else
138 $s .= $this->makeKnownLink( $li, wfMsg( "login" ), $q );
141 return $s;
144 function quickBar()
146 global $wgOut, $wgTitle, $wgUser, $wgLang, $wgDisableUploads;
148 $tns=$wgTitle->getNamespace();
150 $s = "\n<div id='quickbar'>";
152 $sep = "<br />";
153 $s .= $this->menuHead( "qbfind" );
154 $s .= $this->searchForm();
156 $s .= $this->menuHead( "qbbrowse" )
157 . $this->mainPageLink()
158 . $sep . $this->specialLink( "recentchanges" )
159 . $sep . $this->specialLink( "randompage" );
160 if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
161 $s .= "\n";
163 if ( $wgOut->isArticle() ) {
164 $s .= $this->menuHead( "qbedit" );
165 $s .= "<strong>" . $this->editThisPage() . "</strong>";
167 $s .= $sep . $this->makeKnownLink( wfMsg( "edithelppage" ), wfMsg( "edithelp" ) );
169 if ( 0 != $wgUser->getID() ) {
170 $s .= $sep . $this->moveThisPage();
172 if ( $wgUser->isSysop() ) {
173 $dtp = $this->deleteThisPage();
174 if ( "" != $dtp ) {
175 $s .= $sep . $dtp;
177 $ptp = $this->protectThisPage();
178 if ( "" != $ptp ) {
179 $s .= $sep . $ptp;
182 $s .= $sep;
184 $s .= $this->menuHead( "qbpageoptions" );
185 $s .= $this->talkLink()
186 . $sep . $this->commentLink()
187 . $sep . $this->printableLink();
188 if ( 0 != $wgUser->getID() ) {
189 $s .= $sep . $this->watchThisPage();
192 $s .= $sep;
194 $s .= $this->menuHead("qbpageinfo")
195 . $this->historyLink()
196 . $sep . $this->whatLinksHere()
197 . $sep . $this->watchPageLinksLink();
199 if ( Namespace::getUser() == $tns || Namespace::getTalk(Namespace::getUser()) == $tns ) {
200 $id=User::idFromName($wgTitle->getText());
201 if ($id != 0) {
202 $s .= $sep . $this->userContribsLink();
203 if ( 0 != $wgUser->getID() ) {
204 $s .= $sep . $this->emailUserLink();
208 $s .= $sep;
211 $s .= $this->menuHead( "qbmyoptions" );
212 if ( 0 != $wgUser->getID() ) {
213 $name = $wgUser->getName();
214 $tl = $this->makeKnownLink( $wgLang->getNsText(
215 Namespace::getTalk( Namespace::getUser() ) ) . ":{$name}",
216 wfMsg( "mytalk" ) );
217 if ( 0 != $wgUser->getNewtalk() ) { $tl .= " *"; }
219 $s .= $this->makeKnownLink( $wgLang->getNsText(
220 Namespace::getUser() ) . ":{$name}", wfMsg( "mypage" ) )
221 . $sep . $tl
222 . $sep . $this->specialLink( "watchlist" )
223 . $sep . $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
224 wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) )
225 . $sep . $this->specialLink( "preferences" )
226 . $sep . $this->specialLink( "userlogout" );
227 } else {
228 $s .= $this->specialLink( "userlogin" );
231 $s .= $this->menuHead( "qbspecialpages" )
232 . $this->specialLink( "newpages" )
233 . $sep . $this->specialLink( "imagelist" )
234 . $sep . $this->specialLink( "statistics" )
235 . $sep . $this->bugReportsLink();
236 if ( 0 != $wgUser->getID() && !$wgDisableUploads ) {
237 $s .= $sep . $this->specialLink( "upload" );
239 global $wgSiteSupportPage;
240 if( $wgSiteSupportPage) {
241 $s .= $sep."<a href=\"".htmlspecialchars($wgSiteSupportPage)."\" class =\"internal\">"
242 .wfMsg( "sitesupport" )."</a>";
245 $s .= $sep . $this->makeKnownLink( $wgLang->specialPage( "Specialpages" ), wfMsg("moredotdotdot") );
247 $s .= $sep . "\n</div>\n";
248 return $s;
251 function menuHead( $key )
253 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
254 return $s;
257 function searchForm( $label = "" )
259 global $wgRequest;
261 $search = $wgRequest->getText( 'search' );
262 $action = $this->escapeSearchLink();
263 $s = "<form id=\"search\" method=\"get\" class=\"inline\" action=\"$action\">";
264 if ( "" != $label ) { $s .= "{$label}: "; }
266 $s .= "<input type='text' name=\"search\" size='14' value=\""
267 . htmlspecialchars(substr($search,0,256)) . "\" />"
268 . "<br /><input type='submit' name=\"go\" value=\"" . htmlspecialchars( wfMsg( "go" ) ) . "\" /> <input type='submit' name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" /></form>";
270 return $s;