Index: trunk/phase3/skins/Simple.php |
— | — | @@ -1,8 +1,8 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * See docs/skin.txt |
| 4 | + * Simple: A lightweight skin with a simple white-background sidebar and no |
| 5 | + * top bar. |
5 | 6 | * |
6 | | - * @todo document |
7 | 7 | * @file |
8 | 8 | * @ingroup Skins |
9 | 9 | */ |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | require_once( dirname(__FILE__) . '/MonoBook.php' ); |
16 | 16 | |
17 | 17 | /** |
18 | | - * @todo document |
| 18 | + * Inherit main code from SkinTemplate, set the CSS and template filter. |
19 | 19 | * @ingroup Skins |
20 | 20 | */ |
21 | 21 | class SkinSimple extends SkinTemplate { |
— | — | @@ -28,17 +28,16 @@ |
29 | 29 | function setupSkinUserCss( OutputPage $out ){ |
30 | 30 | $out->addStyle( 'simple/main.css', 'screen' ); |
31 | 31 | $out->addStyle( 'simple/rtl.css', '', '', 'rtl' ); |
32 | | - |
33 | 32 | } |
34 | 33 | |
35 | 34 | function reallyGenerateUserStylesheet() { |
36 | 35 | global $wgUser; |
37 | 36 | $s = ''; |
38 | | - if (($undopt = $wgUser->getOption("underline")) != 2) { |
| 37 | + if( ( $undopt = $wgUser->getOption( 'underline' ) ) != 2 ) { |
39 | 38 | $underline = $undopt ? 'underline' : 'none'; |
40 | 39 | $s .= "a { text-decoration: $underline; }\n"; |
41 | 40 | } |
42 | | - if ($wgUser->getOption('highlightbroken')) { |
| 41 | + if( $wgUser->getOption( 'highlightbroken' ) ) { |
43 | 42 | $s .= "a.new, #quickbar a.new { text-decoration: line-through; }\n"; |
44 | 43 | } else { |
45 | 44 | $s .= <<<END |
— | — | @@ -59,17 +58,15 @@ |
60 | 59 | } |
61 | 60 | END; |
62 | 61 | } |
63 | | - if ($wgUser->getOption('justify')) { |
| 62 | + if( $wgUser->getOption( 'justify' ) ) { |
64 | 63 | $s .= "#article, #bodyContent { text-align: justify; }\n"; |
65 | 64 | } |
66 | | - if (!$wgUser->getOption('showtoc')) { |
| 65 | + if( !$wgUser->getOption( 'showtoc' ) ) { |
67 | 66 | $s .= "#toc { display: none; }\n"; |
68 | 67 | } |
69 | | - if (!$wgUser->getOption('editsection')) { |
| 68 | + if( !$wgUser->getOption( 'editsection' ) ) { |
70 | 69 | $s .= ".editsection { display: none; }\n"; |
71 | 70 | } |
72 | 71 | return $s; |
73 | 72 | } |
74 | | -} |
75 | | - |
76 | | - |
| 73 | +} |
\ No newline at end of file |
Index: trunk/phase3/skins/Standard.php |
— | — | @@ -1,8 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * See docs/skin.txt |
| 4 | + * Standard (a.k.a. Classic) skin: old MediaWiki default skin |
5 | 5 | * |
6 | | - * @todo document |
7 | 6 | * @file |
8 | 7 | * @ingroup Skins |
9 | 8 | */ |
— | — | @@ -72,10 +71,10 @@ |
73 | 72 | |
74 | 73 | if ( 3 == $this->qbSetting() ) { # Floating left |
75 | 74 | $qb = "setup(\"quickbar\")"; |
76 | | - if($a["onload"]) { |
77 | | - $a["onload"] .= ";$qb"; |
| 75 | + if( $a['onload'] ) { |
| 76 | + $a['onload'] .= ";$qb"; |
78 | 77 | } else { |
79 | | - $a["onload"] = $qb; |
| 78 | + $a['onload'] = $qb; |
80 | 79 | } |
81 | 80 | } |
82 | 81 | return $a; |
— | — | @@ -83,27 +82,26 @@ |
84 | 83 | |
85 | 84 | function doAfterContent() { |
86 | 85 | global $wgContLang, $wgLang; |
87 | | - $fname = 'SkinStandard::doAfterContent'; |
88 | | - wfProfileIn( $fname ); |
89 | | - wfProfileIn( $fname.'-1' ); |
| 86 | + wfProfileIn( __METHOD__ ); |
| 87 | + wfProfileIn( __METHOD__ . '-1' ); |
90 | 88 | |
91 | 89 | $s = "\n</div><br style=\"clear:both\" />\n"; |
92 | 90 | $s .= "\n<div id='footer'>"; |
93 | 91 | $s .= '<table border="0" cellspacing="0"><tr>'; |
94 | 92 | |
95 | | - wfProfileOut( $fname.'-1' ); |
96 | | - wfProfileIn( $fname.'-2' ); |
| 93 | + wfProfileOut( __METHOD__ . '-1' ); |
| 94 | + wfProfileIn( __METHOD__ . '-2' ); |
97 | 95 | |
98 | 96 | $qb = $this->qbSetting(); |
99 | | - $shove = ($qb != 0); |
100 | | - $left = ($qb == 1 || $qb == 3); |
101 | | - if($wgContLang->isRTL()) $left = !$left; |
| 97 | + $shove = ( $qb != 0 ); |
| 98 | + $left = ( $qb == 1 || $qb == 3 ); |
| 99 | + if( $wgContLang->isRTL() ) $left = !$left; |
102 | 100 | |
103 | 101 | if ( $shove && $left ) { # Left |
104 | 102 | $s .= $this->getQuickbarCompensator(); |
105 | 103 | } |
106 | | - wfProfileOut( $fname.'-2' ); |
107 | | - wfProfileIn( $fname.'-3' ); |
| 104 | + wfProfileOut( __METHOD__ . '-2' ); |
| 105 | + wfProfileIn( __METHOD__ . '-3' ); |
108 | 106 | $l = $wgContLang->isRTL() ? 'right' : 'left'; |
109 | 107 | $s .= "<td class='bottom' align='$l' valign='top'>"; |
110 | 108 | |
— | — | @@ -115,17 +113,19 @@ |
116 | 114 | $this->searchForm() ) ) |
117 | 115 | . '<br /><span id="pagestats">' . $this->pageStats() . '</span>'; |
118 | 116 | |
119 | | - $s .= "</td>"; |
| 117 | + $s .= '</td>'; |
120 | 118 | if ( $shove && !$left ) { # Right |
121 | 119 | $s .= $this->getQuickbarCompensator(); |
122 | 120 | } |
123 | 121 | $s .= "</tr></table>\n</div>\n</div>\n"; |
124 | 122 | |
125 | | - wfProfileOut( $fname.'-3' ); |
126 | | - wfProfileIn( $fname.'-4' ); |
127 | | - if ( 0 != $qb ) { $s .= $this->quickBar(); } |
128 | | - wfProfileOut( $fname.'-4' ); |
129 | | - wfProfileOut( $fname ); |
| 123 | + wfProfileOut( __METHOD__ . '-3' ); |
| 124 | + wfProfileIn( __METHOD__ . '-4' ); |
| 125 | + if ( 0 != $qb ) { |
| 126 | + $s .= $this->quickBar(); |
| 127 | + } |
| 128 | + wfProfileOut( __METHOD__ . '-4' ); |
| 129 | + wfProfileOut( __METHOD__ ); |
130 | 130 | return $s; |
131 | 131 | } |
132 | 132 | |
— | — | @@ -133,12 +133,11 @@ |
134 | 134 | global $wgOut, $wgTitle, $wgUser, $wgRequest, $wgContLang; |
135 | 135 | global $wgEnableUploads, $wgRemoteUploads; |
136 | 136 | |
137 | | - $fname = 'Skin::quickBar'; |
138 | | - wfProfileIn( $fname ); |
| 137 | + wfProfileIn( __METHOD__ ); |
139 | 138 | |
140 | 139 | $action = $wgRequest->getText( 'action' ); |
141 | 140 | $wpPreview = $wgRequest->getBool( 'wpPreview' ); |
142 | | - $tns=$wgTitle->getNamespace(); |
| 141 | + $tns = $wgTitle->getNamespace(); |
143 | 142 | |
144 | 143 | $s = "\n<div id='quickbar'>"; |
145 | 144 | $s .= "\n" . $this->logoText() . "\n<hr class='sep' />"; |
— | — | @@ -162,17 +161,17 @@ |
163 | 162 | if( $wgUser->isLoggedIn() ) { |
164 | 163 | $s.= $this->specialLink( 'watchlist' ) ; |
165 | 164 | $s .= $sep . $this->makeKnownLink( $wgContLang->specialPage( 'Contributions' ), |
166 | | - wfMsg( 'mycontris' ), 'target=' . wfUrlencode($wgUser->getName() ) ); |
| 165 | + wfMsg( 'mycontris' ), 'target=' . wfUrlencode( $wgUser->getName() ) ); |
167 | 166 | } |
168 | 167 | // only show watchlist link if logged in |
169 | 168 | $s .= "\n<hr class='sep' />"; |
170 | 169 | $articleExists = $wgTitle->getArticleId(); |
171 | | - if ( $wgOut->isArticle() || $action =='edit' || $action =='history' || $wpPreview) { |
172 | | - if($wgOut->isArticle()) { |
| 170 | + if ( $wgOut->isArticle() || $action == 'edit' || $action == 'history' || $wpPreview ) { |
| 171 | + if( $wgOut->isArticle() ) { |
173 | 172 | $s .= '<strong>' . $this->editThisPage() . '</strong>'; |
174 | 173 | } else { # backlink to the article in edit or history mode |
175 | | - if($articleExists){ # no backlink if no article |
176 | | - switch($tns) { |
| 174 | + if( $articleExists ){ # no backlink if no article |
| 175 | + switch( $tns ) { |
177 | 176 | case NS_TALK: |
178 | 177 | case NS_USER_TALK: |
179 | 178 | case NS_PROJECT_TALK: |
— | — | @@ -208,19 +207,19 @@ |
209 | 208 | $text = wfMsg( 'categorypage' ); |
210 | 209 | break; |
211 | 210 | default: |
212 | | - $text= wfMsg( 'articlepage' ); |
| 211 | + $text = wfMsg( 'articlepage' ); |
213 | 212 | } |
214 | 213 | |
215 | 214 | $link = $wgTitle->getText(); |
216 | | - if ($nstext = $wgContLang->getNsText($tns) ) { # add namespace if necessary |
217 | | - $link = $nstext . ':' . $link ; |
| 215 | + if( $nstext = $wgContLang->getNsText( $tns ) ) { # add namespace if necessary |
| 216 | + $link = $nstext . ':' . $link; |
218 | 217 | } |
219 | 218 | |
220 | 219 | $s .= $this->makeLink( $link, $text ); |
221 | 220 | } elseif( $wgTitle->getNamespace() != NS_SPECIAL ) { |
222 | 221 | # we just throw in a "New page" text to tell the user that he's in edit mode, |
223 | 222 | # and to avoid messing with the separator that is prepended to the next item |
224 | | - $s .= '<strong>' . wfMsg('newpage') . '</strong>'; |
| 223 | + $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>'; |
225 | 224 | } |
226 | 225 | |
227 | 226 | } |
— | — | @@ -240,32 +239,31 @@ |
241 | 240 | unwatched. Therefore we do not show the "Watch this page" link in edit mode |
242 | 241 | */ |
243 | 242 | if ( $wgUser->isLoggedIn() && $articleExists) { |
244 | | - if($action!='edit' && $action != 'submit' ) |
245 | | - { |
| 243 | + if( $action != 'edit' && $action != 'submit' ){ |
246 | 244 | $s .= $sep . $this->watchThisPage(); |
247 | 245 | } |
248 | 246 | if ( $wgTitle->userCan( 'edit' ) ) |
249 | 247 | $s .= $sep . $this->moveThisPage(); |
250 | 248 | } |
251 | | - if ( $wgUser->isAllowed('delete') and $articleExists ) { |
| 249 | + if ( $wgUser->isAllowed( 'delete' ) and $articleExists ) { |
252 | 250 | $s .= $sep . $this->deleteThisPage() . |
253 | 251 | $sep . $this->protectThisPage(); |
254 | 252 | } |
255 | 253 | $s .= $sep . $this->talkLink(); |
256 | | - if ($articleExists && $action !='history') { |
| 254 | + if( $articleExists && $action != 'history' ) { |
257 | 255 | $s .= $sep . $this->historyLink(); |
258 | 256 | } |
259 | | - $s.=$sep . $this->whatLinksHere(); |
| 257 | + $s.= $sep . $this->whatLinksHere(); |
260 | 258 | |
261 | | - if($wgOut->isArticleRelated()) { |
| 259 | + if( $wgOut->isArticleRelated() ) { |
262 | 260 | $s .= $sep . $this->watchPageLinksLink(); |
263 | 261 | } |
264 | 262 | |
265 | 263 | if ( NS_USER == $wgTitle->getNamespace() |
266 | 264 | || $wgTitle->getNamespace() == NS_USER_TALK ) { |
267 | 265 | |
268 | | - $id=User::idFromName($wgTitle->getText()); |
269 | | - $ip=User::isIP($wgTitle->getText()); |
| 266 | + $id = User::idFromName( $wgTitle->getText() ); |
| 267 | + $ip = User::isIP( $wgTitle->getText() ); |
270 | 268 | |
271 | 269 | if( $id || $ip ){ |
272 | 270 | $s .= $sep . $this->userContribsLink(); |
— | — | @@ -289,9 +287,8 @@ |
290 | 288 | } |
291 | 289 | |
292 | 290 | $s .= "\n<br /></div>\n"; |
293 | | - wfProfileOut( $fname ); |
| 291 | + wfProfileOut( __METHOD__ ); |
294 | 292 | return $s; |
295 | 293 | } |
296 | 294 | |
297 | | - |
298 | 295 | } |
Index: trunk/phase3/skins/MySkin.php |
— | — | @@ -1,8 +1,8 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * See docs/skin.txt |
| 4 | + * MySkin: Monobook without the CSS. The idea is that you |
| 5 | + * customise it using user or site CSS |
5 | 6 | * |
6 | | - * @todo document |
7 | 7 | * @file |
8 | 8 | * @ingroup Skins |
9 | 9 | */ |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | die( -1 ); |
13 | 13 | |
14 | 14 | /** |
15 | | - * @todo document |
| 15 | + * Inherit main code from SkinTemplate, set the CSS and template filter. |
16 | 16 | * @ingroup Skins |
17 | 17 | */ |
18 | 18 | class SkinMySkin extends SkinTemplate { |
Index: trunk/phase3/skins/Chick.php |
— | — | @@ -1,8 +1,8 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * See docs/skin.txt |
| 4 | + * Chick: A lightweight Monobook skin with no sidebar, the sidebar links are |
| 5 | + * given at the bottom of the page instead, as in the unstyled MySkin. |
5 | 6 | * |
6 | | - * @todo document |
7 | 7 | * @file |
8 | 8 | * @ingroup Skins |
9 | 9 | */ |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | require_once( dirname(__FILE__) . '/MonoBook.php' ); |
16 | 16 | |
17 | 17 | /** |
18 | | - * @todo document |
| 18 | + * Inherit main code from SkinTemplate, set the CSS and template filter. |
19 | 19 | * @ingroup Skins |
20 | 20 | */ |
21 | 21 | class SkinChick extends SkinTemplate { |
— | — | @@ -33,6 +33,4 @@ |
34 | 34 | $out->addStyle( 'chick/IE55Fixes.css', 'screen,handheld', 'IE 5.5000' ); |
35 | 35 | $out->addStyle( 'chick/IE60Fixes.css', 'screen,handheld', 'IE 6' ); |
36 | 36 | } |
37 | | -} |
38 | | - |
39 | | - |
| 37 | +} |
\ No newline at end of file |
Index: trunk/phase3/skins/Nostalgia.php |
— | — | @@ -1,8 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | /** |
4 | | - * See docs/skin.txt |
| 4 | + * Nostalgia: A skin which looks like Wikipedia did in its first year (2001). |
5 | 5 | * |
6 | | - * @todo document |
7 | 6 | * @file |
8 | 7 | * @ingroup Skins |
9 | 8 | */ |
— | — | @@ -19,18 +18,19 @@ |
20 | 19 | function getStylesheet() { |
21 | 20 | return 'common/nostalgia.css'; |
22 | 21 | } |
| 22 | + |
23 | 23 | function getSkinName() { |
24 | | - return "nostalgia"; |
| 24 | + return 'nostalgia'; |
25 | 25 | } |
26 | 26 | |
27 | 27 | function doBeforeContent() { |
28 | 28 | $s = "\n<div id='content'>\n<div id='top'>\n"; |
29 | | - $s .= "<div id=\"logo\">".$this->logoText( "right" )."</div>"; |
| 29 | + $s .= '<div id="logo">' . $this->logoText( 'right' ) . '</div>'; |
30 | 30 | |
31 | 31 | $s .= $this->pageTitle(); |
32 | 32 | $s .= $this->pageSubtitle() . "\n"; |
33 | 33 | |
34 | | - $s .= "<div id=\"topbar\">"; |
| 34 | + $s .= '<div id="topbar">'; |
35 | 35 | $s .= $this->topLinks() . "\n<br />"; |
36 | 36 | |
37 | 37 | $notice = wfGetSiteNotice(); |
— | — | @@ -40,10 +40,10 @@ |
41 | 41 | $s .= $this->pageTitleLinks(); |
42 | 42 | |
43 | 43 | $ol = $this->otherLanguages(); |
44 | | - if($ol) $s .= "<br />" . $ol; |
| 44 | + if( $ol ) $s .= '<br />' . $ol; |
45 | 45 | |
46 | 46 | $cat = $this->getCategoryLinks(); |
47 | | - if($cat) $s .= "<br />" . $cat; |
| 47 | + if( $cat ) $s .= '<br />' . $cat; |
48 | 48 | |
49 | 49 | $s .= "<br clear='all' /></div><hr />\n</div>\n"; |
50 | 50 | $s .= "\n<div id='article'>"; |
— | — | @@ -79,7 +79,7 @@ |
80 | 80 | $s .= $sep . $this->specialLink( 'watchlist' ); |
81 | 81 | /* show my contributions link */ |
82 | 82 | $s .= $sep . $this->link( |
83 | | - SpecialPage::getSafeTitleFor( "Contributions", $wgUser->getName() ), |
| 83 | + SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ), |
84 | 84 | wfMsgHtml( 'mycontris' ) ); |
85 | 85 | /* show my preferences link */ |
86 | 86 | $s .= $sep . $this->specialLink( 'preferences' ); |
— | — | @@ -111,6 +111,4 @@ |
112 | 112 | |
113 | 113 | return $s; |
114 | 114 | } |
115 | | -} |
116 | | - |
117 | | - |
| 115 | +} |
\ No newline at end of file |