Limit squid purging
[lhc/web/wiklou.git] / includes / SkinCologneBlue.php
1 <?php
2 # See skin.doc
3
4 class SkinCologneBlue extends Skin {
5
6 function getStylesheet()
7 {
8 return "cologneblue.css";
9 }
10 function getSkinName() {
11 return "cologneblue";
12 }
13
14 function doBeforeContent()
15 {
16 global $wgUser, $wgOut, $wgTitle;
17
18 $s = "";
19 $qb = $this->qbSetting();
20 $mainPageObj = Title::newMainPage();
21
22 $s .= "\n<div id='content'>\n<div id='topbar'>" .
23 "<table width='100%' border='0' cellspacing='0' cellpadding='8'><tr>";
24
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>";
28
29 $s .= "</td><td class='top' align='right' valign='bottom' width='100%'>";
30 $s .= $this->sysLinks();
31 $s .= "</td></tr><tr><td valign='top'>";
32
33 $s .= "<font size='-1'><span id='sitesub'>";
34 $s .= htmlspecialchars( wfMsg( "sitesubtitle" ) ) . "</span></font>";
35 $s .= "</td><td align='right'>" ;
36
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>";
43
44 $s .= "</td></tr></table>\n";
45
46 $s .= "\n</div>\n<div id='article'>";
47
48 $s .= $this->pageTitle();
49 $s .= $this->pageSubtitle() . "\n";
50 return $s;
51 }
52
53 function doAfterContent()
54 {
55 global $wgUser, $wgOut;
56
57 $s = "\n</div><br clear='all' />\n";
58
59 $s .= "\n<div id='footer'>";
60 $s .= "<table width='98%' border='0' cellspacing='0'><tr>";
61
62 $qb = $this->qbSetting();
63 if ( 1 == $qb || 3 == $qb ) { # Left
64 $s .= $this->getQuickbarCompensator();
65 }
66 $s .= "<td class='bottom' align='center' valign='top'>";
67
68 $s .= $this->bottomLinks();
69 $s .= "\n<br />" . $this->makeKnownLink( wfMsg( "mainpage" ) ) . " | "
70 . $this->aboutLink() . " | "
71 . $this->searchForm( wfMsg( "qbfind" ) );
72
73 $s .= "\n<br />" . $this->pageStats();
74
75 $s .= "</td>";
76 if ( 2 == $qb ) { # Right
77 $s .= $this->getQuickbarCompensator();
78 }
79 $s .= "</tr></table>\n</div>\n</div>\n";
80
81 if ( 0 != $qb ) { $s .= $this->quickBar(); }
82 return $s;
83 }
84 function doGetUserStyles()
85 {
86 global $wgUser, $wgOut, $wgStyleSheetPath;
87 $s = '';
88 $qb = $this->qbSetting();
89
90 if ( 2 == $qb ) { # Right
91 $s .= "#quickbar { position: absolute; right: 4px; }\n" .
92 "#article { margin-left: 4px; margin-right: 148px; }\n";
93 } else if ( 1 == $qb ) {
94 $s .= "#quickbar { position: absolute; left: 4px; }\n" .
95 "#article { margin-left: 148px; margin-right: 4px; }\n";
96 } else if ( 3 == $qb ) { # Floating
97 $s .= "#quickbar { position:absolute; left:4px } \n" .
98 "#topbar { margin-left: 148px }\n" .
99 "#article { margin-left:148px; margin-right: 4px; } \n" .
100 "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;} \n"; # Hides from IE
101 }
102 $s .= parent::doGetUserStyles();
103 return $s;
104 }
105 function sysLinks()
106 {
107 global $wgUser, $wgLang, $wgTitle;
108 $li = $wgLang->specialPage("Userlogin");
109 $lo = $wgLang->specialPage("Userlogout");
110
111 $rt = $wgTitle->getPrefixedURL();
112 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
113 $q = "";
114 } else {
115 $q = "returnto={$rt}";
116 }
117
118 $s = "" .
119 $this->makeKnownLink( wfMsg( "mainpage" ), wfMsg( "mainpage" ) )
120 . " | " .
121 $this->makeKnownLink( wfMsg( "aboutpage" ), wfMsg( "about" ) )
122 . " | " .
123 $this->makeKnownLink( wfMsg( "helppage" ), wfMsg( "help" ) )
124 . " | " .
125 $this->makeKnownLink( wfMsg( "faqpage" ), wfMsg("faq") )
126 . " | " .
127 $this->specialLink( "specialpages" ) . " | ";
128
129 if ( $wgUser->getID() )
130 {
131 $s .= $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
132 }
133 else
134 {
135 $s .= $this->makeKnownLink( $li, wfMsg( "login" ), $q );
136 }
137
138 return $s;
139 }
140
141 function quickBar()
142 {
143 global $wgOut, $wgTitle, $wgUser, $wgLang, $wgDisableUploads;
144
145 $tns=$wgTitle->getNamespace();
146
147 $s = "\n<div id='quickbar'>";
148
149 $sep = "<br />";
150 $s .= $this->menuHead( "qbfind" );
151 $s .= $this->searchForm();
152
153 $s .= $this->menuHead( "qbbrowse" )
154 . $this->mainPageLink()
155 . $sep . $this->specialLink( "recentchanges" )
156 . $sep . $this->specialLink( "randompage" );
157 if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
158 $s .= "\n";
159
160 if ( $wgOut->isArticle() ) {
161 $s .= $this->menuHead( "qbedit" );
162 $s .= "<strong>" . $this->editThisPage() . "</strong>";
163
164 $s .= $sep . $this->makeKnownLink( wfMsg( "edithelppage" ), wfMsg( "edithelp" ) );
165
166 if ( 0 != $wgUser->getID() ) {
167 $s .= $sep . $this->moveThisPage();
168 }
169 if ( $wgUser->isSysop() ) {
170 $dtp = $this->deleteThisPage();
171 if ( "" != $dtp ) {
172 $s .= $sep . $dtp;
173 }
174 $ptp = $this->protectThisPage();
175 if ( "" != $ptp ) {
176 $s .= $sep . $ptp;
177 }
178 }
179 $s .= $sep;
180
181 $s .= $this->menuHead( "qbpageoptions" );
182 $s .= $this->talkLink()
183 . $sep . $this->commentLink()
184 . $sep . $this->printableLink();
185 if ( 0 != $wgUser->getID() ) {
186 $s .= $sep . $this->watchThisPage();
187 }
188
189 $s .= $sep;
190
191 $s .= $this->menuHead("qbpageinfo")
192 . $this->historyLink()
193 . $sep . $this->whatLinksHere()
194 . $sep . $this->watchPageLinksLink();
195
196 if ( Namespace::getUser() == $tns || Namespace::getTalk(Namespace::getUser()) == $tns ) {
197 $id=User::idFromName($wgTitle->getText());
198 if ($id != 0) {
199 $s .= $sep . $this->userContribsLink();
200 if ( 0 != $wgUser->getID() ) {
201 $s .= $sep . $this->emailUserLink();
202 }
203 }
204 }
205 $s .= $sep;
206 }
207
208 $s .= $this->menuHead( "qbmyoptions" );
209 if ( 0 != $wgUser->getID() ) {
210 $name = $wgUser->getName();
211 $tl = $this->makeKnownLink( $wgLang->getNsText(
212 Namespace::getTalk( Namespace::getUser() ) ) . ":{$name}",
213 wfMsg( "mytalk" ) );
214 if ( 0 != $wgUser->getNewtalk() ) { $tl .= " *"; }
215
216 $s .= $this->makeKnownLink( $wgLang->getNsText(
217 Namespace::getUser() ) . ":{$name}", wfMsg( "mypage" ) )
218 . $sep . $tl
219 . $sep . $this->specialLink( "watchlist" )
220 . $sep . $this->makeKnownLink( $wgLang->specialPage( "Contributions" ),
221 wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) )
222 . $sep . $this->specialLink( "preferences" )
223 . $sep . $this->specialLink( "userlogout" );
224 } else {
225 $s .= $this->specialLink( "userlogin" );
226 }
227
228 $s .= $this->menuHead( "qbspecialpages" )
229 . $this->specialLink( "newpages" )
230 . $sep . $this->specialLink( "imagelist" )
231 . $sep . $this->specialLink( "statistics" )
232 . $sep . $this->bugReportsLink();
233 if ( 0 != $wgUser->getID() && !$wgDisableUploads ) {
234 $s .= $sep . $this->specialLink( "upload" );
235 }
236 global $wgSiteSupportPage;
237 if( $wgSiteSupportPage) {
238 $s .= $sep."<a href=\"".htmlspecialchars($wgSiteSupportPage)."\" class =\"internal\">"
239 .wfMsg( "sitesupport" )."</a>";
240 }
241
242 $s .= $sep . $this->makeKnownLink( $wgLang->specialPage( "Specialpages" ), wfMsg("moredotdotdot") );
243
244 $s .= $sep . "\n</div>\n";
245 return $s;
246 }
247
248 function menuHead( $key )
249 {
250 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
251 return $s;
252 }
253
254 function searchForm( $label = "" )
255 {
256 global $wgRequest;
257
258 $search = $wgRequest->getText( 'search' );
259 $action = $this->escapeSearchLink();
260 $s = "<form id=\"search\" method=\"get\" class=\"inline\" action=\"$action\">";
261 if ( "" != $label ) { $s .= "{$label}: "; }
262
263 $s .= "<input type='text' name=\"search\" size='14' value=\""
264 . htmlspecialchars(substr($search,0,256)) . "\" />"
265 . "<br /><input type='submit' name=\"go\" value=\"" . htmlspecialchars( wfMsg( "go" ) ) . "\" /> <input type='submit' name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" /></form>";
266
267 return $s;
268 }
269 }
270
271 ?>