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