r49005 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49004‎ | r49005 | r49006 >
Date:15:01, 29 March 2009
Author:ashley
Status:ok
Tags:
Comment:
cleanup to CologneBlue.php
Modified paths:
  • /trunk/phase3/skins/CologneBlue.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/CologneBlue.php
@@ -1,6 +1,6 @@
22 <?php
33 /**
4 - * See docs/skin.txt
 4+ * Cologne Blue: A nicer-looking alternative to Standard.
55 *
66 * @todo document
77 * @file
@@ -19,37 +19,36 @@
2020 function getStylesheet() {
2121 return 'common/cologneblue.css';
2222 }
 23+
2324 function getSkinName() {
24 - return "cologneblue";
 25+ return 'cologneblue';
2526 }
2627
2728 function doBeforeContent() {
28 -
29 - $s = "";
3029 $qb = $this->qbSetting();
3130 $mainPageObj = Title::newMainPage();
3231
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>';
3534
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>';
3938
40 - $s .= "</td><td class='top' align='right' valign='bottom' width='100%'>";
 39+ $s .= '</td><td class="top" align="right" valign="bottom" width="100%">';
4140 $s .= $this->sysLinks();
42 - $s .= "</td></tr><tr><td valign='top'>";
 41+ $s .= '</td></tr><tr><td valign="top">';
4342
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">';
4746
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() );
5049 $cat = $this->getCategoryLinks();
5150 if( $cat ) $s .= "<br />$cat\n";
52 - $s .= "<br />" . $this->pageTitleLinks();
53 - $s .= "</span></font>";
 51+ $s .= '<br />' . $this->pageTitleLinks();
 52+ $s .= '</span></font>';
5453
5554 $s .= "</td></tr></table>\n";
5655
@@ -64,37 +63,38 @@
6564 return $s;
6665 }
6766
68 - function doAfterContent()
69 - {
 67+ function doAfterContent(){
7068 global $wgOut, $wgLang;
7169
7270 $s = "\n</div><br clear='all' />\n";
7371
7472 $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>';
7674
7775 $qb = $this->qbSetting();
7876 if ( 1 == $qb || 3 == $qb ) { # Left
7977 $s .= $this->getQuickbarCompensator();
8078 }
81 - $s .= "<td class='bottom' align='center' valign='top'>";
 79+ $s .= '<td class="bottom" align="center" valign="top">';
8280
8381 $s .= $this->bottomLinks();
8482 $s .= $wgLang->pipeList( array(
8583 "\n<br />" . $this->makeKnownLinkObj( Title::newMainPage() ),
8684 $this->aboutLink(),
87 - $this->searchForm( wfMsg( "qbfind" ) )
 85+ $this->searchForm( wfMsg( 'qbfind' ) )
8886 ) );
8987
9088 $s .= "\n<br />" . $this->pageStats();
9189
92 - $s .= "</td>";
 90+ $s .= '</td>';
9391 if ( 2 == $qb ) { # Right
9492 $s .= $this->getQuickbarCompensator();
9593 }
9694 $s .= "</tr></table>\n</div>\n</div>\n";
9795
98 - if ( 0 != $qb ) { $s .= $this->quickBar(); }
 96+ if ( 0 != $qb ) {
 97+ $s .= $this->quickBar();
 98+ }
9999 return $s;
100100 }
101101
@@ -124,22 +124,22 @@
125125
126126 function sysLinks() {
127127 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' );
130130
131131 $rt = $wgTitle->getPrefixedURL();
132132 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
133 - $q = "";
 133+ $q = '';
134134 } else {
135135 $q = "returnto={$rt}";
136136 }
137137
138138 $s = array(
139139 $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' )
144144 );
145145
146146 /* show links to different language variants */
@@ -150,9 +150,9 @@
151151 $s[] = $this->extensionTabLinks();
152152 }
153153 if ( $wgUser->isLoggedIn() ) {
154 - $s[] = $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
 154+ $s[] = $this->makeKnownLink( $lo, wfMsg( 'logout' ), $q );
155155 } else {
156 - $s[] = $this->makeKnownLink( $li, wfMsg( "login" ), $q );
 156+ $s[] = $this->makeKnownLink( $li, wfMsg( 'login' ), $q );
157157 }
158158
159159 return $wgLang->pipeList( $s );
@@ -162,19 +162,18 @@
163163 * Compute the sidebar
164164 * @access private
165165 */
166 - function quickBar()
167 - {
168 - global $wgOut, $wgTitle, $wgUser, $wgLang, $wgContLang, $wgEnableUploads;
 166+ function quickBar(){
 167+ global $wgOut, $wgTitle, $wgUser, $wgEnableUploads;
169168
170 - $tns=$wgTitle->getNamespace();
 169+ $tns = $wgTitle->getNamespace();
171170
172171 $s = "\n<div id='quickbar'>";
173172
174 - $sep = "<br />";
175 - $s .= $this->menuHead( "qbfind" );
 173+ $sep = '<br />';
 174+ $s .= $this->menuHead( 'qbfind' );
176175 $s .= $this->searchForm();
177176
178 - $s .= $this->menuHead( "qbbrowse" );
 177+ $s .= $this->menuHead( 'qbbrowse' );
179178
180179 # Use the first heading from the Monobook sidebar as the "browse" section
181180 $bar = $this->buildSidebar();
@@ -191,29 +190,29 @@
192191 }
193192
194193 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>';
197196
198 - $s .= $sep . $this->makeKnownLink( wfMsgForContent( "edithelppage" ), wfMsg( "edithelp" ) );
 197+ $s .= $sep . $this->makeKnownLink( wfMsgForContent( 'edithelppage' ), wfMsg( 'edithelp' ) );
199198
200199 if( $wgUser->isLoggedIn() ) {
201200 $s .= $sep . $this->moveThisPage();
202201 }
203 - if ( $wgUser->isAllowed('delete') ) {
 202+ if ( $wgUser->isAllowed( 'delete' ) ) {
204203 $dtp = $this->deleteThisPage();
205 - if ( "" != $dtp ) {
 204+ if ( '' != $dtp ) {
206205 $s .= $sep . $dtp;
207206 }
208207 }
209 - if ( $wgUser->isAllowed('protect') ) {
 208+ if ( $wgUser->isAllowed( 'protect' ) ) {
210209 $ptp = $this->protectThisPage();
211 - if ( "" != $ptp ) {
 210+ if ( '' != $ptp ) {
212211 $s .= $sep . $ptp;
213212 }
214213 }
215214 $s .= $sep;
216215
217 - $s .= $this->menuHead( "qbpageoptions" );
 216+ $s .= $this->menuHead( 'qbpageoptions' );
218217 $s .= $this->talkLink()
219218 . $sep . $this->commentLink()
220219 . $sep . $this->printableLink();
@@ -223,14 +222,14 @@
224223
225224 $s .= $sep;
226225
227 - $s .= $this->menuHead("qbpageinfo")
 226+ $s .= $this->menuHead( 'qbpageinfo' )
228227 . $this->historyLink()
229228 . $sep . $this->whatLinksHere()
230229 . $sep . $this->watchPageLinksLink();
231230
232231 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 ) {
235234 $s .= $sep . $this->userContribsLink();
236235 if( $this->showEmailUser( $id ) ) {
237236 $s .= $sep . $this->emailUserLink();
@@ -240,7 +239,7 @@
241240 $s .= $sep;
242241 }
243242
244 - $s .= $this->menuHead( "qbmyoptions" );
 243+ $s .= $this->menuHead( 'qbmyoptions' );
245244 if ( $wgUser->isLoggedIn() ) {
246245 $name = $wgUser->getName();
247246 $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
@@ -250,28 +249,28 @@
251250 }
252251
253252 $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(),
254 - wfMsg( "mypage" ) )
 253+ wfMsg( 'mypage' ) )
255254 . $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' );
261260 } else {
262 - $s .= $this->specialLink( "userlogin" );
 261+ $s .= $this->specialLink( 'userlogin' );
263262 }
264263
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' );
269268 if ( $wgUser->isLoggedIn() && $wgEnableUploads ) {
270 - $s .= $sep . $this->specialLink( "upload" );
 269+ $s .= $sep . $this->specialLink( 'upload' );
271270 }
272271 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>';
276275 }
277276
278277 $s .= $sep . $this->makeKnownLinkObj(
@@ -282,30 +281,30 @@
283282 return $s;
284283 }
285284
286 - function menuHead( $key )
287 - {
 285+ function menuHead( $key ){
288286 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
289287 return $s;
290288 }
291289
292 - function searchForm( $label = "" )
293 - {
 290+ function searchForm( $label = '' ){
294291 global $wgRequest, $wgUseTwoButtonsSearchForm;
295292
296293 $search = $wgRequest->getText( 'search' );
297294 $action = $this->escapeSearchLink();
298295 $s = "<form id=\"searchform{$this->searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">";
299 - if ( "" != $label ) { $s .= "{$label}: "; }
 296+ if( '' != $label ) {
 297+ $s .= "{$label}: ";
 298+ }
300299
301300 $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' ) ) . "\" />";
304303
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";
307306 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+
310309 $s .= '</form>';
311310
312311 // Ensure unique id's for search boxes made after the first
@@ -313,6 +312,4 @@
314313
315314 return $s;
316315 }
317 -}
318 -
319 -
 316+}
\ No newline at end of file

Status & tagging log