53655325bbf94ea5f039aa1e661547744f88f564
[lhc/web/wiklou.git] / includes / SkinCologneBlue.php
1 <?
2 # See skin.doc
3
4 class SkinCologneBlue extends Skin {
5
6 function initPage()
7 {
8 global $wgOut, $wgStyleSheetPath;
9
10 $wgOut->addLink( "stylesheet", "",
11 "{$wgStyleSheetPath}/cologneblue.css" );
12 }
13
14 function doBeforeContent()
15 {
16 global $wgUser, $wgOut, $wgTitle;
17
18 $s = "";
19 $qb = $this->qbSetting();
20
21 $s .= "\n<div id='content'>\n<div id='topbar'>" .
22 "<table width='100%' border=0 cellspacing=0 cellpadding=8><tr>";
23
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>";
27
28 $s .= "</td><td class='top' align=right valign=bottom width='100%'>";
29 $s .= $this->sysLinks();
30 $s .= "</td></tr><tr><td valign=top>";
31
32 $s .= "<font size='-1'><span id='sitesub'>";
33 $s .= wfMsg( "sitesubtitle" ) . "</span></font>";
34 $s .= "</td><td align=right>" ;
35
36 $s .= "<font size='-1'><span id='langlinks'>" ;
37 $s .= str_replace ( "<br>" , "" , $this->otherLanguages() ) ;
38 $s .= "<br>" . $this->pageTitleLinks();
39 $s .= "</span></font>";
40
41 $s .= "</td></tr></table>\n";
42
43 $s .= "\n</div>\n<div id='article'>";
44
45 $s .= $this->pageTitle();
46 $s .= $this->pageSubtitle() . "\n<p>";
47 return $s;
48 }
49
50 function doAfterContent()
51 {
52 global $wgUser, $wgOut;
53
54 $s = "\n</div><br clear=all>\n";
55
56 $s .= "\n<div id='footer'>";
57 $s .= "<table width='98%' border=0 cellspacing=0><tr>";
58
59 $qb = $this->qbSetting();
60 if ( 1 == $qb || 3 == $qb ) { # Left
61 $s .= $this->getQuickbarCompensator();
62 }
63 $s .= "<td class='bottom' align=center valign=top>";
64
65 $s .= $this->bottomLinks();
66 $s .= "\n<br>" . $this->makeKnownLink( wfMsg( "mainpage" ),
67 wfMsg( "mainpage" ) ) . " | "
68 . $this->aboutLink() . " | "
69 . $this->searchForm( wfMsg( "qbfind" ) );
70
71 $s .= "\n<br>" . $this->pageStats();
72
73 $s .= "</td>";
74 if ( 2 == $qb ) { # Right
75 $s .= $this->getQuickbarCompensator();
76 }
77 $s .= "</tr></table>\n</div>\n</div>\n";
78
79 if ( 0 != $qb ) { $s .= $this->quickBar(); }
80 return $s;
81 }
82 function doGetUserStyles()
83 {
84 global $wgUser, $wgOut, $wgStyleSheetPath;
85
86 $s = parent::doGetUserStyles();
87 $qb = $this->qbSetting();
88
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";
95 }
96 return $s;
97 }
98 function sysLinks()
99 {
100 global $wgUser, $wgLang, $wgTitle;
101 $li = $wgLang->specialPage("Userlogin");
102 $lo = $wgLang->specialPage("Userlogout");
103
104 $rt = $wgTitle->getPrefixedURL();
105 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
106 $q = "";
107 } else {
108 $q = "returnto={$rt}";
109 }
110
111 $s .= "\n<br>" . $this->makeKnownLink( $li,
112 wfMsg( "login" ), $q );
113
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" ) . " | ";
124
125 if ( $wgUser->getID() )
126 {
127 $s .= $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
128 }
129 else
130 {
131 $s .= $this->makeKnownLink( $li, wfMsg( "login" ), $q );
132 }
133
134 return $s;
135 }
136
137 function quickBar()
138 {
139 global $wgOut, $wgTitle, $wgUser, $wgLang, $wgDisableUploads;
140
141 $tns=$wgTitle->getNamespace();
142
143 $s = "\n<div id='quickbar'>";
144
145 $sep = "<br>";
146 $s .= $this->menuHead( "qbfind" );
147 $s .= $this->searchForm();
148
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";
155
156 if ( $wgOut->isArticle() ) {
157 $s .= $this->menuHead( "qbedit" );
158 $s .= "<strong>" . $this->editThisPage() . "</strong>";
159
160 $s .= $sep . $this->makeKnownLink( wfMsg( "edithelppage" ), wfMsg( "edithelp" ) );
161
162 if ( 0 != $wgUser->getID() ) {
163 $s .= $sep . $this->moveThisPage();
164 }
165 if ( $wgUser->isSysop() ) {
166 $dtp = $this->deleteThisPage();
167 if ( "" != $dtp ) {
168 $s .= $sep . $dtp;
169 }
170 $ptp = $this->protectThisPage();
171 if ( "" != $ptp ) {
172 $s .= $sep . $ptp;
173 }
174 }
175 $s .= $sep;
176
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();
183 }
184
185 $s .= $sep;
186
187 $s .= $this->menuHead("qbpageinfo")
188 . $this->historyLink()
189 . $sep . $this->whatLinksHere()
190 . $sep . $this->watchPageLinksLink();
191
192 if ( Namespace::getUser() == $tns || Namespace::getTalk(Namespace::getUser()) == $tns ) {
193 if ( 0 != $wgUser->getID() ) {
194 $id=User::idFromName($wgTitle->getText());
195 if ($id != 0) {
196 $s .= $sep . $this->userContribsLink();
197 $s .= $sep . $this->emailUserLink();
198 }
199 }
200 }
201 $s .= $sep;
202 }
203
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 .= " *"; }
211
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" );
220 }
221
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" );
229 }
230
231 $s .= $sep . $this->makeKnownLink( $wgLang->specialPage( "Specialpages" ), wfMsg("moredotdotdot") );
232
233 $s .= $sep . "\n</div>\n";
234 return $s;
235 }
236
237 function menuHead( $key )
238 {
239 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
240 return $s;
241 }
242
243 function searchForm( $label = "" )
244 {
245 global $search;
246 $s = "<form id=\"search\" method=\"get\" class=\"inline\" action=\"" .
247 wfLocalUrlE( "" ) . "\">";
248 if ( "" != $label ) { $s .= "{$label}: "; }
249
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>";
253
254 return $s;
255 }
256 }
257
258 ?>