Index: trunk/phase3/skins/CologneBlue.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * See docs/skin.txt |
| 4 | + * Cologne Blue: A nicer-looking alternative to Standard. |
5 | 5 | * |
6 | 6 | * @todo document |
7 | 7 | * @file |
— | — | @@ -19,37 +19,36 @@ |
20 | 20 | function getStylesheet() { |
21 | 21 | return 'common/cologneblue.css'; |
22 | 22 | } |
| 23 | + |
23 | 24 | function getSkinName() { |
24 | | - return "cologneblue"; |
| 25 | + return 'cologneblue'; |
25 | 26 | } |
26 | 27 | |
27 | 28 | function doBeforeContent() { |
28 | | - |
29 | | - $s = ""; |
30 | 29 | $qb = $this->qbSetting(); |
31 | 30 | $mainPageObj = Title::newMainPage(); |
32 | 31 | |
33 | | - $s .= "\n<div id='content'>\n<div id='topbar'>" . |
34 | | - "<table width='100%' border='0' cellspacing='0' cellpadding='8'><tr>"; |
| 32 | + $s = "\n<div id='content'>\n<div id='topbar'>" . |
| 33 | + '<table width="100%" border="0" cellspacing="0" cellpadding="8"><tr>'; |
35 | 34 | |
36 | | - $s .= "<td class='top' align='left' valign='middle' nowrap='nowrap'>"; |
37 | | - $s .= "<a href=\"" . $mainPageObj->escapeLocalURL() . "\">"; |
38 | | - $s .= "<span id='sitetitle'>" . wfMsg( "sitetitle" ) . "</span></a>"; |
| 35 | + $s .= '<td class="top" align="left" valign="middle" nowrap="nowrap">'; |
| 36 | + $s .= '<a href="' . $mainPageObj->escapeLocalURL() . '">'; |
| 37 | + $s .= '<span id="sitetitle">' . wfMsg( 'sitetitle' ) . '</span></a>'; |
39 | 38 | |
40 | | - $s .= "</td><td class='top' align='right' valign='bottom' width='100%'>"; |
| 39 | + $s .= '</td><td class="top" align="right" valign="bottom" width="100%">'; |
41 | 40 | $s .= $this->sysLinks(); |
42 | | - $s .= "</td></tr><tr><td valign='top'>"; |
| 41 | + $s .= '</td></tr><tr><td valign="top">'; |
43 | 42 | |
44 | | - $s .= "<font size='-1'><span id='sitesub'>"; |
45 | | - $s .= htmlspecialchars( wfMsg( "sitesubtitle" ) ) . "</span></font>"; |
46 | | - $s .= "</td><td align='right'>" ; |
| 43 | + $s .= '<font size="-1"><span id="sitesub">'; |
| 44 | + $s .= htmlspecialchars( wfMsg( 'sitesubtitle' ) ) . '</span></font>'; |
| 45 | + $s .= '</td><td align="right">'; |
47 | 46 | |
48 | | - $s .= "<font size='-1'><span id='langlinks'>" ; |
49 | | - $s .= str_replace ( "<br />" , "" , $this->otherLanguages() ); |
| 47 | + $s .= '<font size="-1"><span id="langlinks">'; |
| 48 | + $s .= str_replace( '<br />', '', $this->otherLanguages() ); |
50 | 49 | $cat = $this->getCategoryLinks(); |
51 | 50 | if( $cat ) $s .= "<br />$cat\n"; |
52 | | - $s .= "<br />" . $this->pageTitleLinks(); |
53 | | - $s .= "</span></font>"; |
| 51 | + $s .= '<br />' . $this->pageTitleLinks(); |
| 52 | + $s .= '</span></font>'; |
54 | 53 | |
55 | 54 | $s .= "</td></tr></table>\n"; |
56 | 55 | |
— | — | @@ -64,37 +63,38 @@ |
65 | 64 | return $s; |
66 | 65 | } |
67 | 66 | |
68 | | - function doAfterContent() |
69 | | - { |
| 67 | + function doAfterContent(){ |
70 | 68 | global $wgOut, $wgLang; |
71 | 69 | |
72 | 70 | $s = "\n</div><br clear='all' />\n"; |
73 | 71 | |
74 | 72 | $s .= "\n<div id='footer'>"; |
75 | | - $s .= "<table width='98%' border='0' cellspacing='0'><tr>"; |
| 73 | + $s .= '<table width="98%" border="0" cellspacing="0"><tr>'; |
76 | 74 | |
77 | 75 | $qb = $this->qbSetting(); |
78 | 76 | if ( 1 == $qb || 3 == $qb ) { # Left |
79 | 77 | $s .= $this->getQuickbarCompensator(); |
80 | 78 | } |
81 | | - $s .= "<td class='bottom' align='center' valign='top'>"; |
| 79 | + $s .= '<td class="bottom" align="center" valign="top">'; |
82 | 80 | |
83 | 81 | $s .= $this->bottomLinks(); |
84 | 82 | $s .= $wgLang->pipeList( array( |
85 | 83 | "\n<br />" . $this->makeKnownLinkObj( Title::newMainPage() ), |
86 | 84 | $this->aboutLink(), |
87 | | - $this->searchForm( wfMsg( "qbfind" ) ) |
| 85 | + $this->searchForm( wfMsg( 'qbfind' ) ) |
88 | 86 | ) ); |
89 | 87 | |
90 | 88 | $s .= "\n<br />" . $this->pageStats(); |
91 | 89 | |
92 | | - $s .= "</td>"; |
| 90 | + $s .= '</td>'; |
93 | 91 | if ( 2 == $qb ) { # Right |
94 | 92 | $s .= $this->getQuickbarCompensator(); |
95 | 93 | } |
96 | 94 | $s .= "</tr></table>\n</div>\n</div>\n"; |
97 | 95 | |
98 | | - if ( 0 != $qb ) { $s .= $this->quickBar(); } |
| 96 | + if ( 0 != $qb ) { |
| 97 | + $s .= $this->quickBar(); |
| 98 | + } |
99 | 99 | return $s; |
100 | 100 | } |
101 | 101 | |
— | — | @@ -124,22 +124,22 @@ |
125 | 125 | |
126 | 126 | function sysLinks() { |
127 | 127 | global $wgUser, $wgLang, $wgContLang, $wgTitle; |
128 | | - $li = $wgContLang->specialPage("Userlogin"); |
129 | | - $lo = $wgContLang->specialPage("Userlogout"); |
| 128 | + $li = $wgContLang->specialPage( 'Userlogin' ); |
| 129 | + $lo = $wgContLang->specialPage( 'Userlogout' ); |
130 | 130 | |
131 | 131 | $rt = $wgTitle->getPrefixedURL(); |
132 | 132 | if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) { |
133 | | - $q = ""; |
| 133 | + $q = ''; |
134 | 134 | } else { |
135 | 135 | $q = "returnto={$rt}"; |
136 | 136 | } |
137 | 137 | |
138 | 138 | $s = array( |
139 | 139 | $this->mainPageLink(), |
140 | | - $this->makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) ), |
141 | | - $this->makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) ), |
142 | | - $this->makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") ), |
143 | | - $this->specialLink( "specialpages" ) |
| 140 | + $this->makeKnownLink( wfMsgForContent( 'aboutpage' ), wfMsg( 'about' ) ), |
| 141 | + $this->makeKnownLink( wfMsgForContent( 'helppage' ), wfMsg( 'help' ) ), |
| 142 | + $this->makeKnownLink( wfMsgForContent( 'faqpage' ), wfMsg( 'faq' ) ), |
| 143 | + $this->specialLink( 'specialpages' ) |
144 | 144 | ); |
145 | 145 | |
146 | 146 | /* show links to different language variants */ |
— | — | @@ -150,9 +150,9 @@ |
151 | 151 | $s[] = $this->extensionTabLinks(); |
152 | 152 | } |
153 | 153 | if ( $wgUser->isLoggedIn() ) { |
154 | | - $s[] = $this->makeKnownLink( $lo, wfMsg( "logout" ), $q ); |
| 154 | + $s[] = $this->makeKnownLink( $lo, wfMsg( 'logout' ), $q ); |
155 | 155 | } else { |
156 | | - $s[] = $this->makeKnownLink( $li, wfMsg( "login" ), $q ); |
| 156 | + $s[] = $this->makeKnownLink( $li, wfMsg( 'login' ), $q ); |
157 | 157 | } |
158 | 158 | |
159 | 159 | return $wgLang->pipeList( $s ); |
— | — | @@ -162,19 +162,18 @@ |
163 | 163 | * Compute the sidebar |
164 | 164 | * @access private |
165 | 165 | */ |
166 | | - function quickBar() |
167 | | - { |
168 | | - global $wgOut, $wgTitle, $wgUser, $wgLang, $wgContLang, $wgEnableUploads; |
| 166 | + function quickBar(){ |
| 167 | + global $wgOut, $wgTitle, $wgUser, $wgEnableUploads; |
169 | 168 | |
170 | | - $tns=$wgTitle->getNamespace(); |
| 169 | + $tns = $wgTitle->getNamespace(); |
171 | 170 | |
172 | 171 | $s = "\n<div id='quickbar'>"; |
173 | 172 | |
174 | | - $sep = "<br />"; |
175 | | - $s .= $this->menuHead( "qbfind" ); |
| 173 | + $sep = '<br />'; |
| 174 | + $s .= $this->menuHead( 'qbfind' ); |
176 | 175 | $s .= $this->searchForm(); |
177 | 176 | |
178 | | - $s .= $this->menuHead( "qbbrowse" ); |
| 177 | + $s .= $this->menuHead( 'qbbrowse' ); |
179 | 178 | |
180 | 179 | # Use the first heading from the Monobook sidebar as the "browse" section |
181 | 180 | $bar = $this->buildSidebar(); |
— | — | @@ -191,29 +190,29 @@ |
192 | 191 | } |
193 | 192 | |
194 | 193 | if ( $wgOut->isArticle() ) { |
195 | | - $s .= $this->menuHead( "qbedit" ); |
196 | | - $s .= "<strong>" . $this->editThisPage() . "</strong>"; |
| 194 | + $s .= $this->menuHead( 'qbedit' ); |
| 195 | + $s .= '<strong>' . $this->editThisPage() . '</strong>'; |
197 | 196 | |
198 | | - $s .= $sep . $this->makeKnownLink( wfMsgForContent( "edithelppage" ), wfMsg( "edithelp" ) ); |
| 197 | + $s .= $sep . $this->makeKnownLink( wfMsgForContent( 'edithelppage' ), wfMsg( 'edithelp' ) ); |
199 | 198 | |
200 | 199 | if( $wgUser->isLoggedIn() ) { |
201 | 200 | $s .= $sep . $this->moveThisPage(); |
202 | 201 | } |
203 | | - if ( $wgUser->isAllowed('delete') ) { |
| 202 | + if ( $wgUser->isAllowed( 'delete' ) ) { |
204 | 203 | $dtp = $this->deleteThisPage(); |
205 | | - if ( "" != $dtp ) { |
| 204 | + if ( '' != $dtp ) { |
206 | 205 | $s .= $sep . $dtp; |
207 | 206 | } |
208 | 207 | } |
209 | | - if ( $wgUser->isAllowed('protect') ) { |
| 208 | + if ( $wgUser->isAllowed( 'protect' ) ) { |
210 | 209 | $ptp = $this->protectThisPage(); |
211 | | - if ( "" != $ptp ) { |
| 210 | + if ( '' != $ptp ) { |
212 | 211 | $s .= $sep . $ptp; |
213 | 212 | } |
214 | 213 | } |
215 | 214 | $s .= $sep; |
216 | 215 | |
217 | | - $s .= $this->menuHead( "qbpageoptions" ); |
| 216 | + $s .= $this->menuHead( 'qbpageoptions' ); |
218 | 217 | $s .= $this->talkLink() |
219 | 218 | . $sep . $this->commentLink() |
220 | 219 | . $sep . $this->printableLink(); |
— | — | @@ -223,14 +222,14 @@ |
224 | 223 | |
225 | 224 | $s .= $sep; |
226 | 225 | |
227 | | - $s .= $this->menuHead("qbpageinfo") |
| 226 | + $s .= $this->menuHead( 'qbpageinfo' ) |
228 | 227 | . $this->historyLink() |
229 | 228 | . $sep . $this->whatLinksHere() |
230 | 229 | . $sep . $this->watchPageLinksLink(); |
231 | 230 | |
232 | 231 | if( $tns == NS_USER || $tns == NS_USER_TALK ) { |
233 | | - $id=User::idFromName($wgTitle->getText()); |
234 | | - if ($id != 0) { |
| 232 | + $id = User::idFromName( $wgTitle->getText() ); |
| 233 | + if( $id != 0 ) { |
235 | 234 | $s .= $sep . $this->userContribsLink(); |
236 | 235 | if( $this->showEmailUser( $id ) ) { |
237 | 236 | $s .= $sep . $this->emailUserLink(); |
— | — | @@ -240,7 +239,7 @@ |
241 | 240 | $s .= $sep; |
242 | 241 | } |
243 | 242 | |
244 | | - $s .= $this->menuHead( "qbmyoptions" ); |
| 243 | + $s .= $this->menuHead( 'qbmyoptions' ); |
245 | 244 | if ( $wgUser->isLoggedIn() ) { |
246 | 245 | $name = $wgUser->getName(); |
247 | 246 | $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(), |
— | — | @@ -250,28 +249,28 @@ |
251 | 250 | } |
252 | 251 | |
253 | 252 | $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(), |
254 | | - wfMsg( "mypage" ) ) |
| 253 | + wfMsg( 'mypage' ) ) |
255 | 254 | . $sep . $tl |
256 | | - . $sep . $this->specialLink( "watchlist" ) |
257 | | - . $sep . $this->makeKnownLinkObj( SpecialPage::getSafeTitleFor( "Contributions", $wgUser->getName() ), |
258 | | - wfMsg( "mycontris" ) ) |
259 | | - . $sep . $this->specialLink( "preferences" ) |
260 | | - . $sep . $this->specialLink( "userlogout" ); |
| 255 | + . $sep . $this->specialLink( 'watchlist' ) |
| 256 | + . $sep . $this->makeKnownLinkObj( SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ), |
| 257 | + wfMsg( 'mycontris' ) ) |
| 258 | + . $sep . $this->specialLink( 'preferences' ) |
| 259 | + . $sep . $this->specialLink( 'userlogout' ); |
261 | 260 | } else { |
262 | | - $s .= $this->specialLink( "userlogin" ); |
| 261 | + $s .= $this->specialLink( 'userlogin' ); |
263 | 262 | } |
264 | 263 | |
265 | | - $s .= $this->menuHead( "qbspecialpages" ) |
266 | | - . $this->specialLink( "newpages" ) |
267 | | - . $sep . $this->specialLink( "listfiles" ) |
268 | | - . $sep . $this->specialLink( "statistics" ); |
| 264 | + $s .= $this->menuHead( 'qbspecialpages' ) |
| 265 | + . $this->specialLink( 'newpages' ) |
| 266 | + . $sep . $this->specialLink( 'listfiles' ) |
| 267 | + . $sep . $this->specialLink( 'statistics' ); |
269 | 268 | if ( $wgUser->isLoggedIn() && $wgEnableUploads ) { |
270 | | - $s .= $sep . $this->specialLink( "upload" ); |
| 269 | + $s .= $sep . $this->specialLink( 'upload' ); |
271 | 270 | } |
272 | 271 | global $wgSiteSupportPage; |
273 | | - if( $wgSiteSupportPage) { |
274 | | - $s .= $sep."<a href=\"".htmlspecialchars($wgSiteSupportPage)."\" class =\"internal\">" |
275 | | - .wfMsg( "sitesupport" )."</a>"; |
| 272 | + if( $wgSiteSupportPage ) { |
| 273 | + $s .= $sep . '<a href="' . htmlspecialchars( $wgSiteSupportPage ) . '" class="internal">' |
| 274 | + . wfMsg( 'sitesupport' ) . '</a>'; |
276 | 275 | } |
277 | 276 | |
278 | 277 | $s .= $sep . $this->makeKnownLinkObj( |
— | — | @@ -282,30 +281,30 @@ |
283 | 282 | return $s; |
284 | 283 | } |
285 | 284 | |
286 | | - function menuHead( $key ) |
287 | | - { |
| 285 | + function menuHead( $key ){ |
288 | 286 | $s = "\n<h6>" . wfMsg( $key ) . "</h6>"; |
289 | 287 | return $s; |
290 | 288 | } |
291 | 289 | |
292 | | - function searchForm( $label = "" ) |
293 | | - { |
| 290 | + function searchForm( $label = '' ){ |
294 | 291 | global $wgRequest, $wgUseTwoButtonsSearchForm; |
295 | 292 | |
296 | 293 | $search = $wgRequest->getText( 'search' ); |
297 | 294 | $action = $this->escapeSearchLink(); |
298 | 295 | $s = "<form id=\"searchform{$this->searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">"; |
299 | | - if ( "" != $label ) { $s .= "{$label}: "; } |
| 296 | + if( '' != $label ) { |
| 297 | + $s .= "{$label}: "; |
| 298 | + } |
300 | 299 | |
301 | 300 | $s .= "<input type='text' id=\"searchInput{$this->searchboxes}\" class=\"mw-searchInput\" name=\"search\" size=\"14\" value=\"" |
302 | | - . htmlspecialchars(substr($search,0,256)) . "\" /><br />" |
303 | | - . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( "searcharticle" ) ) . "\" />"; |
| 301 | + . htmlspecialchars( substr( $search, 0, 256 ) ) . "\" /><br />" |
| 302 | + . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( 'searcharticle' ) ) . "\" />"; |
304 | 303 | |
305 | | - if ($wgUseTwoButtonsSearchForm) |
306 | | - $s .= "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" />\n"; |
| 304 | + if( $wgUseTwoButtonsSearchForm ) |
| 305 | + $s .= "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( 'search' ) ) . "\" />\n"; |
307 | 306 | else |
308 | | - $s .= '<div><a href="$action" rel="search">' . wfMsg ('powersearch-legend') . "</a></div>\n"; |
309 | | - |
| 307 | + $s .= '<div><a href="' . $action . '" rel="search">' . wfMsg( 'powersearch-legend' ) . "</a></div>\n"; |
| 308 | + |
310 | 309 | $s .= '</form>'; |
311 | 310 | |
312 | 311 | // Ensure unique id's for search boxes made after the first |
— | — | @@ -313,6 +312,4 @@ |
314 | 313 | |
315 | 314 | return $s; |
316 | 315 | } |
317 | | -} |
318 | | - |
319 | | - |
| 316 | +} |
\ No newline at end of file |