restore feature which loads all subsections of a section during section
[mediawiki.git] / includes / SkinCologneBlue.php
blob09336459db175c9e1c579c6b6e781c267820eb29
1 <?php
2 # See skin.doc
4 class SkinCologneBlue extends Skin {
6 function getStylesheet()
8 return "cologneblue.css";
11 function doBeforeContent()
13 global $wgUser, $wgOut, $wgTitle;
15 $s = "";
16 $qb = $this->qbSetting();
17 $mainPageObj = Title::newMainPage();
19 $s .= "\n<div id='content'>\n<div id='topbar'>" .
20 "<table width='100%' border='0' cellspacing='0' cellpadding='8'><tr>";
22 $s .= "<td class='top' align='left' valign='middle' nowrap='nowrap'>";
23 $s .= "<a href=\"" . $mainPageObj->escapeLocalURL() . "\">";
24 $s .= "<span id='sitetitle'>" . wfMsg( "sitetitle" ) . "</span></a>";
26 $s .= "</td><td class='top' align='right' valign='bottom' width='100%'>";
27 $s .= $this->sysLinks();
28 $s .= "</td></tr><tr><td valign='top'>";
30 $s .= "<font size='-1'><span id='sitesub'>";
31 $s .= htmlspecialchars( wfMsg( "sitesubtitle" ) ) . "</span></font>";
32 $s .= "</td><td align='right'>" ;
34 $s .= "<font size='-1'><span id='langlinks'>" ;
35 $s .= str_replace ( "<br>" , "" , $this->otherLanguages() ) ;
36 $s .= "<br />" . $this->pageTitleLinks();
37 $s .= "</span></font>";
39 $s .= "</td></tr></table>\n";
41 $s .= "\n</div>\n<div id='article'>";
43 $s .= $this->pageTitle();
44 $s .= $this->pageSubtitle() . "\n";
45 return $s;
48 function doAfterContent()
50 global $wgUser, $wgOut;
52 $s = "\n</div><br clear='all' />\n";
54 $s .= "\n<div id='footer'>";
55 $s .= "<table width='98%' border='0' cellspacing='0'><tr>";
57 $qb = $this->qbSetting();
58 if ( 1 == $qb || 3 == $qb ) { # Left
59 $s .= $this->getQuickbarCompensator();
61 $s .= "<td class='bottom' align='center' valign='top'>";
63 $s .= $this->bottomLinks();
64 $s .= "\n<br />" . $this->makeKnownLink( wfMsg( "mainpage" ) ) . " | "
65 . $this->aboutLink() . " | "
66 . $this->searchForm( wfMsg( "qbfind" ) );
68 $s .= "\n<br />" . $this->pageStats();
70 $s .= "</td>";
71 if ( 2 == $qb ) { # Right
72 $s .= $this->getQuickbarCompensator();
74 $s .= "</tr></table>\n</div>\n</div>\n";
76 if ( 0 != $qb ) { $s .= $this->quickBar(); }
77 return $s;
79 function doGetUserStyles()
81 global $wgUser, $wgOut, $wgStyleSheetPath;
83 $s = parent::doGetUserStyles();
84 $qb = $this->qbSetting();
86 if ( 2 == $qb ) { # Right
87 $s .= "#quickbar { position: absolute; right: 4px; }\n" .
88 "#article { margin-left: 4px; margin-right: 148px; }\n";
89 } else if ( 1 == $qb ) {
90 $s .= "#quickbar { position: absolute; left: 4px; }\n" .
91 "#article { margin-left: 148px; margin-right: 4px; }\n";
92 } else if ( 3 == $qb ) { # Floating
93 $s .= "#quickbar { position:absolute; left:4px } \n" .
94 "#topbar { margin-left: 148px }\n" .
95 "#article { margin-left:148px; margin-right: 4px; } \n" .
96 "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;} \n"; # Hides from IE
98 return $s;
100 function sysLinks()
102 global $wgUser, $wgLang, $wgTitle;
103 $li = $wgLang->specialPage("Userlogin");
104 $lo = $wgLang->specialPage("Userlogout");
106 $rt = $wgTitle->getPrefixedURL();
107 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
108 $q = "";
109 } else {
110 $q = "returnto={$rt}";
113 $s = "" .
114 $this->makeKnownLink( wfMsg( "mainpage" ), wfMsg( "mainpage" ) )
115 . " | " .
116 $this->makeKnownLink( wfMsg( "aboutpage" ), wfMsg( "about" ) )
117 . " | " .
118 $this->makeKnownLink( wfMsg( "helppage" ), wfMsg( "help" ) )
119 . " | " .
120 $this->makeKnownLink( wfMsg( "faqpage" ), wfMsg("faq") )
121 . " | " .
122 $this->specialLink( "specialpages" ) . " | ";
124 if ( $wgUser->getID() )
126 $s .= $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
128 else
130 $s .= $this->makeKnownLink( $li, wfMsg( "login" ), $q );
133 return $s;
136 function quickBar()
138 global $wgOut, $wgTitle, $wgUser, $wgLang, $wgDisableUploads;
140 $tns=$wgTitle->getNamespace();
142 $s = "\n<div id='quickbar'>";
144 $sep = "<br />";
145 $s .= $this->menuHead( "qbfind" );
146 $s .= $this->searchForm();
148 $s .= $this->menuHead( "qbbrowse" )
149 . $this->mainPageLink()
150 . $sep . $this->specialLink( "recentchanges" )
151 . $sep . $this->specialLink( "randompage" );
152 if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
153 $s .= "\n";
155 if ( $wgOut->isArticle() ) {
156 $s .= $this->menuHead( "qbedit" );
157 $s .= "<strong>" . $this->editThisPage() . "</strong>";
159 $s .= $sep . $this->makeKnownLink( wfMsg( "edithelppage" ), wfMsg( "edithelp" ) );
161 if ( 0 != $wgUser->getID() ) {
162 $s .= $sep . $this->moveThisPage();
164 if ( $wgUser->isSysop() ) {
165 $dtp = $this->deleteThisPage();
166 if ( "" != $dtp ) {
167 $s .= $sep . $dtp;
169 $ptp = $this->protectThisPage();
170 if ( "" != $ptp ) {
171 $s .= $sep . $ptp;
174 $s .= $sep;
176 $s .= $this->menuHead( "qbpageoptions" );
177 $s .= $this->talkLink()
178 . $sep . $this->commentLink()
179 . $sep . $this->printableLink();
180 if ( 0 != $wgUser->getID() ) {
181 $s .= $sep . $this->watchThisPage();
184 $s .= $sep;
186 $s .= $this->menuHead("qbpageinfo")
187 . $this->historyLink()
188 . $sep . $this->whatLinksHere()
189 . $sep . $this->watchPageLinksLink();
191 if ( Namespace::getUser() == $tns || Namespace::getTalk(Namespace::getUser()) == $tns ) {
192 $id=User::idFromName($wgTitle->getText());
193 if ($id != 0) {
194 $s .= $sep . $this->userContribsLink();
195 if ( 0 != $wgUser->getID() ) {
196 $s .= $sep . $this->emailUserLink();
200 $s .= $sep;
203 $s .= $this->menuHead( "qbmyoptions" );
204 if ( 0 != $wgUser->getID() ) {
205 $name = $wgUser->getName();
206 $tl = $this->makeKnownLink( $wgLang->getNsText(
207 Namespace::getTalk( Namespace::getUser() ) ) . ":{$name}",
208 wfMsg( "mytalk" ) );
209 if ( 0 != $wgUser->getNewtalk() ) { $tl .= " *"; }
211 $s .= $this->makeKnownLink( $wgLang->getNsText(
212 Namespace::getUser() ) . ":{$name}", wfMsg( "mypage" ) )
213 . $sep . $tl
214 . $sep . $this->specialLink( "watchlist" )
215 . $sep . $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
216 wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) )
217 . $sep . $this->specialLink( "preferences" )
218 . $sep . $this->specialLink( "userlogout" );
219 } else {
220 $s .= $this->specialLink( "userlogin" );
223 $s .= $this->menuHead( "qbspecialpages" )
224 . $this->specialLink( "newpages" )
225 . $sep . $this->specialLink( "imagelist" )
226 . $sep . $this->specialLink( "statistics" )
227 . $sep . $this->bugReportsLink();
228 if ( 0 != $wgUser->getID() && !$wgDisableUploads ) {
229 $s .= $sep . $this->specialLink( "upload" );
231 global $wgSiteSupportPage;
232 if( $wgSiteSupportPage) {
233 $s .= $sep."<a href=\"".htmlspecialchars($wgSiteSupportPage)."\" class =\"internal\">"
234 .wfMsg( "sitesupport" )."</a>";
237 $s .= $sep . $this->makeKnownLink( $wgLang->specialPage( "Specialpages" ), wfMsg("moredotdotdot") );
239 $s .= $sep . "\n</div>\n";
240 return $s;
243 function menuHead( $key )
245 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
246 return $s;
249 function searchForm( $label = "" )
251 global $wgRequest;
253 $search = $wgRequest->getText( 'search' );
254 $action = $this->escapeSearchLink();
255 $s = "<form id=\"search\" method=\"get\" class=\"inline\" action=\"$action\">";
256 if ( "" != $label ) { $s .= "{$label}: "; }
258 $s .= "<input type='text' name=\"search\" size='14' value=\""
259 . htmlspecialchars(substr($search,0,256)) . "\" />"
260 . "<br /><input type='submit' name=\"go\" value=\"" . htmlspecialchars( wfMsg( "go" ) ) . "\" /> <input type='submit' name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" /></form>";
262 return $s;