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