Index: trunk/phase3/includes/SpecialDoubleRedirects.php |
— | — | @@ -61,7 +61,7 @@ |
62 | 62 | return ''; |
63 | 63 | } |
64 | 64 | |
65 | | - function formatResult( $skin, $result ) { |
| 65 | + function formatResult( $result ) { |
66 | 66 | global $wgContLang; |
67 | 67 | |
68 | 68 | $fname = 'DoubleRedirectsPage::formatResult'; |
— | — | @@ -83,10 +83,10 @@ |
84 | 84 | $titleB = Title::makeTitle( $result->nsb, $result->tb ); |
85 | 85 | $titleC = Title::makeTitle( $result->nsc, $result->tc ); |
86 | 86 | |
87 | | - $linkA = $skin->makeKnownLinkObj( $titleA,'', 'redirect=no' ); |
88 | | - $edit = $skin->makeBrokenLinkObj( $titleA, "(".wfMsg("qbedit").")" , 'redirect=no'); |
89 | | - $linkB = $skin->makeKnownLinkObj( $titleB, '', 'redirect=no' ); |
90 | | - $linkC = $skin->makeKnownLinkObj( $titleC ); |
| 87 | + $linkA = Linker::makeKnownLinkObj( $titleA,'', 'redirect=no' ); |
| 88 | + $edit = Linker::makeBrokenLinkObj( $titleA, "(".wfMsg("qbedit").")" , 'redirect=no'); |
| 89 | + $linkB = Linker::makeKnownLinkObj( $titleB, '', 'redirect=no' ); |
| 90 | + $linkC = Linker::makeKnownLinkObj( $titleC ); |
91 | 91 | $arr = $wgContLang->getArrow() . $wgContLang->getDirMark(); |
92 | 92 | |
93 | 93 | return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" ); |
Index: trunk/phase3/includes/SpecialNewimages.php |
— | — | @@ -9,11 +9,10 @@ |
10 | 10 | * |
11 | 11 | */ |
12 | 12 | function wfSpecialNewimages( $par, $specialPage ) { |
13 | | - global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgGroupPermissions; |
| 13 | + global $wgOut, $wgLang, $wgContLang, $wgRequest, $wgGroupPermissions; |
14 | 14 | |
15 | 15 | $wpIlMatch = $wgRequest->getText( 'wpIlMatch' ); |
16 | 16 | $dbr =& wfGetDB( DB_SLAVE ); |
17 | | - $sk = $wgUser->getSkin(); |
18 | 17 | $shownav = !$specialPage->including(); |
19 | 18 | $hidebots = $wgRequest->getBool('hidebots',1); |
20 | 19 | |
— | — | @@ -135,7 +134,7 @@ |
136 | 135 | |
137 | 136 | $nt = Title::newFromText( $name, NS_IMAGE ); |
138 | 137 | $img = new Image( $nt ); |
139 | | - $ul = $sk->makeLinkObj( Title::makeTitle( NS_USER, $ut ), $ut ); |
| 138 | + $ul = Linker::makeLinkObj( Title::makeTitle( NS_USER, $ut ), $ut ); |
140 | 139 | |
141 | 140 | $gallery->add( $img, "$ul<br />\n<i>".$wgLang->timeanddate( $s->img_timestamp, true )."</i><br />\n" ); |
142 | 141 | |
— | — | @@ -177,18 +176,18 @@ |
178 | 177 | } |
179 | 178 | $now = wfTimestampNow(); |
180 | 179 | $date = $wgLang->timeanddate( $now, true ); |
181 | | - $dateLink = $sk->makeKnownLinkObj( $titleObj, wfMsg( 'sp-newimages-showfrom', $date ), 'from='.$now.$botpar.$searchpar ); |
| 180 | + $dateLink = Linker::makeKnownLinkObj( $titleObj, wfMsg( 'sp-newimages-showfrom', $date ), 'from='.$now.$botpar.$searchpar ); |
182 | 181 | |
183 | | - $botLink = $sk->makeKnownLinkObj($titleObj, wfMsg( 'showhidebots', ($hidebots ? wfMsg('show') : wfMsg('hide'))),'hidebots='.($hidebots ? '0' : '1').$searchpar); |
| 182 | + $botLink = Linker::makeKnownLinkObj($titleObj, wfMsg( 'showhidebots', ($hidebots ? wfMsg('show') : wfMsg('hide'))),'hidebots='.($hidebots ? '0' : '1').$searchpar); |
184 | 183 | |
185 | 184 | $prevLink = wfMsg( 'prevn', $wgLang->formatNum( $limit ) ); |
186 | 185 | if( $firstTimestamp && $firstTimestamp != $latestTimestamp ) { |
187 | | - $prevLink = $sk->makeKnownLinkObj( $titleObj, $prevLink, 'from=' . $firstTimestamp . $botpar . $searchpar ); |
| 186 | + $prevLink = Linker::makeKnownLinkObj( $titleObj, $prevLink, 'from=' . $firstTimestamp . $botpar . $searchpar ); |
188 | 187 | } |
189 | 188 | |
190 | 189 | $nextLink = wfMsg( 'nextn', $wgLang->formatNum( $limit ) ); |
191 | 190 | if( $shownImages > $limit && $lastTimestamp ) { |
192 | | - $nextLink = $sk->makeKnownLinkObj( $titleObj, $nextLink, 'until=' . $lastTimestamp.$botpar.$searchpar ); |
| 191 | + $nextLink = Linker::makeKnownLinkObj( $titleObj, $nextLink, 'until=' . $lastTimestamp.$botpar.$searchpar ); |
193 | 192 | } |
194 | 193 | |
195 | 194 | $prevnext = '<p>' . $botLink . ' '. wfMsg( 'viewprevnext', $prevLink, $nextLink, $dateLink ) .'</p>'; |
Index: trunk/phase3/includes/SpecialListredirects.php |
— | — | @@ -27,13 +27,13 @@ |
28 | 28 | return( $sql ); |
29 | 29 | } |
30 | 30 | |
31 | | - function formatResult( $skin, $result ) { |
| 31 | + function formatResult( $result ) { |
32 | 32 | global $wgContLang; |
33 | 33 | |
34 | 34 | # Make a link to the redirect itself |
35 | 35 | $rd_title = Title::makeTitle( $result->namespace, $result->title ); |
36 | 36 | $arr = $wgContLang->getArrow() . $wgContLang->getDirMark(); |
37 | | - $rd_link = $skin->makeKnownLinkObj( $rd_title, '', 'redirect=no' ); |
| 37 | + $rd_link = Linker::makeKnownLinkObj( $rd_title, '', 'redirect=no' ); |
38 | 38 | |
39 | 39 | # Find out where the redirect leads |
40 | 40 | $revision = Revision::newFromTitle( $rd_title ); |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | # Make a link to the destination page |
43 | 43 | $target = Title::newFromRedirect( $revision->getText() ); |
44 | 44 | if( $target ) { |
45 | | - $targetLink = $skin->makeLinkObj( $target ); |
| 45 | + $targetLink = Linker::makeLinkObj( $target ); |
46 | 46 | } else { |
47 | 47 | /** @todo Put in some decent error display here */ |
48 | 48 | $targetLink = '*'; |
Index: trunk/phase3/includes/SpecialAllpages.php |
— | — | @@ -83,8 +83,7 @@ |
84 | 84 | * @param integer $namespace (default NS_MAIN) |
85 | 85 | */ |
86 | 86 | function showToplevel ( $namespace = NS_MAIN, $including = false ) { |
87 | | - global $wgOut, $wgUser; |
88 | | - $sk = $wgUser->getSkin(); |
| 87 | + global $wgOut; |
89 | 88 | $fname = "indexShowToplevel"; |
90 | 89 | |
91 | 90 | # TODO: Either make this *much* faster or cache the title index points |
— | — | @@ -185,8 +184,6 @@ |
186 | 185 | * @param integer $namespace (Default NS_MAIN) |
187 | 186 | */ |
188 | 187 | function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) { |
189 | | - global $wgUser; |
190 | | - $sk = $wgUser->getSkin(); |
191 | 188 | $dbr =& wfGetDB( DB_SLAVE ); |
192 | 189 | |
193 | 190 | $inpointf = htmlspecialchars( str_replace( '_', ' ', $inpoint ) ); |
— | — | @@ -208,12 +205,10 @@ |
209 | 206 | * @param string $from list all pages from this name (default FALSE) |
210 | 207 | */ |
211 | 208 | function showChunk( $namespace = NS_MAIN, $from, $including = false ) { |
212 | | - global $wgOut, $wgUser, $wgContLang; |
| 209 | + global $wgOut, $wgContLang; |
213 | 210 | |
214 | 211 | $fname = 'indexShowChunk'; |
215 | 212 | |
216 | | - $sk = $wgUser->getSkin(); |
217 | | - |
218 | 213 | $fromList = $this->getNamespaceKeyAndText($namespace, $from); |
219 | 214 | |
220 | 215 | if ( !$fromList ) { |
— | — | @@ -246,7 +241,7 @@ |
247 | 242 | $t = Title::makeTitle( $s->page_namespace, $s->page_title ); |
248 | 243 | if( $t ) { |
249 | 244 | $link = ($s->page_is_redirect ? '<div class="allpagesredirect">' : '' ) . |
250 | | - $sk->makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) . |
| 245 | + Linker::makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) . |
251 | 246 | ($s->page_is_redirect ? '</div>' : '' ); |
252 | 247 | } else { |
253 | 248 | $link = '[[' . htmlspecialchars( $s->page_title ) . ']]'; |
— | — | @@ -273,12 +268,12 @@ |
274 | 269 | $out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">'; |
275 | 270 | $out2 .= '<tr valign="top"><td align="left">' . $nsForm; |
276 | 271 | $out2 .= '</td><td align="right" style="font-size: smaller; margin-bottom: 1em;">' . |
277 | | - $sk->makeKnownLink( $wgContLang->specialPage( "Allpages" ), |
| 272 | + Linker::makeKnownLink( $wgContLang->specialPage( "Allpages" ), |
278 | 273 | wfMsgHtml ( 'allpages' ) ); |
279 | 274 | if ( isset($dbr) && $dbr && ($n == $this->maxPerPage) && ($s = $dbr->fetchObject( $res )) ) { |
280 | 275 | $self = SpecialPage::getTitleFor( 'Allpages' ); |
281 | 276 | $q = 'from=' . $t->getPartialUrl() . ( $namespace ? '&namespace=' . $namespace : '' ); |
282 | | - $out2 .= ' | ' . $sk->makeKnownLinkObj( $self, wfMsgHtml( 'nextpage', $t->getText() ), $q ); |
| 277 | + $out2 .= ' | ' . Linker::makeKnownLinkObj( $self, wfMsgHtml( 'nextpage', $t->getText() ), $q ); |
283 | 278 | } |
284 | 279 | $out2 .= "</td></tr></table><hr />"; |
285 | 280 | } |
Index: trunk/phase3/includes/SpecialImport.php |
— | — | @@ -176,16 +176,14 @@ |
177 | 177 | } |
178 | 178 | |
179 | 179 | function reportPage( $title, $origTitle, $revisionCount, $successCount ) { |
180 | | - global $wgOut, $wgUser, $wgLang, $wgContLang; |
181 | | - |
182 | | - $skin = $wgUser->getSkin(); |
183 | | - |
| 180 | + global $wgOut, $wgLang, $wgContLang; |
| 181 | + |
184 | 182 | $this->mPageCount++; |
185 | 183 | |
186 | 184 | $localCount = $wgLang->formatNum( $successCount ); |
187 | 185 | $contentCount = $wgContLang->formatNum( $successCount ); |
188 | 186 | |
189 | | - $wgOut->addHtml( "<li>" . $skin->makeKnownLinkObj( $title ) . |
| 187 | + $wgOut->addHtml( "<li>" . Linker::makeKnownLinkObj( $title ) . |
190 | 188 | " " . |
191 | 189 | wfMsgExt( 'import-revision-count', array( 'parsemag', 'escape' ), $localCount ) . |
192 | 190 | "</li>\n" ); |
Index: trunk/phase3/includes/SpecialImagelist.php |
— | — | @@ -112,7 +112,7 @@ |
113 | 113 | $name = $this->mCurrentRow->img_name; |
114 | 114 | $ilink = "<a href=\"" . htmlspecialchars( Image::imageUrl( $name ) ) . |
115 | 115 | "\">" . $this->mMessages['imgfile'] . "</a>"; |
116 | | - $desc = $this->getSkin()->makeKnownLinkObj( Title::makeTitle( NS_IMAGE, $name ), |
| 116 | + $desc = Linker::makeKnownLinkObj( Title::makeTitle( NS_IMAGE, $name ), |
117 | 117 | $this->mMessages['imgdesc'] ); |
118 | 118 | return "$desc | $ilink"; |
119 | 119 | case 'img_timestamp': |
— | — | @@ -121,7 +121,7 @@ |
122 | 122 | return htmlspecialchars( $value ); |
123 | 123 | case 'img_user_text': |
124 | 124 | if ( $this->mCurrentRow->img_user ) { |
125 | | - $link = $this->getSkin()->makeLinkObj( Title::makeTitle( NS_USER, $value ), |
| 125 | + $link = Linker::makeLinkObj( Title::makeTitle( NS_USER, $value ), |
126 | 126 | htmlspecialchars( $value ) ); |
127 | 127 | } else { |
128 | 128 | $link = htmlspecialchars( $value ); |
— | — | @@ -130,7 +130,7 @@ |
131 | 131 | case 'img_size': |
132 | 132 | return $wgLang->formatNum( $value ); |
133 | 133 | case 'img_description': |
134 | | - return $this->getSkin()->commentBlock( $value ); |
| 134 | + return Linker::commentBlock( $value ); |
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
Index: trunk/phase3/includes/DifferenceEngine.php |
— | — | @@ -143,13 +143,12 @@ |
144 | 144 | exit; |
145 | 145 | } |
146 | 146 | |
147 | | - $sk = $wgUser->getSkin(); |
148 | 147 | $talk = $wgContLang->getNsText( NS_TALK ); |
149 | 148 | $contribs = wfMsg( 'contribslink' ); |
150 | 149 | |
151 | 150 | if ( $this->mNewRev->isCurrent() && $wgUser->isAllowed('rollback') ) { |
152 | 151 | $username = $this->mNewRev->getUserText(); |
153 | | - $rollback = ' <strong>[' . $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'rollbacklink' ), |
| 152 | + $rollback = ' <strong>[' . Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'rollbacklink' ), |
154 | 153 | 'action=rollback&from=' . urlencode( $username ) . |
155 | 154 | '&token=' . urlencode( $wgUser->editToken( array( $this->mTitle->getPrefixedText(), $username ) ) ) ) . |
156 | 155 | ']</strong>'; |
— | — | @@ -157,17 +156,17 @@ |
158 | 157 | $rollback = ''; |
159 | 158 | } |
160 | 159 | if( $wgUseRCPatrol && $this->mRcidMarkPatrolled != 0 && $wgUser->isAllowed( 'patrol' ) ) { |
161 | | - $patrol = ' [' . $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'markaspatrolleddiff' ), "action=markpatrolled&rcid={$this->mRcidMarkPatrolled}" ) . ']'; |
| 160 | + $patrol = ' [' . Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'markaspatrolleddiff' ), "action=markpatrolled&rcid={$this->mRcidMarkPatrolled}" ) . ']'; |
162 | 161 | } else { |
163 | 162 | $patrol = ''; |
164 | 163 | } |
165 | 164 | |
166 | | - $prevlink = $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'previousdiff' ), |
| 165 | + $prevlink = Linker::makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'previousdiff' ), |
167 | 166 | 'diff=prev&oldid='.$this->mOldid, '', '', 'id="differences-prevlink"' ); |
168 | 167 | if ( $this->mNewRev->isCurrent() ) { |
169 | 168 | $nextlink = ' '; |
170 | 169 | } else { |
171 | | - $nextlink = $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'nextdiff' ), |
| 170 | + $nextlink = Linker::makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'nextdiff' ), |
172 | 171 | 'diff=next&oldid='.$this->mNewid, '', '', 'id="differences-nextlink"' ); |
173 | 172 | } |
174 | 173 | |
— | — | @@ -185,12 +184,12 @@ |
186 | 185 | } |
187 | 186 | |
188 | 187 | $oldHeader = "<strong>{$this->mOldtitle}</strong><br />" . |
189 | | - $sk->revUserTools( $this->mOldRev ) . "<br />" . |
190 | | - $oldminor . $sk->revComment( $this->mOldRev ) . "<br />" . |
| 188 | + Linker::revUserTools( $this->mOldRev ) . "<br />" . |
| 189 | + $oldminor . Linker::revComment( $this->mOldRev ) . "<br />" . |
191 | 190 | $prevlink; |
192 | 191 | $newHeader = "<strong>{$this->mNewtitle}</strong><br />" . |
193 | | - $sk->revUserTools( $this->mNewRev ) . " $rollback<br />" . |
194 | | - $newminor . $sk->revComment( $this->mNewRev ) . "<br />" . |
| 192 | + Linker::revUserTools( $this->mNewRev ) . " $rollback<br />" . |
| 193 | + $newminor . Linker::revComment( $this->mNewRev ) . "<br />" . |
195 | 194 | $nextlink . $patrol; |
196 | 195 | |
197 | 196 | $this->showDiff( $oldHeader, $newHeader ); |
— | — | @@ -218,7 +217,7 @@ |
219 | 218 | * contrast to normal "old revision" display style. |
220 | 219 | */ |
221 | 220 | function showFirstRevision() { |
222 | | - global $wgOut, $wgUser; |
| 221 | + global $wgOut; |
223 | 222 | |
224 | 223 | $fname = 'DifferenceEngine::showFirstRevision'; |
225 | 224 | wfProfileIn( $fname ); |
— | — | @@ -249,12 +248,10 @@ |
250 | 249 | |
251 | 250 | # Prepare the header box |
252 | 251 | # |
253 | | - $sk = $wgUser->getSkin(); |
254 | | - |
255 | | - $nextlink = $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'nextdiff' ), 'diff=next&oldid='.$this->mNewid, '', '', 'id="differences-nextlink"' ); |
| 252 | + $nextlink = Linker::makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'nextdiff' ), 'diff=next&oldid='.$this->mNewid, '', '', 'id="differences-nextlink"' ); |
256 | 253 | $header = "<div class=\"firstrevisionheader\" style=\"text-align: center\"><strong>{$this->mOldtitle}</strong><br />" . |
257 | | - $sk->revUserTools( $this->mNewRev ) . "<br />" . |
258 | | - $sk->revComment( $this->mNewRev ) . "<br />" . |
| 254 | + Linker::revUserTools( $this->mNewRev ) . "<br />" . |
| 255 | + Linker::revComment( $this->mNewRev ) . "<br />" . |
259 | 256 | $nextlink . "</div>\n"; |
260 | 257 | |
261 | 258 | $wgOut->addHTML( $header ); |
Index: trunk/phase3/includes/SpecialIpblocklist.php |
— | — | @@ -234,10 +234,8 @@ |
235 | 235 | |
236 | 236 | wfProfileIn( __METHOD__ ); |
237 | 237 | |
238 | | - static $sk=null, $msg=null; |
| 238 | + static $msg=null; |
239 | 239 | |
240 | | - if( is_null( $sk ) ) |
241 | | - $sk = $wgUser->getSkin(); |
242 | 240 | if( is_null( $msg ) ) { |
243 | 241 | $msg = array(); |
244 | 242 | $keys = array( 'infiniteblock', 'expiringblock', 'contribslink', 'unblocklink', |
— | — | @@ -251,15 +249,15 @@ |
252 | 250 | |
253 | 251 | # Prepare links to the blocker's user and talk pages |
254 | 252 | $blocker_name = $block->getByName(); |
255 | | - $blocker = $sk->MakeLinkObj( Title::makeTitle( NS_USER, $blocker_name ), $blocker_name ); |
256 | | - $blocker .= ' (' . $sk->makeLinkObj( Title::makeTitle( NS_USER_TALK, $blocker_name ), $wgLang->getNsText( NS_TALK ) ) . ')'; |
| 253 | + $blocker = Linker::makeLinkObj( Title::makeTitle( NS_USER, $blocker_name ), $blocker_name ); |
| 254 | + $blocker .= ' (' . Linker::makeLinkObj( Title::makeTitle( NS_USER_TALK, $blocker_name ), $wgLang->getNsText( NS_TALK ) ) . ')'; |
257 | 255 | |
258 | 256 | # Prepare links to the block target's user and contribs. pages (as applicable, don't do it for autoblocks) |
259 | 257 | if( $block->mAuto ) { |
260 | 258 | $target = $block->getRedactedName(); # Hide the IP addresses of auto-blocks; privacy |
261 | 259 | } else { |
262 | | - $target = $sk->makeLinkObj( Title::makeTitle( NS_USER, $block->mAddress ), $block->mAddress ); |
263 | | - $target .= ' (' . $sk->makeKnownLinkObj( SpecialPage::getSafeTitleFor( 'Contributions', $block->mAddress ), $msg['contribslink'] ) . ')'; |
| 260 | + $target = Linker::makeLinkObj( Title::makeTitle( NS_USER, $block->mAddress ), $block->mAddress ); |
| 261 | + $target .= ' (' . Linker::makeKnownLinkObj( SpecialPage::getSafeTitleFor( 'Contributions', $block->mAddress ), $msg['contribslink'] ) . ')'; |
264 | 262 | } |
265 | 263 | |
266 | 264 | $formattedTime = $wgLang->timeanddate( $block->mTimestamp, true ); |
— | — | @@ -289,9 +287,9 @@ |
290 | 288 | |
291 | 289 | if ( $wgUser->isAllowed('block') ) { |
292 | 290 | $titleObj = SpecialPage::getTitleFor( "Ipblocklist" ); |
293 | | - $s .= ' (' . $sk->makeKnownLinkObj($titleObj, $msg['unblocklink'], 'action=unblock&id=' . urlencode( $block->mId ) ) . ')'; |
| 291 | + $s .= ' (' . Linker::makeKnownLinkObj($titleObj, $msg['unblocklink'], 'action=unblock&id=' . urlencode( $block->mId ) ) . ')'; |
294 | 292 | } |
295 | | - $s .= $sk->commentBlock( $block->mReason ); |
| 293 | + $s .= Linker::commentBlock( $block->mReason ); |
296 | 294 | $s .= "</li>\n"; |
297 | 295 | wfProfileOut( __METHOD__ ); |
298 | 296 | return $s; |
Index: trunk/phase3/includes/SpecialLog.php |
— | — | @@ -218,8 +218,6 @@ |
219 | 219 | * @param LogReader &$reader where to get our data from |
220 | 220 | */ |
221 | 221 | function LogViewer( &$reader ) { |
222 | | - global $wgUser; |
223 | | - $this->skin =& $wgUser->getSkin(); |
224 | 222 | $this->reader =& $reader; |
225 | 223 | } |
226 | 224 | |
— | — | @@ -316,15 +314,15 @@ |
317 | 315 | $linkCache->addBadLinkObj( $title ); |
318 | 316 | } |
319 | 317 | |
320 | | - $userLink = $this->skin->userLink( $s->log_user, $s->user_name ) . $this->skin->userToolLinks( $s->log_user, $s->user_name ); |
321 | | - $comment = $this->skin->commentBlock( $s->log_comment ); |
| 318 | + $userLink = Linker::userLink( $s->log_user, $s->user_name ) . Linker::userToolLinks( $s->log_user, $s->user_name ); |
| 319 | + $comment = Linker::commentBlock( $s->log_comment ); |
322 | 320 | $paramArray = LogPage::extractParams( $s->log_params ); |
323 | 321 | $revert = ''; |
324 | 322 | if ( $s->log_type == 'move' && isset( $paramArray[0] ) ) { |
325 | 323 | $specialTitle = SpecialPage::getTitleFor( 'Movepage' ); |
326 | 324 | $destTitle = Title::newFromText( $paramArray[0] ); |
327 | 325 | if ( $destTitle ) { |
328 | | - $revert = '(' . $this->skin->makeKnownLinkObj( $specialTitle, wfMsg( 'revertmove' ), |
| 326 | + $revert = '(' . Linker::makeKnownLinkObj( $specialTitle, wfMsg( 'revertmove' ), |
329 | 327 | 'wpOldTitle=' . urlencode( $destTitle->getPrefixedDBkey() ) . |
330 | 328 | '&wpNewTitle=' . urlencode( $title->getPrefixedDBkey() ) . |
331 | 329 | '&wpReason=' . urlencode( wfMsgForContent( 'revertmove' ) ) . |
— | — | @@ -332,7 +330,7 @@ |
333 | 331 | } |
334 | 332 | } |
335 | 333 | |
336 | | - $action = LogPage::actionText( $s->log_type, $s->log_action, $title, $this->skin, $paramArray, true, true ); |
| 334 | + $action = LogPage::actionText( $s->log_type, $s->log_action, $title, false, $paramArray, true, true ); |
337 | 335 | $out = "<li>$time $userLink $action $comment $revert</li>\n"; |
338 | 336 | return $out; |
339 | 337 | } |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -613,7 +613,6 @@ |
614 | 614 | global $wgUser, $wgOut, $wgRequest, $wgContLang; |
615 | 615 | global $wgEnableParserCache, $wgStylePath, $wgUseRCPatrol, $wgParser; |
616 | 616 | global $wgUseTrackbacks, $wgNamespaceRobotPolicies; |
617 | | - $sk = $wgUser->getSkin(); |
618 | 617 | |
619 | 618 | wfProfileIn( __METHOD__ ); |
620 | 619 | |
— | — | @@ -693,8 +692,7 @@ |
694 | 693 | // This is an internally redirected page view. |
695 | 694 | // We'll need a backlink to the source page for navigation. |
696 | 695 | if ( wfRunHooks( 'ArticleViewRedirect', array( &$this ) ) ) { |
697 | | - $sk = $wgUser->getSkin(); |
698 | | - $redir = $sk->makeKnownLinkObj( $this->mRedirectedFrom, '', 'redirect=no' ); |
| 696 | + $redir = Linker::makeKnownLinkObj( $this->mRedirectedFrom, '', 'redirect=no' ); |
699 | 697 | $s = wfMsg( 'redirectedfrom', $redir ); |
700 | 698 | $wgOut->setSubtitle( $s ); |
701 | 699 | $wasRedirected = true; |
— | — | @@ -704,8 +702,7 @@ |
705 | 703 | // If it was reported from a trusted site, supply a backlink. |
706 | 704 | global $wgRedirectSources; |
707 | 705 | if( $wgRedirectSources && preg_match( $wgRedirectSources, $rdfrom ) ) { |
708 | | - $sk = $wgUser->getSkin(); |
709 | | - $redir = $sk->makeExternalLink( $rdfrom, $rdfrom ); |
| 706 | + $redir = Linker::makeExternalLink( $rdfrom, $rdfrom ); |
710 | 707 | $s = wfMsg( 'redirectedfrom', $redir ); |
711 | 708 | $wgOut->setSubtitle( $s ); |
712 | 709 | $wasRedirected = true; |
— | — | @@ -787,7 +784,7 @@ |
788 | 785 | $targetUrl = $rt->escapeLocalURL(); |
789 | 786 | # fixme unused $titleText : |
790 | 787 | $titleText = htmlspecialchars( $rt->getPrefixedText() ); |
791 | | - $link = $sk->makeLinkObj( $rt ); |
| 788 | + $link = Linker::makeLinkObj( $rt ); |
792 | 789 | |
793 | 790 | $wgOut->addHTML( '<img src="'.$imageUrl.'" alt="#REDIRECT" />' . |
794 | 791 | '<span class="redirectText">'.$link.'</span>' ); |
— | — | @@ -829,7 +826,7 @@ |
830 | 827 | $wgOut->addHTML( |
831 | 828 | "<div class='patrollink'>" . |
832 | 829 | wfMsg ( 'markaspatrolledlink', |
833 | | - $sk->makeKnownLinkObj( $this->mTitle, wfMsg('markaspatrolledtext'), "action=markpatrolled&rcid=$rcid" ) |
| 830 | + Linker::makeKnownLinkObj( $this->mTitle, wfMsg('markaspatrolledtext'), "action=markpatrolled&rcid=$rcid" ) |
834 | 831 | ) . |
835 | 832 | '</div>' |
836 | 833 | ); |
— | — | @@ -2256,7 +2253,7 @@ |
2257 | 2254 | * @param string $oldid Revision ID of this article revision |
2258 | 2255 | */ |
2259 | 2256 | function setOldSubtitle( $oldid=0 ) { |
2260 | | - global $wgLang, $wgOut, $wgUser; |
| 2257 | + global $wgLang, $wgOut; |
2261 | 2258 | |
2262 | 2259 | if ( !wfRunHooks( 'DisplayOldSubtitle', array(&$this, &$oldid) ) ) { |
2263 | 2260 | return; |
— | — | @@ -2266,26 +2263,25 @@ |
2267 | 2264 | |
2268 | 2265 | $current = ( $oldid == $this->mLatest ); |
2269 | 2266 | $td = $wgLang->timeanddate( $this->mTimestamp, true ); |
2270 | | - $sk = $wgUser->getSkin(); |
2271 | 2267 | $lnk = $current |
2272 | 2268 | ? wfMsg( 'currentrevisionlink' ) |
2273 | | - : $lnk = $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'currentrevisionlink' ) ); |
| 2269 | + : $lnk = Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'currentrevisionlink' ) ); |
2274 | 2270 | $prev = $this->mTitle->getPreviousRevisionID( $oldid ) ; |
2275 | 2271 | $prevlink = $prev |
2276 | | - ? $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'previousrevision' ), 'direction=prev&oldid='.$oldid ) |
| 2272 | + ? Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'previousrevision' ), 'direction=prev&oldid='.$oldid ) |
2277 | 2273 | : wfMsg( 'previousrevision' ); |
2278 | 2274 | $prevdiff = $prev |
2279 | | - ? $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'diff' ), 'diff=prev&oldid='.$oldid ) |
| 2275 | + ? Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'diff' ), 'diff=prev&oldid='.$oldid ) |
2280 | 2276 | : wfMsg( 'diff' ); |
2281 | 2277 | $nextlink = $current |
2282 | 2278 | ? wfMsg( 'nextrevision' ) |
2283 | | - : $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'nextrevision' ), 'direction=next&oldid='.$oldid ); |
| 2279 | + : Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'nextrevision' ), 'direction=next&oldid='.$oldid ); |
2284 | 2280 | $nextdiff = $current |
2285 | 2281 | ? wfMsg( 'diff' ) |
2286 | | - : $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'diff' ), 'diff=next&oldid='.$oldid ); |
| 2282 | + : Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'diff' ), 'diff=next&oldid='.$oldid ); |
2287 | 2283 | |
2288 | | - $userlinks = $sk->userLink( $revision->getUser(), $revision->getUserText() ) |
2289 | | - . $sk->userToolLinks( $revision->getUser(), $revision->getUserText() ); |
| 2284 | + $userlinks = Linker::userLink( $revision->getUser(), $revision->getUserText() ) |
| 2285 | + . Linker::userToolLinks( $revision->getUser(), $revision->getUserText() ); |
2290 | 2286 | |
2291 | 2287 | $r = wfMsg( 'old-revision-navigation', $td, $lnk, $prevlink, $nextlink, $userlinks, $prevdiff, $nextdiff ); |
2292 | 2288 | $wgOut->setSubtitle( $r ); |
Index: trunk/phase3/includes/SpecialBrokenRedirects.php |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | return ''; |
47 | 47 | } |
48 | 48 | |
49 | | - function formatResult( $skin, $result ) { |
| 49 | + function formatResult( $result ) { |
50 | 50 | global $wgContLang; |
51 | 51 | |
52 | 52 | $fromObj = Title::makeTitle( $result->namespace, $result->title ); |
— | — | @@ -62,12 +62,12 @@ |
63 | 63 | |
64 | 64 | // $toObj may very easily be false if the $result list is cached |
65 | 65 | if ( !is_object( $toObj ) ) { |
66 | | - return '<s>' . $skin->makeLinkObj( $fromObj ) . '</s>'; |
| 66 | + return '<s>' . Linker::makeLinkObj( $fromObj ) . '</s>'; |
67 | 67 | } |
68 | 68 | |
69 | | - $from = $skin->makeKnownLinkObj( $fromObj ,'', 'redirect=no' ); |
70 | | - $edit = $skin->makeBrokenLinkObj( $fromObj , "(".wfMsg("qbedit").")" , 'redirect=no'); |
71 | | - $to = $skin->makeBrokenLinkObj( $toObj ); |
| 69 | + $from = Linker::makeKnownLinkObj( $fromObj ,'', 'redirect=no' ); |
| 70 | + $edit = Linker::makeBrokenLinkObj( $fromObj , "(".wfMsg("qbedit").")" , 'redirect=no'); |
| 71 | + $to = Linker::makeBrokenLinkObj( $toObj ); |
72 | 72 | $arr = $wgContLang->getArrow(); |
73 | 73 | |
74 | 74 | return "$from $edit $arr $to"; |
Index: trunk/phase3/includes/SpecialMostcategories.php |
— | — | @@ -36,18 +36,18 @@ |
37 | 37 | "; |
38 | 38 | } |
39 | 39 | |
40 | | - function formatResult( $skin, $result ) { |
| 40 | + function formatResult( $result ) { |
41 | 41 | global $wgContLang, $wgLang; |
42 | 42 | |
43 | 43 | $nt = Title::makeTitle( $result->namespace, $result->title ); |
44 | 44 | $text = $wgContLang->convert( $nt->getPrefixedText() ); |
45 | 45 | |
46 | | - $plink = $skin->makeKnownLink( $nt->getPrefixedText(), $text ); |
| 46 | + $plink = Linker::makeKnownLink( $nt->getPrefixedText(), $text ); |
47 | 47 | |
48 | 48 | $nl = wfMsgExt( 'ncategories', array( 'parsemag', 'escape' ), |
49 | 49 | $wgLang->formatNum( $result->value ) ); |
50 | 50 | |
51 | | - $nlink = $skin->makeKnownLink( $wgContLang->specialPage( 'Categories' ), |
| 51 | + $nlink = Linker::makeKnownLink( $wgContLang->specialPage( 'Categories' ), |
52 | 52 | $nl, 'article=' . $nt->getPrefixedURL() ); |
53 | 53 | |
54 | 54 | return wfSpecialList($plink, $nlink); |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -295,12 +295,12 @@ |
296 | 296 | $usertalktitle = $usertitle->getTalkPage(); |
297 | 297 | if( !$usertalktitle->equals( $this->mTitle ) ) { |
298 | 298 | $ntl = wfMsg( 'youhavenewmessages', |
299 | | - $this->makeKnownLinkObj( |
| 299 | + self::makeKnownLinkObj( |
300 | 300 | $usertalktitle, |
301 | 301 | wfMsgHtml( 'newmessageslink' ), |
302 | 302 | 'redirect=no' |
303 | 303 | ), |
304 | | - $this->makeKnownLinkObj( |
| 304 | + self::makeKnownLinkObj( |
305 | 305 | $usertalktitle, |
306 | 306 | wfMsgHtml( 'newmessagesdifflink' ), |
307 | 307 | 'diff=cur' |
Index: trunk/phase3/includes/SpecialPreferences.php |
— | — | @@ -506,9 +506,8 @@ |
507 | 507 | $disableEmailPrefs = false; |
508 | 508 | } else { |
509 | 509 | $disableEmailPrefs = true; |
510 | | - $skin = $wgUser->getSkin(); |
511 | 510 | $emailauthenticated = wfMsg('emailnotauthenticated').'<br />' . |
512 | | - $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Confirmemail' ), |
| 511 | + Linker::makeKnownLinkObj( SpecialPage::getTitleFor( 'Confirmemail' ), |
513 | 512 | wfMsg( 'emailconfirmlink' ) ); |
514 | 513 | } |
515 | 514 | } else { |
Index: trunk/phase3/includes/SpecialPopularpages.php |
— | — | @@ -35,10 +35,10 @@ |
36 | 36 | WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0"; |
37 | 37 | } |
38 | 38 | |
39 | | - function formatResult( $skin, $result ) { |
| 39 | + function formatResult( $result ) { |
40 | 40 | global $wgLang, $wgContLang; |
41 | 41 | $title = Title::makeTitle( $result->namespace, $result->title ); |
42 | | - $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) ); |
| 42 | + $link = Linker::makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) ); |
43 | 43 | $nv = wfMsgExt( 'nviews', array( 'parsemag', 'escape'), |
44 | 44 | $wgLang->formatNum( $result->value ) ); |
45 | 45 | return wfSpecialList($link, $nv); |
Index: trunk/phase3/includes/SpecialMostimages.php |
— | — | @@ -34,17 +34,17 @@ |
35 | 35 | "; |
36 | 36 | } |
37 | 37 | |
38 | | - function formatResult( $skin, $result ) { |
| 38 | + function formatResult( $result ) { |
39 | 39 | global $wgLang, $wgContLang; |
40 | 40 | |
41 | 41 | $nt = Title::makeTitle( $result->namespace, $result->title ); |
42 | 42 | $text = $wgContLang->convert( $nt->getPrefixedText() ); |
43 | 43 | |
44 | | - $plink = $skin->makeKnownLink( $nt->getPrefixedText(), $text ); |
| 44 | + $plink = Linker::makeKnownLink( $nt->getPrefixedText(), $text ); |
45 | 45 | |
46 | 46 | $nl = wfMsgExt( 'nlinks', array( 'parsemag', 'escape'), |
47 | 47 | $wgLang->formatNum ( $result->value ) ); |
48 | | - $nlink = $skin->makeKnownLink( $nt->getPrefixedText() . '#filelinks', $nl ); |
| 48 | + $nlink = Linker::makeKnownLink( $nt->getPrefixedText() . '#filelinks', $nl ); |
49 | 49 | |
50 | 50 | return wfSpecialList($plink, $nlink); |
51 | 51 | } |
Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -181,7 +181,6 @@ |
182 | 182 | $max = $wgImageLimits[$sizeSel]; |
183 | 183 | $maxWidth = $max[0]; |
184 | 184 | $maxHeight = $max[1]; |
185 | | - $sk = $wgUser->getSkin(); |
186 | 185 | |
187 | 186 | if ( $this->img->exists() ) { |
188 | 187 | # image |
— | — | @@ -254,9 +253,9 @@ |
255 | 254 | |
256 | 255 | if ( $page > 1 ) { |
257 | 256 | $label = $wgOut->parse( wfMsg( 'imgmultipageprev' ), false ); |
258 | | - $link = $sk->makeLinkObj( $this->mTitle, $label, 'page='. ($page-1) ); |
| 257 | + $link = Linker::makeLinkObj( $this->mTitle, $label, 'page='. ($page-1) ); |
259 | 258 | $this->img->selectPage( $page - 1 ); |
260 | | - $thumb1 = $sk->makeThumbLinkObj( $this->img, $link, $label, 'none' ); |
| 259 | + $thumb1 = Linker::makeThumbLinkObj( $this->img, $link, $label, 'none' ); |
261 | 260 | } else { |
262 | 261 | $thumb1 = ''; |
263 | 262 | } |
— | — | @@ -264,8 +263,8 @@ |
265 | 264 | if ( $page < $count ) { |
266 | 265 | $label = wfMsg( 'imgmultipagenext' ); |
267 | 266 | $this->img->selectPage( $page + 1 ); |
268 | | - $link = $sk->makeLinkObj( $this->mTitle, $label, 'page='. ($page+1) ); |
269 | | - $thumb2 = $sk->makeThumbLinkObj( $this->img, $link, $label, 'none' ); |
| 267 | + $link = Linker::makeLinkObj( $this->mTitle, $label, 'page='. ($page+1) ); |
| 268 | + $thumb2 = Linker::makeThumbLinkObj( $this->img, $link, $label, 'none' ); |
270 | 269 | } else { |
271 | 270 | $thumb2 = ''; |
272 | 271 | } |
— | — | @@ -334,22 +333,20 @@ |
335 | 334 | # Image does not exist |
336 | 335 | |
337 | 336 | $title = SpecialPage::getTitleFor( 'Upload' ); |
338 | | - $link = $sk->makeKnownLinkObj($title, wfMsgHtml('noimage-linktext'), |
| 337 | + $link = Linker::makeKnownLinkObj($title, wfMsgHtml('noimage-linktext'), |
339 | 338 | 'wpDestFile=' . urlencode( $this->img->getName() ) ); |
340 | 339 | $wgOut->addHTML( wfMsgWikiHtml( 'noimage', $link ) ); |
341 | 340 | } |
342 | 341 | } |
343 | 342 | |
344 | 343 | function printSharedImageText() { |
345 | | - global $wgRepositoryBaseUrl, $wgFetchCommonsDescriptions, $wgOut, $wgUser; |
| 344 | + global $wgRepositoryBaseUrl, $wgFetchCommonsDescriptions, $wgOut; |
346 | 345 | |
347 | 346 | $url = $wgRepositoryBaseUrl . urlencode($this->mTitle->getDBkey()); |
348 | 347 | $sharedtext = "<div class='sharedUploadNotice'>" . wfMsgWikiHtml("sharedupload"); |
349 | 348 | if ($wgRepositoryBaseUrl && !$wgFetchCommonsDescriptions) { |
350 | | - |
351 | | - $sk = $wgUser->getSkin(); |
352 | 349 | $title = SpecialPage::getTitleFor( 'Upload' ); |
353 | | - $link = $sk->makeKnownLinkObj($title, wfMsgHtml('shareduploadwiki-linktext'), |
| 350 | + $link = Linker::makeKnownLinkObj($title, wfMsgHtml('shareduploadwiki-linktext'), |
354 | 351 | array( 'wpDestFile' => urlencode( $this->img->getName() ))); |
355 | 352 | $sharedtext .= " " . wfMsgWikiHtml('shareduploadwiki', $link); |
356 | 353 | } |
— | — | @@ -379,18 +376,16 @@ |
380 | 377 | if( $this->img->fromSharedDirectory ) |
381 | 378 | return; |
382 | 379 | |
383 | | - $sk = $wgUser->getSkin(); |
384 | | - |
385 | 380 | $wgOut->addHtml( '<br /><ul>' ); |
386 | 381 | |
387 | 382 | # "Upload a new version of this file" link |
388 | 383 | if( $wgUser->isAllowed( 'reupload' ) ) { |
389 | | - $ulink = $sk->makeExternalLink( $this->getUploadUrl(), wfMsg( 'uploadnewversion-linktext' ) ); |
| 384 | + $ulink = Linker::makeExternalLink( $this->getUploadUrl(), wfMsg( 'uploadnewversion-linktext' ) ); |
390 | 385 | $wgOut->addHtml( "<li><div>{$ulink}</div></li>" ); |
391 | 386 | } |
392 | 387 | |
393 | 388 | # External editing link |
394 | | - $elink = $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'edit-externally' ), 'action=edit&externaledit=true&mode=file' ); |
| 389 | + $elink = Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'edit-externally' ), 'action=edit&externaledit=true&mode=file' ); |
395 | 390 | $wgOut->addHtml( '<li>' . $elink . '<div>' . wfMsgWikiHtml( 'edit-externally-help' ) . '</div></li>' ); |
396 | 391 | |
397 | 392 | $wgOut->addHtml( '</ul>' ); |
— | — | @@ -406,16 +401,13 @@ |
407 | 402 | * If the page we've just displayed is in the "Image" namespace, |
408 | 403 | * we follow it with an upload history of the image and its usage. |
409 | 404 | */ |
410 | | - function imageHistory() |
411 | | - { |
412 | | - global $wgUser, $wgOut, $wgUseExternalEditor; |
| 405 | + function imageHistory() { |
| 406 | + global $wgOut, $wgUseExternalEditor; |
413 | 407 | |
414 | | - $sk = $wgUser->getSkin(); |
415 | | - |
416 | 408 | $line = $this->img->nextHistoryLine(); |
417 | 409 | |
418 | 410 | if ( $line ) { |
419 | | - $list = new ImageHistoryList( $sk ); |
| 411 | + $list = new ImageHistoryList(); |
420 | 412 | $s = $list->beginImageHistoryList() . |
421 | 413 | $list->imageHistoryLine( true, wfTimestamp(TS_MW, $line->img_timestamp), |
422 | 414 | $this->mTitle->getDBkey(), $line->img_user, |
— | — | @@ -442,9 +434,8 @@ |
443 | 435 | |
444 | 436 | } |
445 | 437 | |
446 | | - function imageLinks() |
447 | | - { |
448 | | - global $wgUser, $wgOut; |
| 438 | + function imageLinks() { |
| 439 | + global $wgOut; |
449 | 440 | |
450 | 441 | $wgOut->addHTML( '<h2 id="filelinks">' . wfMsg( 'imagelinks' ) . "</h2>\n" ); |
451 | 442 | |
— | — | @@ -463,10 +454,9 @@ |
464 | 455 | } |
465 | 456 | $wgOut->addHTML( '<p>' . wfMsg( 'linkstoimage' ) . "</p>\n<ul>" ); |
466 | 457 | |
467 | | - $sk = $wgUser->getSkin(); |
468 | 458 | while ( $s = $dbr->fetchObject( $res ) ) { |
469 | 459 | $name = Title::MakeTitle( $s->page_namespace, $s->page_title ); |
470 | | - $link = $sk->makeKnownLinkObj( $name, "" ); |
| 460 | + $link = Linker::makeKnownLinkObj( $name, "" ); |
471 | 461 | $wgOut->addHTML( "<li>{$link}</li>\n" ); |
472 | 462 | } |
473 | 463 | $wgOut->addHTML( "</ul>\n" ); |
— | — | @@ -699,8 +689,7 @@ |
700 | 690 | * @package MediaWiki |
701 | 691 | */ |
702 | 692 | class ImageHistoryList { |
703 | | - function ImageHistoryList( &$skin ) { |
704 | | - $this->skin =& $skin; |
| 693 | + function ImageHistoryList() { |
705 | 694 | } |
706 | 695 | |
707 | 696 | function beginImageHistoryList() { |
— | — | @@ -726,11 +715,8 @@ |
727 | 716 | $url = Image::imageUrl( $img ); |
728 | 717 | $rlink = $cur; |
729 | 718 | if ( $wgUser->isAllowed('delete') ) { |
730 | | - $link = $wgTitle->escapeLocalURL( 'image=' . $wgTitle->getPartialURL() . |
731 | | - '&action=delete' ); |
732 | | - $style = $this->skin->getInternalLinkAttributes( $link, $delall ); |
733 | | - |
734 | | - $dlink = '<a href="'.$link.'"'.$style.'>'.$delall.'</a>'; |
| 719 | + $dlink = Linker::makeKnownLinkObj( $wgTitle, $delall, |
| 720 | + 'image=' . $wgTitle->getPartialURL() . '&action=delete'); |
735 | 721 | } else { |
736 | 722 | $dlink = $del; |
737 | 723 | } |
— | — | @@ -738,10 +724,10 @@ |
739 | 725 | $url = htmlspecialchars( wfImageArchiveUrl( $img ) ); |
740 | 726 | if( $wgUser->getID() != 0 && $wgTitle->userCanEdit() ) { |
741 | 727 | $token = urlencode( $wgUser->editToken( $img ) ); |
742 | | - $rlink = $this->skin->makeKnownLinkObj( $wgTitle, |
| 728 | + $rlink = Linker::makeKnownLinkObj( $wgTitle, |
743 | 729 | wfMsg( 'revertimg' ), 'action=revert&oldimage=' . |
744 | 730 | urlencode( $img ) . "&wpEditToken=$token" ); |
745 | | - $dlink = $this->skin->makeKnownLinkObj( $wgTitle, |
| 731 | + $dlink = Linker::makeKnownLinkObj( $wgTitle, |
746 | 732 | $del, 'action=delete&oldimage=' . urlencode( $img ) . |
747 | 733 | "&wpEditToken=$token" ); |
748 | 734 | } else { |
— | — | @@ -753,15 +739,15 @@ |
754 | 740 | } |
755 | 741 | } |
756 | 742 | |
757 | | - $userlink = $this->skin->userLink( $user, $usertext ) . $this->skin->userToolLinks( $user, $usertext ); |
| 743 | + $userlink = Linker::userLink( $user, $usertext ) . Linker::userToolLinks( $user, $usertext ); |
758 | 744 | $nbytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), |
759 | 745 | $wgLang->formatNum( $size ) ); |
760 | 746 | $widthheight = wfMsg( 'widthheight', $width, $height ); |
761 | | - $style = $this->skin->getInternalLinkAttributes( $url, $datetime ); |
| 747 | + $style = Linker::getInternalLinkAttributes( $url, $datetime ); |
762 | 748 | |
763 | 749 | $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$datetime}</a> . . {$userlink} . . {$widthheight} ({$nbytes})"; |
764 | 750 | |
765 | | - $s .= $this->skin->commentBlock( $description, $wgTitle ); |
| 751 | + $s .= Linker::commentBlock( $description, $wgTitle ); |
766 | 752 | $s .= "</li>\n"; |
767 | 753 | return $s; |
768 | 754 | } |
Index: trunk/phase3/includes/SpecialRevisiondelete.php |
— | — | @@ -10,12 +10,11 @@ |
11 | 11 | */ |
12 | 12 | |
13 | 13 | function wfSpecialRevisiondelete( $par = null ) { |
14 | | - global $wgOut, $wgRequest, $wgUser; |
| 14 | + global $wgOut, $wgRequest; |
15 | 15 | |
16 | 16 | $target = $wgRequest->getVal( 'target' ); |
17 | 17 | $oldid = $wgRequest->getIntArray( 'oldid' ); |
18 | 18 | |
19 | | - $sk = $wgUser->getSkin(); |
20 | 19 | $page = Title::newFromUrl( $target ); |
21 | 20 | |
22 | 21 | if( is_null( $page ) ) { |
— | — | @@ -49,7 +48,6 @@ |
50 | 49 | |
51 | 50 | $this->revisions = $request->getIntArray( 'oldid', array() ); |
52 | 51 | |
53 | | - $this->skin = $wgUser->getSkin(); |
54 | 52 | $this->checks = array( |
55 | 53 | array( 'revdelete-hide-text', 'wpHideText', Revision::DELETED_TEXT ), |
56 | 54 | array( 'revdelete-hide-comment', 'wpHideComment', Revision::DELETED_COMMENT ), |
— | — | @@ -122,11 +120,11 @@ |
123 | 121 | $date = $wgContLang->timeanddate( $rev->getTimestamp() ); |
124 | 122 | return |
125 | 123 | "<li>" . |
126 | | - $this->skin->makeLinkObj( $this->page, $date, 'oldid=' . $rev->getId() ) . |
| 124 | + Linker::makeLinkObj( $this->page, $date, 'oldid=' . $rev->getId() ) . |
127 | 125 | " " . |
128 | | - $this->skin->revUserLink( $rev ) . |
| 126 | + Linker::revUserLink( $rev ) . |
129 | 127 | " " . |
130 | | - $this->skin->revComment( $rev ) . |
| 128 | + Linker::revComment( $rev ) . |
131 | 129 | "</li>"; |
132 | 130 | } |
133 | 131 | |
Index: trunk/phase3/includes/SpecialPrefixindex.php |
— | — | @@ -56,12 +56,10 @@ |
57 | 57 | * @param string $from list all pages from this name (default FALSE) |
58 | 58 | */ |
59 | 59 | function showChunk( $namespace = NS_MAIN, $prefix, $including = false, $from = null ) { |
60 | | - global $wgOut, $wgUser, $wgContLang; |
| 60 | + global $wgOut, $wgContLang; |
61 | 61 | |
62 | 62 | $fname = 'indexShowChunk'; |
63 | 63 | |
64 | | - $sk = $wgUser->getSkin(); |
65 | | - |
66 | 64 | if (!isset($from)) $from = $prefix; |
67 | 65 | |
68 | 66 | $fromList = $this->getNamespaceKeyAndText($namespace, $from); |
— | — | @@ -102,7 +100,7 @@ |
103 | 101 | $t = Title::makeTitle( $s->page_namespace, $s->page_title ); |
104 | 102 | if( $t ) { |
105 | 103 | $link = ($s->page_is_redirect ? '<div class="allpagesredirect">' : '' ) . |
106 | | - $sk->makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) . |
| 104 | + Linker::makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) . |
107 | 105 | ($s->page_is_redirect ? '</div>' : '' ); |
108 | 106 | } else { |
109 | 107 | $link = '[[' . htmlspecialchars( $s->page_title ) . ']]'; |
— | — | @@ -129,11 +127,11 @@ |
130 | 128 | $out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">'; |
131 | 129 | $out2 .= '<tr valign="top"><td align="left">' . $nsForm; |
132 | 130 | $out2 .= '</td><td align="right" style="font-size: smaller; margin-bottom: 1em;">' . |
133 | | - $sk->makeKnownLink( $wgContLang->specialPage( $this->name ), |
| 131 | + Linker::makeKnownLink( $wgContLang->specialPage( $this->name ), |
134 | 132 | wfMsg ( 'allpages' ) ); |
135 | 133 | if ( isset($dbr) && $dbr && ($n == $this->maxPerPage) && ($s = $dbr->fetchObject( $res )) ) { |
136 | 134 | $namespaceparam = $namespace ? "&namespace=$namespace" : ""; |
137 | | - $out2 .= " | " . $sk->makeKnownLink( |
| 135 | + $out2 .= " | " . Linker::makeKnownLink( |
138 | 136 | $wgContLang->specialPage( $this->name ), |
139 | 137 | wfMsg ( 'nextpage', $s->page_title ), |
140 | 138 | "from=" . wfUrlEncode ( $s->page_title ) . |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | */ |
72 | 72 | static function normalizeKey( $key ) { |
73 | 73 | global $wgDefaultSkin; |
74 | | - $skinNames = Skin::getSkinNames(); |
| 74 | + $skinNames = self::getSkinNames(); |
75 | 75 | |
76 | 76 | if( $key == '' ) { |
77 | 77 | // Don't return the default immediately; |
— | — | @@ -110,9 +110,9 @@ |
111 | 111 | static function &newFromKey( $key ) { |
112 | 112 | global $wgStyleDirectory; |
113 | 113 | |
114 | | - $key = Skin::normalizeKey( $key ); |
| 114 | + $key = self::normalizeKey( $key ); |
115 | 115 | |
116 | | - $skinNames = Skin::getSkinNames(); |
| 116 | + $skinNames = self::getSkinNames(); |
117 | 117 | $skinName = $skinNames[$key]; |
118 | 118 | |
119 | 119 | # Grab the skin class and initialise it. |
— | — | @@ -579,7 +579,7 @@ |
580 | 580 | $t = $embed . implode ( "{$pop} {$sep} {$embed}" , $wgOut->mCategoryLinks ) . $pop; |
581 | 581 | |
582 | 582 | $msg = wfMsgExt( 'pagecategories', array( 'parsemag', 'escape' ), count( $wgOut->mCategoryLinks ) ); |
583 | | - $s = $this->makeLinkObj( Title::newFromText( wfMsgForContent('pagecategorieslink') ), $msg ) |
| 583 | + $s = self::makeLinkObj( Title::newFromText( wfMsgForContent('pagecategorieslink') ), $msg ) |
584 | 584 | . ': ' . $t; |
585 | 585 | |
586 | 586 | # optional 'dmoz-like' category browser. Will be shown under the list |
— | — | @@ -591,7 +591,7 @@ |
592 | 592 | $parenttree = $wgTitle->getParentCategoryTree(); |
593 | 593 | # Skin object passed by reference cause it can not be |
594 | 594 | # accessed under the method subfunction drawCategoryBrowser |
595 | | - $tempout = explode("\n", Skin::drawCategoryBrowser($parenttree, $this) ); |
| 595 | + $tempout = explode("\n", self::drawCategoryBrowser($parenttree, $this) ); |
596 | 596 | # Clean out bogus first entry and sort them |
597 | 597 | unset($tempout[0]); |
598 | 598 | asort($tempout); |
— | — | @@ -602,12 +602,14 @@ |
603 | 603 | return $s; |
604 | 604 | } |
605 | 605 | |
606 | | - /** Render the array as a serie of links. |
607 | | - * @param $tree Array: categories tree returned by Title::getParentCategoryTree |
608 | | - * @param &skin Object: skin passed by reference |
| 606 | + /** |
| 607 | + * Render the array as a series of links. |
| 608 | + * @param $tree Array categories tree returned by Title::getParentCategoryTree |
| 609 | + * @param &skin Object skin passed by reference |
609 | 610 | * @return String separated by >, terminate with "\n" |
| 611 | + * @static |
610 | 612 | */ |
611 | | - function drawCategoryBrowser($tree, &$skin) { |
| 613 | + static function drawCategoryBrowser($tree, &$skin) { |
612 | 614 | $return = ''; |
613 | 615 | foreach ($tree as $element => $parent) { |
614 | 616 | if (empty($parent)) { |
— | — | @@ -615,11 +617,11 @@ |
616 | 618 | $return .= "\n"; |
617 | 619 | } else { |
618 | 620 | # grab the others elements |
619 | | - $return .= Skin::drawCategoryBrowser($parent, $skin) . ' > '; |
| 621 | + $return .= self::drawCategoryBrowser($parent, $skin) . ' > '; |
620 | 622 | } |
621 | 623 | # add our current element to the list |
622 | 624 | $eltitle = Title::NewFromText($element); |
623 | | - $return .= $skin->makeLinkObj( $eltitle, $eltitle->getText() ) ; |
| 625 | + $return .= self::makeLinkObj( $eltitle, $eltitle->getText() ) ; |
624 | 626 | } |
625 | 627 | return $return; |
626 | 628 | } |
— | — | @@ -690,13 +692,13 @@ |
691 | 693 | $image = new Image( $wgTitle ); |
692 | 694 | if( $image->exists() ) { |
693 | 695 | $link = htmlspecialchars( $image->getURL() ); |
694 | | - $style = $this->getInternalLinkAttributes( $link, $name ); |
| 696 | + $style = self::getInternalLinkAttributes( $link, $name ); |
695 | 697 | $s .= " | <a href=\"{$link}\"{$style}>{$name}</a>"; |
696 | 698 | } |
697 | 699 | } |
698 | 700 | } |
699 | 701 | if ( 'history' == $action || isset( $diff ) || isset( $oldid ) ) { |
700 | | - $s .= ' | ' . $this->makeKnownLinkObj( $wgTitle, |
| 702 | + $s .= ' | ' . self::makeKnownLinkObj( $wgTitle, |
701 | 703 | wfMsg( 'currentrev' ) ); |
702 | 704 | } |
703 | 705 | |
— | — | @@ -704,8 +706,8 @@ |
705 | 707 | # do not show "You have new messages" text when we are viewing our |
706 | 708 | # own talk page |
707 | 709 | if( !$wgTitle->equals( $wgUser->getTalkPage() ) ) { |
708 | | - $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(), wfMsgHtml( 'newmessageslink' ), 'redirect=no' ); |
709 | | - $dl = $this->makeKnownLinkObj( $wgUser->getTalkPage(), wfMsgHtml( 'newmessagesdifflink' ), 'diff=cur' ); |
| 710 | + $tl = self::makeKnownLinkObj( $wgUser->getTalkPage(), wfMsgHtml( 'newmessageslink' ), 'redirect=no' ); |
| 711 | + $dl = self::makeKnownLinkObj( $wgUser->getTalkPage(), wfMsgHtml( 'newmessagesdifflink' ), 'diff=cur' ); |
710 | 712 | $s.= ' | <strong>'. wfMsg( 'youhavenewmessages', $tl, $dl ) . '</strong>'; |
711 | 713 | # disable caching |
712 | 714 | $wgOut->setSquidMaxage(0); |
— | — | @@ -732,7 +734,7 @@ |
733 | 735 | $msg = 'viewdeleted'; |
734 | 736 | } |
735 | 737 | return wfMsg( $msg, |
736 | | - $this->makeKnownLink( |
| 738 | + self::makeKnownLink( |
737 | 739 | $wgContLang->SpecialPage( 'Undelete/' . $wgTitle->getPrefixedDBkey() ), |
738 | 740 | wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $n ) ) ); |
739 | 741 | } |
— | — | @@ -794,7 +796,7 @@ |
795 | 797 | $c++; |
796 | 798 | if ($c<count($links)) { |
797 | 799 | $growinglink .= $link; |
798 | | - $getlink = $this->makeLink( $growinglink, htmlspecialchars( $link ) ); |
| 800 | + $getlink = self::makeLink( $growinglink, htmlspecialchars( $link ) ); |
799 | 801 | if(preg_match('/class="new"/i',$getlink)) { break; } # this is a hack, but it saves time |
800 | 802 | if ($c>1) { |
801 | 803 | $subpages .= ' | '; |
— | — | @@ -821,7 +823,7 @@ |
822 | 824 | if( $wgShowIPinHeader && isset( $_COOKIE[ini_get('session.name')] ) ) { |
823 | 825 | $n = wfGetIP(); |
824 | 826 | |
825 | | - $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(), |
| 827 | + $tl = self::makeKnownLinkObj( $wgUser->getTalkPage(), |
826 | 828 | $wgLang->getNsText( NS_TALK ) ); |
827 | 829 | |
828 | 830 | $s .= $n . ' ('.$tl.')'; |
— | — | @@ -834,24 +836,24 @@ |
835 | 837 | $q = ''; |
836 | 838 | } else { $q = "returnto={$rt}"; } |
837 | 839 | |
838 | | - $s .= "\n<br />" . $this->makeKnownLinkObj( |
| 840 | + $s .= "\n<br />" . self::makeKnownLinkObj( |
839 | 841 | SpecialPage::getTitleFor( 'Userlogin' ), |
840 | 842 | wfMsg( 'login' ), $q ); |
841 | 843 | } else { |
842 | 844 | $n = $wgUser->getName(); |
843 | 845 | $rt = $wgTitle->getPrefixedURL(); |
844 | | - $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(), |
| 846 | + $tl = self::makeKnownLinkObj( $wgUser->getTalkPage(), |
845 | 847 | $wgLang->getNsText( NS_TALK ) ); |
846 | 848 | |
847 | 849 | $tl = " ({$tl})"; |
848 | 850 | |
849 | | - $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(), |
| 851 | + $s .= self::makeKnownLinkObj( $wgUser->getUserPage(), |
850 | 852 | $n ) . "{$tl}<br />" . |
851 | | - $this->makeKnownLinkObj( SpecialPage::getTitleFor( 'Userlogout' ), wfMsg( 'logout' ), |
| 853 | + self::makeKnownLinkObj( SpecialPage::getTitleFor( 'Userlogout' ), wfMsg( 'logout' ), |
852 | 854 | "returnto={$rt}" ) . ' | ' . |
853 | | - $this->specialLink( 'preferences' ); |
| 855 | + self::specialLink( 'preferences' ); |
854 | 856 | } |
855 | | - $s .= ' | ' . $this->makeKnownLink( wfMsgForContent( 'helppage' ), |
| 857 | + $s .= ' | ' . self::makeKnownLink( wfMsgForContent( 'helppage' ), |
856 | 858 | wfMsg( 'help' ) ); |
857 | 859 | |
858 | 860 | return $s; |
— | — | @@ -885,7 +887,7 @@ |
886 | 888 | $sep = " |\n"; |
887 | 889 | |
888 | 890 | $s = $this->mainPageLink() . $sep |
889 | | - . $this->specialLink( 'recentchanges' ); |
| 891 | + . self::specialLink( 'recentchanges' ); |
890 | 892 | |
891 | 893 | if ( $wgOut->isArticleRelated() ) { |
892 | 894 | $s .= $sep . $this->editThisPage() |
— | — | @@ -1042,9 +1044,9 @@ |
1043 | 1045 | |
1044 | 1046 | $out = ''; |
1045 | 1047 | if( $wgRightsPage ) { |
1046 | | - $link = $this->makeKnownLink( $wgRightsPage, $wgRightsText ); |
| 1048 | + $link = self::makeKnownLink( $wgRightsPage, $wgRightsText ); |
1047 | 1049 | } elseif( $wgRightsUrl ) { |
1048 | | - $link = $this->makeExternalLink( $wgRightsUrl, $wgRightsText ); |
| 1050 | + $link = self::makeExternalLink( $wgRightsUrl, $wgRightsText ); |
1049 | 1051 | } else { |
1050 | 1052 | # Give up now |
1051 | 1053 | return $out; |
— | — | @@ -1148,12 +1150,12 @@ |
1149 | 1151 | function mainPageLink() { |
1150 | 1152 | $mp = wfMsgForContent( 'mainpage' ); |
1151 | 1153 | $mptxt = wfMsg( 'mainpage'); |
1152 | | - $s = $this->makeKnownLink( $mp, $mptxt ); |
| 1154 | + $s = self::makeKnownLink( $mp, $mptxt ); |
1153 | 1155 | return $s; |
1154 | 1156 | } |
1155 | 1157 | |
1156 | 1158 | function copyrightLink() { |
1157 | | - $s = $this->makeKnownLink( wfMsgForContent( 'copyrightpage' ), |
| 1159 | + $s = self::makeKnownLink( wfMsgForContent( 'copyrightpage' ), |
1158 | 1160 | wfMsg( 'copyrightpagename' ) ); |
1159 | 1161 | return $s; |
1160 | 1162 | } |
— | — | @@ -1163,12 +1165,12 @@ |
1164 | 1166 | if ($privacy == '-') { |
1165 | 1167 | return ''; |
1166 | 1168 | } else { |
1167 | | - return $this->makeKnownLink( wfMsgForContent( 'privacypage' ), $privacy); |
| 1169 | + return self::makeKnownLink( wfMsgForContent( 'privacypage' ), $privacy); |
1168 | 1170 | } |
1169 | 1171 | } |
1170 | 1172 | |
1171 | 1173 | function aboutLink() { |
1172 | | - $s = $this->makeKnownLink( wfMsgForContent( 'aboutpage' ), |
| 1174 | + $s = self::makeKnownLink( wfMsgForContent( 'aboutpage' ), |
1173 | 1175 | wfMsg( 'aboutsite' ) ); |
1174 | 1176 | return $s; |
1175 | 1177 | } |
— | — | @@ -1178,7 +1180,7 @@ |
1179 | 1181 | if ($disclaimers == '-') { |
1180 | 1182 | return ''; |
1181 | 1183 | } else { |
1182 | | - return $this->makeKnownLink( wfMsgForContent( 'disclaimerpage' ), |
| 1184 | + return self::makeKnownLink( wfMsgForContent( 'disclaimerpage' ), |
1183 | 1185 | $disclaimers ); |
1184 | 1186 | } |
1185 | 1187 | } |
— | — | @@ -1195,7 +1197,7 @@ |
1196 | 1198 | $t = wfMsg( 'viewsource' ); |
1197 | 1199 | } |
1198 | 1200 | |
1199 | | - $s = $this->makeKnownLinkObj( $wgTitle, $t, $this->editUrlOptions() ); |
| 1201 | + $s = self::makeKnownLinkObj( $wgTitle, $t, $this->editUrlOptions() ); |
1200 | 1202 | } |
1201 | 1203 | return $s; |
1202 | 1204 | } |
— | — | @@ -1224,7 +1226,7 @@ |
1225 | 1227 | if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isAllowed('delete') ) { |
1226 | 1228 | $t = wfMsg( 'deletethispage' ); |
1227 | 1229 | |
1228 | | - $s = $this->makeKnownLinkObj( $wgTitle, $t, 'action=delete' ); |
| 1230 | + $s = self::makeKnownLinkObj( $wgTitle, $t, 'action=delete' ); |
1229 | 1231 | } else { |
1230 | 1232 | $s = ''; |
1231 | 1233 | } |
— | — | @@ -1243,7 +1245,7 @@ |
1244 | 1246 | $t = wfMsg( 'protectthispage' ); |
1245 | 1247 | $q = 'action=protect'; |
1246 | 1248 | } |
1247 | | - $s = $this->makeKnownLinkObj( $wgTitle, $t, $q ); |
| 1249 | + $s = self::makeKnownLinkObj( $wgTitle, $t, $q ); |
1248 | 1250 | } else { |
1249 | 1251 | $s = ''; |
1250 | 1252 | } |
— | — | @@ -1261,7 +1263,7 @@ |
1262 | 1264 | $t = wfMsg( 'watchthispage' ); |
1263 | 1265 | $q = 'action=watch'; |
1264 | 1266 | } |
1265 | | - $s = $this->makeKnownLinkObj( $wgTitle, $t, $q ); |
| 1267 | + $s = self::makeKnownLinkObj( $wgTitle, $t, $q ); |
1266 | 1268 | } else { |
1267 | 1269 | $s = wfMsg( 'notanarticle' ); |
1268 | 1270 | } |
— | — | @@ -1272,7 +1274,7 @@ |
1273 | 1275 | global $wgTitle; |
1274 | 1276 | |
1275 | 1277 | if ( $wgTitle->userCanMove() ) { |
1276 | | - return $this->makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ), |
| 1278 | + return self::makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ), |
1277 | 1279 | wfMsg( 'movethispage' ), 'target=' . $wgTitle->getPrefixedURL() ); |
1278 | 1280 | } else { |
1279 | 1281 | // no message if page is protected - would be redundant |
— | — | @@ -1283,14 +1285,14 @@ |
1284 | 1286 | function historyLink() { |
1285 | 1287 | global $wgTitle; |
1286 | 1288 | |
1287 | | - return $this->makeKnownLinkObj( $wgTitle, |
| 1289 | + return self::makeKnownLinkObj( $wgTitle, |
1288 | 1290 | wfMsg( 'history' ), 'action=history' ); |
1289 | 1291 | } |
1290 | 1292 | |
1291 | 1293 | function whatLinksHere() { |
1292 | 1294 | global $wgTitle; |
1293 | 1295 | |
1294 | | - return $this->makeKnownLinkObj( |
| 1296 | + return self::makeKnownLinkObj( |
1295 | 1297 | SpecialPage::getTitleFor( 'Whatlinkshere', $wgTitle->getPrefixedDBkey() ), |
1296 | 1298 | wfMsg( 'whatlinkshere' ) ); |
1297 | 1299 | } |
— | — | @@ -1298,7 +1300,7 @@ |
1299 | 1301 | function userContribsLink() { |
1300 | 1302 | global $wgTitle; |
1301 | 1303 | |
1302 | | - return $this->makeKnownLinkObj( |
| 1304 | + return self::makeKnownLinkObj( |
1303 | 1305 | SpecialPage::getTitleFor( 'Contributions', $wgTitle->getDBkey() ), |
1304 | 1306 | wfMsg( 'contributions' ) ); |
1305 | 1307 | } |
— | — | @@ -1317,7 +1319,7 @@ |
1318 | 1320 | function emailUserLink() { |
1319 | 1321 | global $wgTitle; |
1320 | 1322 | |
1321 | | - return $this->makeKnownLinkObj( |
| 1323 | + return self::makeKnownLinkObj( |
1322 | 1324 | SpecialPage::getTitleFor( 'Emailuser', $wgTitle->getDBkey() ), |
1323 | 1325 | wfMsg( 'emailuser' ) ); |
1324 | 1326 | } |
— | — | @@ -1328,7 +1330,7 @@ |
1329 | 1331 | if ( ! $wgOut->isArticleRelated() ) { |
1330 | 1332 | return '(' . wfMsg( 'notanarticle' ) . ')'; |
1331 | 1333 | } else { |
1332 | | - return $this->makeKnownLinkObj( |
| 1334 | + return self::makeKnownLinkObj( |
1333 | 1335 | SpecialPage::getTitleFor( 'Recentchangeslinked', $wgTitle->getPrefixedDBkey() ), |
1334 | 1336 | wfMsg( 'recentchangeslinked' ) ); |
1335 | 1337 | } |
— | — | @@ -1365,7 +1367,7 @@ |
1366 | 1368 | $text = $wgContLang->getLanguageName( $nt->getInterwiki() ); |
1367 | 1369 | |
1368 | 1370 | if ( '' == $text ) { $text = $l; } |
1369 | | - $style = $this->getExternalLinkAttributes( $l, $text ); |
| 1371 | + $style = self::getExternalLinkAttributes( $l, $text ); |
1370 | 1372 | $s .= "<a href=\"{$url}\"{$style}>{$text}</a>"; |
1371 | 1373 | } |
1372 | 1374 | if($wgContLang->isRTL()) $s .= '</span>'; |
— | — | @@ -1373,7 +1375,7 @@ |
1374 | 1376 | } |
1375 | 1377 | |
1376 | 1378 | function bugReportsLink() { |
1377 | | - $s = $this->makeKnownLink( wfMsgForContent( 'bugreportspage' ), |
| 1379 | + $s = self::makeKnownLink( wfMsgForContent( 'bugreportspage' ), |
1378 | 1380 | wfMsg( 'bugreports' ) ); |
1379 | 1381 | return $s; |
1380 | 1382 | } |
— | — | @@ -1385,18 +1387,18 @@ |
1386 | 1388 | $id = $t1->getArticleID(); |
1387 | 1389 | |
1388 | 1390 | if ( 0 == $id ) { |
1389 | | - $s = $this->makeBrokenLink( $t1->getText() ); |
| 1391 | + $s = self::makeBrokenLink( $t1->getText() ); |
1390 | 1392 | } else { |
1391 | | - $s = $this->makeKnownLink( $t1->getText() ); |
| 1393 | + $s = self::makeKnownLink( $t1->getText() ); |
1392 | 1394 | } |
1393 | 1395 | $s .= ', '; |
1394 | 1396 | |
1395 | 1397 | $id = $t2->getArticleID(); |
1396 | 1398 | |
1397 | 1399 | if ( 0 == $id ) { |
1398 | | - $s .= $this->makeBrokenLink( $t2->getText() ); |
| 1400 | + $s .= self::makeBrokenLink( $t2->getText() ); |
1399 | 1401 | } else { |
1400 | | - $s .= $this->makeKnownLink( $t2->getText() ); |
| 1402 | + $s .= self::makeKnownLink( $t2->getText() ); |
1401 | 1403 | } |
1402 | 1404 | return $s; |
1403 | 1405 | } |
— | — | @@ -1444,7 +1446,7 @@ |
1445 | 1447 | $text = wfMsg( 'talkpage' ); |
1446 | 1448 | } |
1447 | 1449 | |
1448 | | - $s = $this->makeLinkObj( $link, $text ); |
| 1450 | + $s = self::makeLinkObj( $link, $text ); |
1449 | 1451 | |
1450 | 1452 | return $s; |
1451 | 1453 | } |
— | — | @@ -1467,7 +1469,7 @@ |
1468 | 1470 | $title =& $wgTitle->getTalkPage(); |
1469 | 1471 | } |
1470 | 1472 | |
1471 | | - return $this->makeKnownLinkObj( $title, wfMsg( 'postcomment' ), 'action=edit§ion=new' ); |
| 1473 | + return self::makeKnownLinkObj( $title, wfMsg( 'postcomment' ), 'action=edit§ion=new' ); |
1472 | 1474 | } |
1473 | 1475 | |
1474 | 1476 | /* these are used extensively in SkinTemplate, but also some other places */ |
Index: trunk/phase3/includes/SpecialUnusedcategories.php |
— | — | @@ -33,9 +33,9 @@ |
34 | 34 | AND page_is_redirect = 0"; |
35 | 35 | } |
36 | 36 | |
37 | | - function formatResult( $skin, $result ) { |
| 37 | + function formatResult( $result ) { |
38 | 38 | $title = Title::makeTitle( NS_CATEGORY, $result->title ); |
39 | | - return $skin->makeLinkObj( $title, $title->getText() ); |
| 39 | + return Linker::makeLinkObj( $title, $title->getText() ); |
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
Index: trunk/phase3/includes/SpecialUnusedtemplates.php |
— | — | @@ -33,10 +33,10 @@ |
34 | 34 | return $sql; |
35 | 35 | } |
36 | 36 | |
37 | | - function formatResult( $skin, $result ) { |
| 37 | + function formatResult( $result ) { |
38 | 38 | $title = Title::makeTitle( NS_TEMPLATE, $result->title ); |
39 | | - $pageLink = $skin->makeKnownLinkObj( $title, '', 'redirect=no' ); |
40 | | - $wlhLink = $skin->makeKnownLinkObj( |
| 39 | + $pageLink = Linker::makeKnownLinkObj( $title, '', 'redirect=no' ); |
| 40 | + $wlhLink = Linker::makeKnownLinkObj( |
41 | 41 | SpecialPage::getTitleFor( 'Whatlinkshere' ), |
42 | 42 | wfMsgHtml( 'unusedtemplateswlh' ), |
43 | 43 | 'target=' . $title->getPrefixedUrl() ); |
Index: trunk/phase3/includes/SpecialUpload.php |
— | — | @@ -254,7 +254,7 @@ |
255 | 255 | * @access private |
256 | 256 | */ |
257 | 257 | function processUpload() { |
258 | | - global $wgUser, $wgOut; |
| 258 | + global $wgOut; |
259 | 259 | |
260 | 260 | /* Check for PHP error if any, requires php 4.2 or newer */ |
261 | 261 | if( $this->mUploadError == 1/*UPLOAD_ERR_INI_SIZE*/ ) { |
— | — | @@ -395,18 +395,15 @@ |
396 | 396 | } |
397 | 397 | |
398 | 398 | if( $nt->getArticleID() ) { |
399 | | - global $wgUser; |
400 | | - $sk = $wgUser->getSkin(); |
401 | | - $dlink = $sk->makeKnownLinkObj( $nt ); |
| 399 | + $dlink = Linker::makeKnownLinkObj( $nt ); |
402 | 400 | $warning .= '<li>'.wfMsgHtml( 'fileexists', $dlink ).'</li>'; |
403 | 401 | } else { |
404 | 402 | # If the file existed before and was deleted, warn the user of this |
405 | 403 | # Don't bother doing so if the image exists now, however |
406 | 404 | $image = new Image( $nt ); |
407 | 405 | if( $image->wasDeleted() ) { |
408 | | - $skin = $wgUser->getSkin(); |
409 | 406 | $ltitle = SpecialPage::getTitleFor( 'Log' ); |
410 | | - $llink = $skin->makeKnownLinkObj( $ltitle, wfMsgHtml( 'deletionlog' ), 'type=delete&page=' . $nt->getPrefixedUrl() ); |
| 407 | + $llink = Linker::makeKnownLinkObj( $ltitle, wfMsgHtml( 'deletionlog' ), 'type=delete&page=' . $nt->getPrefixedUrl() ); |
411 | 408 | $warning .= wfOpenElement( 'li' ) . wfMsgWikiHtml( 'filewasdeleted', $llink ) . wfCloseElement( 'li' ); |
412 | 409 | } |
413 | 410 | } |
— | — | @@ -591,12 +588,11 @@ |
592 | 589 | * @access private |
593 | 590 | */ |
594 | 591 | function showSuccess() { |
595 | | - global $wgUser, $wgOut, $wgContLang; |
| 592 | + global $wgOut, $wgContLang; |
596 | 593 | |
597 | | - $sk = $wgUser->getSkin(); |
598 | | - $ilink = $sk->makeMediaLink( $this->mUploadSaveName, Image::imageUrl( $this->mUploadSaveName ) ); |
| 594 | + $ilink = Linker::makeMediaLink( $this->mUploadSaveName, Image::imageUrl( $this->mUploadSaveName ) ); |
599 | 595 | $dname = $wgContLang->getNsText( NS_IMAGE ) . ':'.$this->mUploadSaveName; |
600 | | - $dlink = $sk->makeKnownLink( $dname, $dname ); |
| 596 | + $dlink = Linker::makeKnownLink( $dname, $dname ); |
601 | 597 | |
602 | 598 | $wgOut->addHTML( '<h2>' . wfMsgHtml( 'successfulupload' ) . "</h2>\n" ); |
603 | 599 | $text = wfMsgWikiHtml( 'fileuploaded', $ilink, $dlink ); |
— | — | @@ -704,7 +700,6 @@ |
705 | 701 | $wgOut->addHTML( '<div id="uploadtext">' ); |
706 | 702 | $wgOut->addWikiText( wfMsg( 'uploadtext' ) ); |
707 | 703 | $wgOut->addHTML( '</div>' ); |
708 | | - $sk = $wgUser->getSkin(); |
709 | 704 | |
710 | 705 | |
711 | 706 | $sourcefilename = wfMsgHtml( 'sourcefilename' ); |
Index: trunk/phase3/includes/SpecialListusers.php |
— | — | @@ -173,9 +173,9 @@ |
174 | 174 | return false; |
175 | 175 | } |
176 | 176 | |
177 | | - function formatResult( $skin, $result ) { |
| 177 | + function formatResult( $result ) { |
178 | 178 | $userPage = Title::makeTitle( $result->namespace, $result->title ); |
179 | | - $name = $skin->makeLinkObj( $userPage, htmlspecialchars( $userPage->getText() ) ); |
| 179 | + $name = Linker::makeLinkObj( $userPage, htmlspecialchars( $userPage->getText() ) ); |
180 | 180 | $groups = null; |
181 | 181 | |
182 | 182 | if( !isset( $result->numgroups ) || $result->numgroups > 0 ) { |
Index: trunk/phase3/includes/ImageGallery.php |
— | — | @@ -17,7 +17,6 @@ |
18 | 18 | { |
19 | 19 | var $mImages, $mShowBytes, $mShowFilename; |
20 | 20 | var $mCaption = false; |
21 | | - var $mSkin = false; |
22 | 21 | |
23 | 22 | /** |
24 | 23 | * Is the gallery on a wiki page (i.e. not a special page) |
— | — | @@ -51,30 +50,6 @@ |
52 | 51 | } |
53 | 52 | |
54 | 53 | /** |
55 | | - * Instruct the class to use a specific skin for rendering |
56 | | - * |
57 | | - * @param $skin Skin object |
58 | | - */ |
59 | | - function useSkin( $skin ) { |
60 | | - $this->mSkin =& $skin; |
61 | | - } |
62 | | - |
63 | | - /** |
64 | | - * Return the skin that should be used |
65 | | - * |
66 | | - * @return Skin object |
67 | | - */ |
68 | | - function getSkin() { |
69 | | - if( !$this->mSkin ) { |
70 | | - global $wgUser; |
71 | | - $skin =& $wgUser->getSkin(); |
72 | | - } else { |
73 | | - $skin =& $this->mSkin; |
74 | | - } |
75 | | - return $skin; |
76 | | - } |
77 | | - |
78 | | - /** |
79 | 54 | * Add an image to the gallery. |
80 | 55 | * |
81 | 56 | * @param $image Image object that is added to the gallery |
— | — | @@ -136,8 +111,6 @@ |
137 | 112 | function toHTML() { |
138 | 113 | global $wgLang, $wgIgnoreImageErrors, $wgGenerateThumbnailOnParse; |
139 | 114 | |
140 | | - $sk = $this->getSkin(); |
141 | | - |
142 | 115 | $s = '<table class="gallery" cellspacing="0" cellpadding="0">'; |
143 | 116 | if( $this->mCaption ) |
144 | 117 | $s .= '<td class="galleryheader" colspan="4"><big>' . htmlspecialchars( $this->mCaption ) . '</big></td>'; |
— | — | @@ -157,7 +130,7 @@ |
158 | 131 | else if( $this->mParsing && wfIsBadImage( $nt->getDBkey() ) ) { |
159 | 132 | # The image is blacklisted, just show it as a text link. |
160 | 133 | $thumbhtml = '<div style="height: 152px;">' |
161 | | - . $sk->makeKnownLinkObj( $nt, htmlspecialchars( $nt->getText() ) ) . '</div>'; |
| 134 | + . Linker::makeKnownLinkObj( $nt, htmlspecialchars( $nt->getText() ) ) . '</div>'; |
162 | 135 | } else if( !( $thumb = $img->getThumbnail( 120, 120, $wgGenerateThumbnailOnParse ) ) ) { |
163 | 136 | # Error generating thumbnail. |
164 | 137 | $thumbhtml = '<div style="height: 152px;">' |
— | — | @@ -166,11 +139,11 @@ |
167 | 140 | else { |
168 | 141 | $vpad = floor( ( 150 - $thumb->height ) /2 ) - 2; |
169 | 142 | $thumbhtml = '<div class="thumb" style="padding: ' . $vpad . 'px 0;">' |
170 | | - . $sk->makeKnownLinkObj( $nt, $thumb->toHtml() ) . '</div>'; |
| 143 | + . Linker::makeKnownLinkObj( $nt, $thumb->toHtml() ) . '</div>'; |
171 | 144 | } |
172 | 145 | |
173 | 146 | //TODO |
174 | | - //$ul = $sk->makeLink( $wgContLang->getNsText( Namespace::getUser() ) . ":{$ut}", $ut ); |
| 147 | + //$ul = Linker::makeLink( $wgContLang->getNsText( Namespace::getUser() ) . ":{$ut}", $ut ); |
175 | 148 | |
176 | 149 | if( $this->mShowBytes ) { |
177 | 150 | if( $img->exists() ) { |
— | — | @@ -185,7 +158,7 @@ |
186 | 159 | } |
187 | 160 | |
188 | 161 | $textlink = $this->mShowFilename ? |
189 | | - $sk->makeKnownLinkObj( $nt, htmlspecialchars( $wgLang->truncate( $nt->getText(), 20, '...' ) ) ) . "<br />\n" : |
| 162 | + Linker::makeKnownLinkObj( $nt, htmlspecialchars( $wgLang->truncate( $nt->getText(), 20, '...' ) ) ) . "<br />\n" : |
190 | 163 | '' ; |
191 | 164 | |
192 | 165 | # ATTENTION: The newline after <div class="gallerytext"> is needed to accommodate htmltidy which |
Index: trunk/phase3/includes/SpecialWantedpages.php |
— | — | @@ -66,7 +66,7 @@ |
67 | 67 | } |
68 | 68 | |
69 | 69 | |
70 | | - function formatResult( $skin, $result ) { |
| 70 | + function formatResult( $result ) { |
71 | 71 | global $wgLang; |
72 | 72 | |
73 | 73 | $title = Title::makeTitleSafe( $result->namespace, $result->title ); |
— | — | @@ -75,19 +75,19 @@ |
76 | 76 | # Check existence; which is stored in the link cache |
77 | 77 | if( !$title->exists() ) { |
78 | 78 | # Make a redlink |
79 | | - $pageLink = $skin->makeBrokenLinkObj( $title ); |
| 79 | + $pageLink = Linker::makeBrokenLinkObj( $title ); |
80 | 80 | } else { |
81 | 81 | # Make a a struck-out normal link |
82 | | - $pageLink = "<s>" . $skin->makeLinkObj( $title ) . "</s>"; |
| 82 | + $pageLink = "<s>" . Linker::makeLinkObj( $title ) . "</s>"; |
83 | 83 | } |
84 | 84 | } else { |
85 | 85 | # Not cached? Don't bother checking existence; it can't |
86 | | - $pageLink = $skin->makeBrokenLinkObj( $title ); |
| 86 | + $pageLink = Linker::makeBrokenLinkObj( $title ); |
87 | 87 | } |
88 | 88 | |
89 | 89 | # Make a link to "what links here" if it's required |
90 | 90 | $wlhLink = $this->nlinks |
91 | | - ? $this->makeWlhLink( $title, $skin, |
| 91 | + ? $this->makeWlhLink( $title, |
92 | 92 | wfMsgExt( 'nlinks', array( 'parsemag', 'escape'), |
93 | 93 | $wgLang->formatNum( $result->value ) ) ) |
94 | 94 | : null; |
— | — | @@ -98,13 +98,12 @@ |
99 | 99 | /** |
100 | 100 | * Make a "what links here" link for a specified title |
101 | 101 | * @param $title Title to make the link for |
102 | | - * @param $skin Skin to use |
103 | 102 | * @param $text Link text |
104 | 103 | * @return string |
105 | 104 | */ |
106 | | - function makeWlhLink( &$title, &$skin, $text ) { |
| 105 | + function makeWlhLink( &$title, $text ) { |
107 | 106 | $wlhTitle = SpecialPage::getTitleFor( 'Whatlinkshere' ); |
108 | | - return $skin->makeKnownLinkObj( $wlhTitle, $text, 'target=' . $title->getPrefixedUrl() ); |
| 107 | + return Linker::makeKnownLinkObj( $wlhTitle, $text, 'target=' . $title->getPrefixedUrl() ); |
109 | 108 | } |
110 | 109 | |
111 | 110 | } |
Index: trunk/phase3/includes/SpecialConfirmemail.php |
— | — | @@ -38,8 +38,7 @@ |
39 | 39 | } else { |
40 | 40 | $title = SpecialPage::getTitleFor( 'Userlogin' ); |
41 | 41 | $self = SpecialPage::getTitleFor( 'Confirmemail' ); |
42 | | - $skin = $wgUser->getSkin(); |
43 | | - $llink = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $self->getPrefixedUrl() ); |
| 42 | + $llink = Linker::makeKnownLinkObj( $title, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $self->getPrefixedUrl() ); |
44 | 43 | $wgOut->addHtml( wfMsgWikiHtml( 'confirmemail_needlogin', $llink ) ); |
45 | 44 | } |
46 | 45 | } else { |
Index: trunk/phase3/includes/SpecialMostlinked.php |
— | — | @@ -58,28 +58,26 @@ |
59 | 59 | * Make a link to "what links here" for the specified title |
60 | 60 | * |
61 | 61 | * @param $title Title being queried |
62 | | - * @param $skin Skin to use |
63 | 62 | * @return string |
64 | 63 | */ |
65 | | - function makeWlhLink( &$title, $caption, &$skin ) { |
| 64 | + function makeWlhLink( &$title, $caption ) { |
66 | 65 | $wlh = SpecialPage::getTitleFor( 'Whatlinkshere', $title->getPrefixedDBkey() ); |
67 | | - return $skin->makeKnownLinkObj( $wlh, $caption ); |
| 66 | + return Linker::makeKnownLinkObj( $wlh, $caption ); |
68 | 67 | } |
69 | 68 | |
70 | 69 | /** |
71 | 70 | * Make links to the page corresponding to the item, and the "what links here" page for it |
72 | 71 | * |
73 | | - * @param $skin Skin to be used |
74 | 72 | * @param $result Result row |
75 | 73 | * @return string |
76 | 74 | */ |
77 | | - function formatResult( $skin, $result ) { |
| 75 | + function formatResult( $result ) { |
78 | 76 | global $wgLang; |
79 | 77 | $title = Title::makeTitleSafe( $result->namespace, $result->title ); |
80 | | - $link = $skin->makeLinkObj( $title ); |
| 78 | + $link = Linker::makeLinkObj( $title ); |
81 | 79 | $wlh = $this->makeWlhLink( $title, |
82 | 80 | wfMsgExt( 'nlinks', array( 'parsemag', 'escape'), |
83 | | - $wgLang->formatNum( $result->value ) ), $skin ); |
| 81 | + $wgLang->formatNum( $result->value ) ) ); |
84 | 82 | return wfSpecialList( $link, $wlh ); |
85 | 83 | } |
86 | 84 | } |
Index: trunk/phase3/includes/SpecialMIMEsearch.php |
— | — | @@ -59,19 +59,19 @@ |
60 | 60 | "; |
61 | 61 | } |
62 | 62 | |
63 | | - function formatResult( $skin, $result ) { |
| 63 | + function formatResult( $result ) { |
64 | 64 | global $wgContLang, $wgLang; |
65 | 65 | |
66 | 66 | $nt = Title::makeTitle( $result->namespace, $result->title ); |
67 | 67 | $text = $wgContLang->convert( $nt->getText() ); |
68 | | - $plink = $skin->makeLink( $nt->getPrefixedText(), $text ); |
| 68 | + $plink = Linker::makeLink( $nt->getPrefixedText(), $text ); |
69 | 69 | |
70 | | - $download = $skin->makeMediaLink( $nt->getText(), 'fuck me!', wfMsgHtml( 'download' ) ); |
| 70 | + $download = Linker::makeMediaLink( $nt->getText(), 'fuck me!', wfMsgHtml( 'download' ) ); |
71 | 71 | $bytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'), |
72 | 72 | $wgLang->formatNum( $result->img_size ) ); |
73 | 73 | $dimensions = wfMsg( 'widthheight', $wgLang->formatNum( $result->img_width ), |
74 | 74 | $wgLang->formatNum( $result->img_height ) ); |
75 | | - $user = $skin->makeLinkObj( Title::makeTitle( NS_USER, $result->img_user_text ), $result->img_user_text ); |
| 75 | + $user = Linker::makeLinkObj( Title::makeTitle( NS_USER, $result->img_user_text ), $result->img_user_text ); |
76 | 76 | $time = $wgLang->timeanddate( $result->img_timestamp ); |
77 | 77 | |
78 | 78 | return "($download) $plink . . $dimensions . . $bytes . . $user . . $time"; |
Index: trunk/phase3/includes/SpecialMostlinkedcategories.php |
— | — | @@ -53,13 +53,13 @@ |
54 | 54 | $db->dataSeek( $res, 0 ); |
55 | 55 | } |
56 | 56 | |
57 | | - function formatResult( $skin, $result ) { |
| 57 | + function formatResult( $result ) { |
58 | 58 | global $wgLang, $wgContLang; |
59 | 59 | |
60 | 60 | $nt = Title::makeTitle( $result->namespace, $result->title ); |
61 | 61 | $text = $wgContLang->convert( $nt->getText() ); |
62 | 62 | |
63 | | - $plink = $skin->makeLinkObj( $nt, htmlspecialchars( $text ) ); |
| 63 | + $plink = Linker::makeLinkObj( $nt, htmlspecialchars( $text ) ); |
64 | 64 | |
65 | 65 | $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'), |
66 | 66 | $wgLang->formatNum( $result->value ) ); |
Index: trunk/phase3/includes/SpecialRecentchangeslinked.php |
— | — | @@ -23,7 +23,6 @@ |
24 | 24 | $hideminor = $wgRequest->getBool( 'hideminor' ) ? 1 : 0; |
25 | 25 | |
26 | 26 | $wgOut->setPagetitle( wfMsg( 'recentchangeslinked' ) ); |
27 | | - $sk = $wgUser->getSkin(); |
28 | 27 | |
29 | 28 | # Validate the title |
30 | 29 | $nt = Title::newFromURL( $target ); |
— | — | @@ -55,11 +54,11 @@ |
56 | 55 | |
57 | 56 | $hideminor = ($hideminor ? 1 : 0); |
58 | 57 | if ( $hideminor ) { |
59 | | - $mlink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recentchangeslinked' ), |
| 58 | + $mlink = Linker::makeKnownLink( $wgContLang->specialPage( 'Recentchangeslinked' ), |
60 | 59 | wfMsg( 'show' ), 'target=' . htmlspecialchars( $nt->getPrefixedURL() ) . |
61 | 60 | "&days={$days}&limit={$limit}&hideminor=0" ); |
62 | 61 | } else { |
63 | | - $mlink = $sk->makeKnownLink( $wgContLang->specialPage( "Recentchangeslinked" ), |
| 62 | + $mlink = Linker::makeKnownLink( $wgContLang->specialPage( "Recentchangeslinked" ), |
64 | 63 | wfMsg( "hide" ), "target=" . htmlspecialchars( $nt->getPrefixedURL() ) . |
65 | 64 | "&days={$days}&limit={$limit}&hideminor=1" ); |
66 | 65 | } |
— | — | @@ -138,7 +137,7 @@ |
139 | 138 | } |
140 | 139 | $res = $dbr->query( $sql, $fname ); |
141 | 140 | |
142 | | - $wgOut->addHTML("< ".$sk->makeKnownLinkObj($nt, "", "redirect=no" )."<br />\n"); |
| 141 | + $wgOut->addHTML("< ".Linker::makeKnownLinkObj($nt, "", "redirect=no" )."<br />\n"); |
143 | 142 | $note = wfMsg( "rcnote", $limit, $days, $wgLang->timeAndDate( wfTimestampNow(), true ) ); |
144 | 143 | $wgOut->addHTML( "<hr />\n{$note}\n<br />" ); |
145 | 144 | |
Index: trunk/phase3/includes/ChangesList.php |
— | — | @@ -34,8 +34,7 @@ |
35 | 35 | # |
36 | 36 | |
37 | 37 | /** @todo document */ |
38 | | - function ChangesList( &$skin ) { |
39 | | - $this->skin =& $skin; |
| 38 | + function ChangesList() { |
40 | 39 | $this->preCacheMessages(); |
41 | 40 | } |
42 | 41 | |
— | — | @@ -47,10 +46,9 @@ |
48 | 47 | * @return ChangesList derivative |
49 | 48 | */ |
50 | 49 | function newFromUser( &$user ) { |
51 | | - $sk =& $user->getSkin(); |
52 | 50 | $list = NULL; |
53 | | - if( wfRunHooks( 'FetchChangesList', array( &$user, &$skin, &$list ) ) ) { |
54 | | - return $user->getOption( 'usenewrc' ) ? new EnhancedChangesList( $sk ) : new OldChangesList( $sk ); |
| 51 | + if( wfRunHooks( 'FetchChangesList', array( &$user, &$list ) ) ) { |
| 52 | + return $user->getOption( 'usenewrc' ) ? new EnhancedChangesList() : new OldChangesList(); |
55 | 53 | } else { |
56 | 54 | return $list; |
57 | 55 | } |
— | — | @@ -112,13 +110,13 @@ |
113 | 111 | # Diff |
114 | 112 | $s .= '(' . $this->message['diff'] . ') ('; |
115 | 113 | # Hist |
116 | | - $s .= $this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), $this->message['hist'], 'action=history' ) . |
| 114 | + $s .= Linker::makeKnownLinkObj( $rc->getMovedToTitle(), $this->message['hist'], 'action=history' ) . |
117 | 115 | ') . . '; |
118 | 116 | |
119 | 117 | # "[[x]] moved to [[y]]" |
120 | 118 | $msg = ( $rc->mAttribs['rc_type'] == RC_MOVE ) ? '1movedto2' : '1movedto2_redir'; |
121 | | - $s .= wfMsg( $msg, $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ), |
122 | | - $this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) ); |
| 119 | + $s .= wfMsg( $msg, Linker::makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ), |
| 120 | + Linker::makeKnownLinkObj( $rc->getMovedToTitle(), '' ) ); |
123 | 121 | } |
124 | 122 | |
125 | 123 | function insertDateHeader(&$s, $rc_timestamp) { |
— | — | @@ -139,7 +137,7 @@ |
140 | 138 | |
141 | 139 | function insertLog(&$s, $title, $logtype) { |
142 | 140 | $logname = LogPage::logName( $logtype ); |
143 | | - $s .= '(' . $this->skin->makeKnownLinkObj($title, $logname ) . ')'; |
| 141 | + $s .= '(' . Linker::makeKnownLinkObj($title, $logname ) . ')'; |
144 | 142 | } |
145 | 143 | |
146 | 144 | |
— | — | @@ -151,7 +149,7 @@ |
152 | 150 | $rcidparam = $unpatrolled |
153 | 151 | ? array( 'rcid' => $rc->mAttribs['rc_id'] ) |
154 | 152 | : array(); |
155 | | - $diffLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['diff'], |
| 153 | + $diffLink = Linker::makeKnownLinkObj( $rc->getTitle(), $this->message['diff'], |
156 | 154 | wfArrayToCGI( array( |
157 | 155 | 'curid' => $rc->mAttribs['rc_cur_id'], |
158 | 156 | 'diff' => $rc->mAttribs['rc_this_oldid'], |
— | — | @@ -162,7 +160,7 @@ |
163 | 161 | $s .= '('.$diffLink.') ('; |
164 | 162 | |
165 | 163 | # History link |
166 | | - $s .= $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['hist'], |
| 164 | + $s .= Linker::makeKnownLinkObj( $rc->getTitle(), $this->message['hist'], |
167 | 165 | wfArrayToCGI( array( |
168 | 166 | 'curid' => $rc->mAttribs['rc_cur_id'], |
169 | 167 | 'action' => 'history' ) ) ); |
— | — | @@ -176,7 +174,7 @@ |
177 | 175 | $params = ( $unpatrolled && $rc->mAttribs['rc_type'] == RC_NEW ) |
178 | 176 | ? 'rcid='.$rc->mAttribs['rc_id'] |
179 | 177 | : ''; |
180 | | - $articlelink = ' '. $this->skin->makeKnownLinkObj( $rc->getTitle(), '', $params ); |
| 178 | + $articlelink = ' '. Linker::makeKnownLinkObj( $rc->getTitle(), '', $params ); |
181 | 179 | if($watched) $articlelink = '<strong>'.$articlelink.'</strong>'; |
182 | 180 | global $wgContLang; |
183 | 181 | $articlelink .= $wgContLang->getDirMark(); |
— | — | @@ -192,15 +190,15 @@ |
193 | 191 | |
194 | 192 | /** Insert links to user page, user talk page and eventually a blocking link */ |
195 | 193 | function insertUserRelatedLinks(&$s, &$rc) { |
196 | | - $s .= $this->skin->userLink( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); |
197 | | - $s .= $this->skin->userToolLinks( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); |
| 194 | + $s .= Linker::userLink( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); |
| 195 | + $s .= Linker::userToolLinks( $rc->mAttribs['rc_user'], $rc->mAttribs['rc_user_text'] ); |
198 | 196 | } |
199 | 197 | |
200 | 198 | /** insert a formatted comment */ |
201 | 199 | function insertComment(&$s, &$rc) { |
202 | 200 | # Add comment |
203 | 201 | if( $rc->mAttribs['rc_type'] != RC_MOVE && $rc->mAttribs['rc_type'] != RC_MOVE_OVER_REDIRECT ) { |
204 | | - $s .= $this->skin->commentBlock( $rc->mAttribs['rc_comment'], $rc->getTitle() ); |
| 202 | + $s .= Linker::commentBlock( $rc->mAttribs['rc_comment'], $rc->getTitle() ); |
205 | 203 | } |
206 | 204 | } |
207 | 205 | |
— | — | @@ -324,23 +322,23 @@ |
325 | 323 | # Make article link |
326 | 324 | if( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) { |
327 | 325 | $msg = ( $rc_type == RC_MOVE ) ? "1movedto2" : "1movedto2_redir"; |
328 | | - $clink = wfMsg( $msg, $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ), |
329 | | - $this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) ); |
| 326 | + $clink = wfMsg( $msg, Linker::makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ), |
| 327 | + Linker::makeKnownLinkObj( $rc->getMovedToTitle(), '' ) ); |
330 | 328 | } elseif( $rc_namespace == NS_SPECIAL ) { |
331 | 329 | list( $specialName, $logtype ) = SpecialPage::resolveAliasWithSubpage( $rc_title ); |
332 | 330 | if ( $specialName == 'Log' ) { |
333 | 331 | # Log updates, etc |
334 | 332 | $logname = LogPage::logName( $logtype ); |
335 | | - $clink = '(' . $this->skin->makeKnownLinkObj( $rc->getTitle(), $logname ) . ')'; |
| 333 | + $clink = '(' . Linker::makeKnownLinkObj( $rc->getTitle(), $logname ) . ')'; |
336 | 334 | } else { |
337 | 335 | wfDebug( "Unexpected special page in recentchanges\n" ); |
338 | 336 | $clink = ''; |
339 | 337 | } |
340 | 338 | } elseif( $rc->unpatrolled && $rc_type == RC_NEW ) { |
341 | 339 | # Unpatrolled new page, give rc_id in query |
342 | | - $clink = $this->skin->makeKnownLinkObj( $rc->getTitle(), '', "rcid={$rc_id}" ); |
| 340 | + $clink = Linker::makeKnownLinkObj( $rc->getTitle(), '', "rcid={$rc_id}" ); |
343 | 341 | } else { |
344 | | - $clink = $this->skin->makeKnownLinkObj( $rc->getTitle(), '' ); |
| 342 | + $clink = Linker::makeKnownLinkObj( $rc->getTitle(), '' ); |
345 | 343 | } |
346 | 344 | |
347 | 345 | $time = $wgContLang->time( $rc_timestamp, true, true ); |
— | — | @@ -358,31 +356,31 @@ |
359 | 357 | $querycur = $curIdEq."&diff=0&oldid=$rc_this_oldid"; |
360 | 358 | $querydiff = $curIdEq."&diff=$rc_this_oldid&oldid=$rc_last_oldid$rcIdQuery"; |
361 | 359 | $aprops = ' tabindex="'.$baseRC->counter.'"'; |
362 | | - $curLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['cur'], $querycur, '' ,'', $aprops ); |
| 360 | + $curLink = Linker::makeKnownLinkObj( $rc->getTitle(), $this->message['cur'], $querycur, '' ,'', $aprops ); |
363 | 361 | if( $rc_type == RC_NEW || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) { |
364 | 362 | if( $rc_type != RC_NEW ) { |
365 | 363 | $curLink = $this->message['cur']; |
366 | 364 | } |
367 | 365 | $diffLink = $this->message['diff']; |
368 | 366 | } else { |
369 | | - $diffLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['diff'], $querydiff, '' ,'', $aprops ); |
| 367 | + $diffLink = Linker::makeKnownLinkObj( $rc->getTitle(), $this->message['diff'], $querydiff, '' ,'', $aprops ); |
370 | 368 | } |
371 | 369 | |
372 | 370 | # Make "last" link |
373 | 371 | if( $rc_last_oldid == 0 || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) { |
374 | 372 | $lastLink = $this->message['last']; |
375 | 373 | } else { |
376 | | - $lastLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['last'], |
| 374 | + $lastLink = Linker::makeKnownLinkObj( $rc->getTitle(), $this->message['last'], |
377 | 375 | $curIdEq.'&diff='.$rc_this_oldid.'&oldid='.$rc_last_oldid . $rcIdQuery ); |
378 | 376 | } |
379 | 377 | |
380 | | - $rc->userlink = $this->skin->userLink( $rc_user, $rc_user_text ); |
| 378 | + $rc->userlink = Linker::userLink( $rc_user, $rc_user_text ); |
381 | 379 | |
382 | 380 | $rc->lastlink = $lastLink; |
383 | 381 | $rc->curlink = $curLink; |
384 | 382 | $rc->difflink = $diffLink; |
385 | 383 | |
386 | | - $rc->usertalklink = $this->skin->userToolLinks( $rc_user, $rc_user_text ); |
| 384 | + $rc->usertalklink = Linker::userToolLinks( $rc_user, $rc_user_text ); |
387 | 385 | |
388 | 386 | # Put accumulated information into the cache, for later display |
389 | 387 | # Page moves go on their own line |
— | — | @@ -472,13 +470,13 @@ |
473 | 471 | if( $isnew ) { |
474 | 472 | $r .= $this->message['changes']; |
475 | 473 | } else { |
476 | | - $r .= $this->skin->makeKnownLinkObj( $block[0]->getTitle(), |
| 474 | + $r .= Linker::makeKnownLinkObj( $block[0]->getTitle(), |
477 | 475 | $this->message['changes'], $curIdEq."&diff=$currentRevision&oldid=$oldid" ); |
478 | 476 | } |
479 | 477 | $r .= '; '; |
480 | 478 | |
481 | 479 | # History |
482 | | - $r .= $this->skin->makeKnownLinkObj( $block[0]->getTitle(), |
| 480 | + $r .= Linker::makeKnownLinkObj( $block[0]->getTitle(), |
483 | 481 | $this->message['history'], $curIdEq.'&action=history' ); |
484 | 482 | $r .= ')'; |
485 | 483 | } |
— | — | @@ -509,7 +507,7 @@ |
510 | 508 | if( $rc_type == RC_LOG ) { |
511 | 509 | $link = $rcObj->timestamp; |
512 | 510 | } else { |
513 | | - $link = $this->skin->makeKnownLinkObj( $rcObj->getTitle(), $rcObj->timestamp, $curIdEq.'&'.$o ); |
| 511 | + $link = Linker::makeKnownLinkObj( $rcObj->getTitle(), $rcObj->timestamp, $curIdEq.'&'.$o ); |
514 | 512 | } |
515 | 513 | $link = '<tt>'.$link.'</tt>'; |
516 | 514 | |
— | — | @@ -520,7 +518,7 @@ |
521 | 519 | $r .= $rcObj->lastlink; |
522 | 520 | $r .= ') . . '.$rcObj->userlink; |
523 | 521 | $r .= $rcObj->usertalklink; |
524 | | - $r .= $this->skin->commentBlock( $rc_comment, $rcObj->getTitle() ); |
| 522 | + $r .= Linker::commentBlock( $rc_comment, $rcObj->getTitle() ); |
525 | 523 | $r .= "<br />\n"; |
526 | 524 | } |
527 | 525 | $r .= "</div>\n"; |
— | — | @@ -616,14 +614,14 @@ |
617 | 615 | $r .= ' ('. $rcObj->difflink .'; '; |
618 | 616 | |
619 | 617 | # Hist |
620 | | - $r .= $this->skin->makeKnownLinkObj( $rcObj->getTitle(), wfMsg( 'hist' ), $curIdEq.'&action=history' ); |
| 618 | + $r .= Linker::makeKnownLinkObj( $rcObj->getTitle(), wfMsg( 'hist' ), $curIdEq.'&action=history' ); |
621 | 619 | |
622 | 620 | # User/talk |
623 | 621 | $r .= ') . . '.$rcObj->userlink . $rcObj->usertalklink; |
624 | 622 | |
625 | 623 | # Comment |
626 | 624 | if( $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) { |
627 | | - $r .= $this->skin->commentBlock( $rc_comment, $rcObj->getTitle() ); |
| 625 | + $r .= Linker::commentBlock( $rc_comment, $rcObj->getTitle() ); |
628 | 626 | } |
629 | 627 | |
630 | 628 | if( $rcObj->numberofWatchingusers > 0 ) { |
Index: trunk/phase3/includes/SpecialUndelete.php |
— | — | @@ -482,7 +482,7 @@ |
483 | 483 | } |
484 | 484 | |
485 | 485 | /* private */ function showList() { |
486 | | - global $wgLang, $wgContLang, $wgUser, $wgOut; |
| 486 | + global $wgLang, $wgContLang, $wgOut; |
487 | 487 | |
488 | 488 | # List undeletable articles |
489 | 489 | $result = PageArchive::listAllPages(); |
— | — | @@ -494,12 +494,11 @@ |
495 | 495 | } |
496 | 496 | $wgOut->addWikiText( wfMsg( "undeletepagetext" ) ); |
497 | 497 | |
498 | | - $sk = $wgUser->getSkin(); |
499 | 498 | $undelete =& SpecialPage::getTitleFor( 'Undelete' ); |
500 | 499 | $wgOut->addHTML( "<ul>\n" ); |
501 | 500 | while( $row = $result->fetchObject() ) { |
502 | 501 | $title = Title::makeTitleSafe( $row->ar_namespace, $row->ar_title ); |
503 | | - $link = $sk->makeKnownLinkObj( $undelete, htmlspecialchars( $title->getPrefixedText() ), 'target=' . $title->getPrefixedUrl() ); |
| 502 | + $link = Linker::makeKnownLinkObj( $undelete, htmlspecialchars( $title->getPrefixedText() ), 'target=' . $title->getPrefixedUrl() ); |
504 | 503 | $revs = wfMsgHtml( 'undeleterevisions', $wgLang->formatNum( $row->count ) ); |
505 | 504 | $wgOut->addHtml( "<li>{$link} ({$revs})</li>\n" ); |
506 | 505 | } |
— | — | @@ -582,7 +581,6 @@ |
583 | 582 | /* private */ function showHistory() { |
584 | 583 | global $wgLang, $wgUser, $wgOut; |
585 | 584 | |
586 | | - $sk = $wgUser->getSkin(); |
587 | 585 | if ( $this->mAllowed ) { |
588 | 586 | $wgOut->setPagetitle( wfMsg( "undeletepage" ) ); |
589 | 587 | } else { |
— | — | @@ -671,15 +669,15 @@ |
672 | 670 | $ts = wfTimestamp( TS_MW, $row->ar_timestamp ); |
673 | 671 | if ( $this->mAllowed ) { |
674 | 672 | $checkBox = wfCheck( "ts$ts" ); |
675 | | - $pageLink = $sk->makeKnownLinkObj( $titleObj, |
| 673 | + $pageLink = Linker::makeKnownLinkObj( $titleObj, |
676 | 674 | $wgLang->timeanddate( $ts, true ), |
677 | 675 | "target=$target×tamp=$ts" ); |
678 | 676 | } else { |
679 | 677 | $checkBox = ''; |
680 | 678 | $pageLink = $wgLang->timeanddate( $ts, true ); |
681 | 679 | } |
682 | | - $userLink = $sk->userLink( $row->ar_user, $row->ar_user_text ) . $sk->userToolLinks( $row->ar_user, $row->ar_user_text ); |
683 | | - $comment = $sk->commentBlock( $row->ar_comment ); |
| 680 | + $userLink = Linker::userLink( $row->ar_user, $row->ar_user_text ) . Linker::userToolLinks( $row->ar_user, $row->ar_user_text ); |
| 681 | + $comment = Linker::commentBlock( $row->ar_comment ); |
684 | 682 | $wgOut->addHTML( "<li>$checkBox $pageLink . . $userLink $comment</li>\n" ); |
685 | 683 | |
686 | 684 | } |
— | — | @@ -699,14 +697,14 @@ |
700 | 698 | $checkBox = wfCheck( "fileid" . $row->fa_id ); |
701 | 699 | $key = urlencode( $row->fa_storage_key ); |
702 | 700 | $target = urlencode( $this->mTarget ); |
703 | | - $pageLink = $sk->makeKnownLinkObj( $titleObj, |
| 701 | + $pageLink = Linker::makeKnownLinkObj( $titleObj, |
704 | 702 | $wgLang->timeanddate( $ts, true ), |
705 | 703 | "target=$target&file=$key" ); |
706 | 704 | } else { |
707 | 705 | $checkBox = ''; |
708 | 706 | $pageLink = $wgLang->timeanddate( $ts, true ); |
709 | 707 | } |
710 | | - $userLink = $sk->userLink( $row->fa_user, $row->fa_user_text ) . $sk->userToolLinks( $row->fa_user, $row->fa_user_text ); |
| 708 | + $userLink = Linker::userLink( $row->fa_user, $row->fa_user_text ) . Linker::userToolLinks( $row->fa_user, $row->fa_user_text ); |
711 | 709 | $data = |
712 | 710 | wfMsgHtml( 'widthheight', |
713 | 711 | $wgLang->formatNum( $row->fa_width ), |
— | — | @@ -714,7 +712,7 @@ |
715 | 713 | ' (' . |
716 | 714 | wfMsgHtml( 'nbytes', $wgLang->formatNum( $row->fa_size ) ) . |
717 | 715 | ')'; |
718 | | - $comment = $sk->commentBlock( $row->fa_description ); |
| 716 | + $comment = Linker::commentBlock( $row->fa_description ); |
719 | 717 | $wgOut->addHTML( "<li>$checkBox $pageLink . . $userLink $data $comment</li>\n" ); |
720 | 718 | } |
721 | 719 | $files->free(); |
— | — | @@ -732,7 +730,7 @@ |
733 | 731 | } |
734 | 732 | |
735 | 733 | function undelete() { |
736 | | - global $wgOut, $wgUser; |
| 734 | + global $wgOut; |
737 | 735 | if( !is_null( $this->mTargetObj ) ) { |
738 | 736 | $archive = new PageArchive( $this->mTargetObj ); |
739 | 737 | $ok = true; |
— | — | @@ -743,8 +741,7 @@ |
744 | 742 | $this->mFileVersions ); |
745 | 743 | |
746 | 744 | if( $ok ) { |
747 | | - $skin =& $wgUser->getSkin(); |
748 | | - $link = $skin->makeKnownLinkObj( $this->mTargetObj ); |
| 745 | + $link = Linker::makeKnownLinkObj( $this->mTargetObj ); |
749 | 746 | $wgOut->addHtml( wfMsgWikiHtml( 'undeletedpage', $link ) ); |
750 | 747 | return true; |
751 | 748 | } |
Index: trunk/phase3/includes/CategoryPage.php |
— | — | @@ -49,8 +49,7 @@ |
50 | 50 | var $title, $limit, $from, $until, |
51 | 51 | $articles, $articles_start_char, |
52 | 52 | $children, $children_start_char, |
53 | | - $showGallery, $gallery, |
54 | | - $skin; |
| 53 | + $showGallery, $gallery; |
55 | 54 | |
56 | 55 | function __construct( $title, $from = '', $until = '' ) { |
57 | 56 | global $wgCategoryPagingLimit; |
— | — | @@ -99,21 +98,13 @@ |
100 | 99 | } |
101 | 100 | } |
102 | 101 | |
103 | | - function getSkin() { |
104 | | - if ( !$this->skin ) { |
105 | | - global $wgUser; |
106 | | - $this->skin = $wgUser->getSkin(); |
107 | | - } |
108 | | - return $this->skin; |
109 | | - } |
110 | | - |
111 | 102 | /** |
112 | 103 | * Add a subcategory to the internal lists |
113 | 104 | */ |
114 | 105 | function addSubcategory( $title, $sortkey, $pageLength ) { |
115 | 106 | global $wgContLang; |
116 | 107 | // Subcategory; strip the 'Category' namespace from the link text. |
117 | | - $this->children[] = $this->getSkin()->makeKnownLinkObj( |
| 108 | + $this->children[] = Linker::makeKnownLinkObj( |
118 | 109 | $title, $wgContLang->convertHtml( $title->getText() ) ); |
119 | 110 | |
120 | 111 | $this->children_start_char[] = $this->getSubcategorySortChar( $title, $sortkey ); |
— | — | @@ -159,7 +150,7 @@ |
160 | 151 | */ |
161 | 152 | function addPage( $title, $sortkey, $pageLength ) { |
162 | 153 | global $wgContLang; |
163 | | - $this->articles[] = $this->getSkin()->makeSizeLinkObj( |
| 154 | + $this->articles[] = Linker::makeSizeLinkObj( |
164 | 155 | $pageLength, $title, $wgContLang->convert( $title->getPrefixedText() ) |
165 | 156 | ); |
166 | 157 | $this->articles_start_char[] = $wgContLang->convert( $wgContLang->firstChar( $sortkey ) ); |
— | — | @@ -388,17 +379,16 @@ |
389 | 380 | */ |
390 | 381 | function pagingLinks( $title, $first, $last, $limit, $query = array() ) { |
391 | 382 | global $wgUser, $wgLang; |
392 | | - $sk =& $this->getSkin(); |
393 | 383 | $limitText = $wgLang->formatNum( $limit ); |
394 | 384 | |
395 | 385 | $prevLink = htmlspecialchars( wfMsg( 'prevn', $limitText ) ); |
396 | 386 | if( $first != '' ) { |
397 | | - $prevLink = $sk->makeLinkObj( $title, $prevLink, |
| 387 | + $prevLink = Linker::makeLinkObj( $title, $prevLink, |
398 | 388 | wfArrayToCGI( $query + array( 'until' => $first ) ) ); |
399 | 389 | } |
400 | 390 | $nextLink = htmlspecialchars( wfMsg( 'nextn', $limitText ) ); |
401 | 391 | if( $last != '' ) { |
402 | | - $nextLink = $sk->makeLinkObj( $title, $nextLink, |
| 392 | + $nextLink = Linker::makeLinkObj( $title, $nextLink, |
403 | 393 | wfArrayToCGI( $query + array( 'from' => $last ) ) ); |
404 | 394 | } |
405 | 395 | |
Index: trunk/phase3/includes/SpecialNewpages.php |
— | — | @@ -84,21 +84,20 @@ |
85 | 85 | /** |
86 | 86 | * Format a row, providing the timestamp, links to the page/history, size, user links, and a comment |
87 | 87 | * |
88 | | - * @param $skin Skin to use |
89 | 88 | * @param $result Result row |
90 | 89 | * @return string |
91 | 90 | */ |
92 | | - function formatResult( $skin, $result ) { |
| 91 | + function formatResult( $result ) { |
93 | 92 | global $wgLang, $wgContLang; |
94 | 93 | $dm = $wgContLang->getDirMark(); |
95 | 94 | |
96 | 95 | $title = Title::makeTitleSafe( $result->namespace, $result->title ); |
97 | 96 | $time = $wgLang->timeAndDate( $result->timestamp, true ); |
98 | | - $plink = $skin->makeKnownLinkObj( $title, '', $this->patrollable( $result ) ? 'rcid=' . $result->rcid : '' ); |
99 | | - $hist = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' ); |
| 97 | + $plink = Linker::makeKnownLinkObj( $title, '', $this->patrollable( $result ) ? 'rcid=' . $result->rcid : '' ); |
| 98 | + $hist = Linker::makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' ); |
100 | 99 | $length = wfMsgHtml( 'nbytes', $wgLang->formatNum( htmlspecialchars( $result->length ) ) ); |
101 | | - $ulink = $skin->userLink( $result->user, $result->user_text ) . $skin->userToolLinks( $result->user, $result->user_text ); |
102 | | - $comment = $skin->commentBlock( $result->comment ); |
| 100 | + $ulink = Linker::userLink( $result->user, $result->user_text ) . Linker::userToolLinks( $result->user, $result->user_text ); |
| 101 | + $comment = Linker::commentBlock( $result->comment ); |
103 | 102 | |
104 | 103 | return "{$time} {$dm}{$plink} ({$hist}) {$dm}[{$length}] {$dm}{$ulink} {$comment}"; |
105 | 104 | } |
Index: trunk/phase3/includes/AjaxFunctions.php |
— | — | @@ -71,8 +71,6 @@ |
72 | 72 | function wfSajaxSearch( $term ) { |
73 | 73 | global $wgContLang, $wgOut; |
74 | 74 | $limit = 16; |
75 | | - |
76 | | - $l = new Linker; |
77 | 75 | |
78 | 76 | $term = str_replace( ' ', '_', $wgContLang->ucfirst( |
79 | 77 | $wgContLang->checkTitleEncoding( $wgContLang->recodeInput( js_unescape( $term ) ) ) |
— | — | @@ -94,10 +92,10 @@ |
95 | 93 | $i=0; |
96 | 94 | while ( ( $row = $db->fetchObject( $res ) ) && ( ++$i <= $limit ) ) { |
97 | 95 | $nt = Title::newFromDBkey( $row->page_title ); |
98 | | - $r .= '<li>' . $l->makeKnownLinkObj( $nt ) . "</li>\n"; |
| 96 | + $r .= '<li>' . Linker::makeKnownLinkObj( $nt ) . "</li>\n"; |
99 | 97 | } |
100 | 98 | if ( $i > $limit ) { |
101 | | - $more = '<i>' . $l->makeKnownLink( $wgContLang->specialPage( "Allpages" ), |
| 99 | + $more = '<i>' . Linker::makeKnownLink( $wgContLang->specialPage( "Allpages" ), |
102 | 100 | wfMsg('moredotdotdot'), |
103 | 101 | "namespace=0&from=" . wfUrlEncode ( $term ) ) . |
104 | 102 | '</i>'; |
— | — | @@ -113,10 +111,10 @@ |
114 | 112 | . wfMsg( 'hideresults' ) . '</a></div>' |
115 | 113 | . '<h1 class="firstHeading">'.wfMsg('search') |
116 | 114 | . '</h1><div id="contentSub">'. $subtitle . '</div><ul><li>' |
117 | | - . $l->makeKnownLink( $wgContLang->specialPage( 'Search' ), |
| 115 | + . Linker::makeKnownLink( $wgContLang->specialPage( 'Search' ), |
118 | 116 | wfMsg( 'searchcontaining', $term ), |
119 | 117 | "search=$term&fulltext=Search" ) |
120 | | - . '</li><li>' . $l->makeKnownLink( $wgContLang->specialPage( 'Search' ), |
| 118 | + . '</li><li>' . Linker::makeKnownLink( $wgContLang->specialPage( 'Search' ), |
121 | 119 | wfMsg( 'searchnamed', $term ) , |
122 | 120 | "search=$term&go=Go" ) |
123 | 121 | . "</li></ul><h2>" . wfMsg( 'articletitles', $term ) . "</h2>" |
Index: trunk/phase3/includes/User.php |
— | — | @@ -2388,9 +2388,7 @@ |
2389 | 2389 | } |
2390 | 2390 | $title = self::getGroupPage( $group ); |
2391 | 2391 | if( $title ) { |
2392 | | - global $wgUser; |
2393 | | - $sk = $wgUser->getSkin(); |
2394 | | - return $sk->makeLinkObj( $title, $text ); |
| 2392 | + return Linker::makeLinkObj( $title, $text ); |
2395 | 2393 | } else { |
2396 | 2394 | return $text; |
2397 | 2395 | } |
Index: trunk/phase3/includes/SpecialDisambiguations.php |
— | — | @@ -23,11 +23,8 @@ |
24 | 24 | return Title::makeTitleSafe( NS_MEDIAWIKI, 'disambiguationspage'); |
25 | 25 | } |
26 | 26 | |
27 | | - function getPageHeader( ) { |
28 | | - global $wgUser; |
29 | | - $sk = $wgUser->getSkin(); |
30 | | - |
31 | | - return '<p>'.wfMsg('disambiguationstext', $sk->makeKnownLinkObj($this->getDisambiguationPageObj()))."</p><br />\n"; |
| 27 | + function getPageHeader() { |
| 28 | + return '<p>'.wfMsg('disambiguationstext', Linker::makeKnownLinkObj($this->getDisambiguationPageObj()))."</p><br />\n"; |
32 | 29 | } |
33 | 30 | |
34 | 31 | function getSQL() { |
— | — | @@ -88,15 +85,15 @@ |
89 | 86 | return ''; |
90 | 87 | } |
91 | 88 | |
92 | | - function formatResult( $skin, $result ) { |
| 89 | + function formatResult( $result ) { |
93 | 90 | global $wgContLang; |
94 | 91 | $title = Title::newFromId( $result->value ); |
95 | 92 | $dp = Title::makeTitle( $result->namespace, $result->title ); |
96 | 93 | |
97 | | - $from = $skin->makeKnownLinkObj( $title,''); |
98 | | - $edit = $skin->makeBrokenLinkObj( $title, "(".wfMsg("qbedit").")" , 'redirect=no'); |
| 94 | + $from = Linker::makeKnownLinkObj( $title,''); |
| 95 | + $edit = Linker::makeBrokenLinkObj( $title, "(".wfMsg("qbedit").")" , 'redirect=no'); |
99 | 96 | $arr = $wgContLang->getArrow(); |
100 | | - $to = $skin->makeKnownLinkObj( $dp,''); |
| 97 | + $to = Linker::makeKnownLinkObj( $dp,''); |
101 | 98 | |
102 | 99 | return "$from $edit $arr $to"; |
103 | 100 | } |
Index: trunk/phase3/includes/SpecialMostrevisions.php |
— | — | @@ -38,17 +38,17 @@ |
39 | 39 | "; |
40 | 40 | } |
41 | 41 | |
42 | | - function formatResult( $skin, $result ) { |
| 42 | + function formatResult( $result ) { |
43 | 43 | global $wgLang, $wgContLang; |
44 | 44 | |
45 | 45 | $nt = Title::makeTitle( $result->namespace, $result->title ); |
46 | 46 | $text = $wgContLang->convert( $nt->getPrefixedText() ); |
47 | 47 | |
48 | | - $plink = $skin->makeKnownLinkObj( $nt, $text ); |
| 48 | + $plink = Linker::makeKnownLinkObj( $nt, $text ); |
49 | 49 | |
50 | 50 | $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape'), |
51 | 51 | $wgLang->formatNum( $result->value ) ); |
52 | | - $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' ); |
| 52 | + $nlink = Linker::makeKnownLinkObj( $nt, $nl, 'action=history' ); |
53 | 53 | |
54 | 54 | return wfSpecialList($plink, $nlink); |
55 | 55 | } |
Index: trunk/phase3/includes/SpecialCategories.php |
— | — | @@ -44,10 +44,10 @@ |
45 | 45 | return false; |
46 | 46 | } |
47 | 47 | |
48 | | - function formatResult( $skin, $result ) { |
| 48 | + function formatResult( $result ) { |
49 | 49 | global $wgLang; |
50 | 50 | $title = Title::makeTitle( NS_CATEGORY, $result->title ); |
51 | | - $plink = $skin->makeLinkObj( $title, $title->getText() ); |
| 51 | + $plink = Linker::makeLinkObj( $title, $title->getText() ); |
52 | 52 | $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'), |
53 | 53 | $wgLang->formatNum( $result->count ) ); |
54 | 54 | return wfSpecialList($plink, $nlinks); |
Index: trunk/phase3/includes/SpecialStatistics.php |
— | — | @@ -82,17 +82,16 @@ |
83 | 83 | |
84 | 84 | $wgOut->addWikiText( $text ); |
85 | 85 | |
86 | | - global $wgDisableCounters, $wgMiserMode, $wgUser, $wgLang, $wgContLang; |
| 86 | + global $wgDisableCounters, $wgMiserMode, $wgLang, $wgContLang; |
87 | 87 | if( !$wgDisableCounters && !$wgMiserMode ) { |
88 | 88 | $sql = "SELECT page_namespace, page_title, page_counter FROM {$page} WHERE page_is_redirect = 0 AND page_counter > 0 ORDER BY page_counter DESC"; |
89 | 89 | $sql = $dbr->limitResult($sql, 10, 0); |
90 | 90 | $res = $dbr->query( $sql, $fname ); |
91 | 91 | if( $res ) { |
92 | 92 | $wgOut->addHtml( '<h2>' . wfMsgHtml( 'statistics-mostpopular' ) . '</h2>' ); |
93 | | - $skin =& $wgUser->getSkin(); |
94 | 93 | $wgOut->addHtml( '<ol>' ); |
95 | 94 | while( $row = $dbr->fetchObject( $res ) ) { |
96 | | - $link = $skin->makeKnownLinkObj( Title::makeTitleSafe( $row->page_namespace, $row->page_title ) ); |
| 95 | + $link = Linker::makeKnownLinkObj( Title::makeTitleSafe( $row->page_namespace, $row->page_title ) ); |
97 | 96 | $dirmark = $wgContLang->getDirMark(); |
98 | 97 | $wgOut->addHtml( '<li>' . $link . $dirmark . ' [' . $wgLang->formatNum( $row->page_counter ) . ']</li>' ); |
99 | 98 | } |
Index: trunk/phase3/includes/SpecialSpecialpages.php |
— | — | @@ -9,25 +9,23 @@ |
10 | 10 | * |
11 | 11 | */ |
12 | 12 | function wfSpecialSpecialpages() { |
13 | | - global $wgOut, $wgUser; |
| 13 | + global $wgOut; |
14 | 14 | |
15 | 15 | $wgOut->setRobotpolicy( 'index,nofollow' ); |
16 | | - $sk = $wgUser->getSkin(); |
17 | 16 | |
18 | 17 | /** Pages available to all */ |
19 | | - wfSpecialSpecialpages_gen( SpecialPage::getRegularPages(), 'spheading', $sk ); |
| 18 | + wfSpecialSpecialpages_gen( SpecialPage::getRegularPages(), 'spheading' ); |
20 | 19 | |
21 | 20 | /** Restricted special pages */ |
22 | | - wfSpecialSpecialpages_gen( SpecialPage::getRestrictedPages(), 'restrictedpheading', $sk ); |
| 21 | + wfSpecialSpecialpages_gen( SpecialPage::getRestrictedPages(), 'restrictedpheading' ); |
23 | 22 | } |
24 | 23 | |
25 | 24 | /** |
26 | 25 | * sub function generating the list of pages |
27 | 26 | * @param $pages the list of pages |
28 | 27 | * @param $heading header to be used |
29 | | - * @param $sk skin object ??? |
30 | 28 | */ |
31 | | -function wfSpecialSpecialpages_gen($pages,$heading,$sk) { |
| 29 | +function wfSpecialSpecialpages_gen( $pages, $heading ) { |
32 | 30 | global $wgOut, $wgSortSpecialPages; |
33 | 31 | |
34 | 32 | if( count( $pages ) == 0 ) { |
— | — | @@ -51,7 +49,7 @@ |
52 | 50 | /** Now output the HTML */ |
53 | 51 | $wgOut->addHTML( '<h2>' . wfMsgHtml( $heading ) . "</h2>\n<ul>" ); |
54 | 52 | foreach ( $sortedPages as $desc => $title ) { |
55 | | - $link = $sk->makeKnownLinkObj( $title, $desc ); |
| 53 | + $link = Linker::makeKnownLinkObj( $title, $desc ); |
56 | 54 | $wgOut->addHTML( "<li>{$link}</li>\n" ); |
57 | 55 | } |
58 | 56 | $wgOut->addHTML( "</ul>\n" ); |
Index: trunk/phase3/includes/SpecialUnwatchedpages.php |
— | — | @@ -39,14 +39,14 @@ |
40 | 40 | |
41 | 41 | function sortDescending() { return false; } |
42 | 42 | |
43 | | - function formatResult( $skin, $result ) { |
| 43 | + function formatResult( $result ) { |
44 | 44 | global $wgContLang; |
45 | 45 | |
46 | 46 | $nt = Title::makeTitle( $result->namespace, $result->title ); |
47 | 47 | $text = $wgContLang->convert( $nt->getPrefixedText() ); |
48 | 48 | |
49 | | - $plink = $skin->makeKnownLinkObj( $nt, htmlspecialchars( $text ) ); |
50 | | - $wlink = $skin->makeKnownLinkObj( $nt, wfMsgHtml( 'watch' ), 'action=watch' ); |
| 49 | + $plink = Linker::makeKnownLinkObj( $nt, htmlspecialchars( $text ) ); |
| 50 | + $wlink = Linker::makeKnownLinkObj( $nt, wfMsgHtml( 'watch' ), 'action=watch' ); |
51 | 51 | |
52 | 52 | return wfSpecialList( $plink, $wlink ); |
53 | 53 | } |
Index: trunk/phase3/includes/SpecialUserlogin.php |
— | — | @@ -177,7 +177,6 @@ |
178 | 178 | } else { |
179 | 179 | # Confirm that the account was created |
180 | 180 | global $wgOut; |
181 | | - $skin = $wgUser->getSkin(); |
182 | 181 | $self = SpecialPage::getTitleFor( 'Userlogin' ); |
183 | 182 | $wgOut->setPageTitle( wfMsgHtml( 'accountcreated' ) ); |
184 | 183 | $wgOut->setArticleRelated( false ); |
— | — | @@ -727,15 +726,13 @@ |
728 | 727 | * @param $lang Language code |
729 | 728 | */ |
730 | 729 | function makeLanguageSelectorLink( $text, $lang ) { |
731 | | - global $wgUser; |
732 | 730 | $self = SpecialPage::getTitleFor( 'Userlogin' ); |
733 | 731 | $attr[] = 'uselang=' . $lang; |
734 | 732 | if( $this->mType == 'signup' ) |
735 | 733 | $attr[] = 'type=signup'; |
736 | 734 | if( $this->mReturnTo ) |
737 | 735 | $attr[] = 'returnto=' . $this->mReturnTo; |
738 | | - $skin =& $wgUser->getSkin(); |
739 | | - return $skin->makeKnownLinkObj( $self, htmlspecialchars( $text ), implode( '&', $attr ) ); |
| 736 | + return Linker::makeKnownLinkObj( $self, htmlspecialchars( $text ), implode( '&', $attr ) ); |
740 | 737 | } |
741 | 738 | |
742 | 739 | } |
Index: trunk/phase3/includes/SpecialWhatlinkshere.php |
— | — | @@ -18,12 +18,10 @@ |
19 | 19 | class WhatLinksHerePage { |
20 | 20 | var $request, $par; |
21 | 21 | var $limit, $from, $dir, $target; |
22 | | - var $selfTitle, $skin; |
| 22 | + var $selfTitle; |
23 | 23 | |
24 | 24 | function WhatLinksHerePage( &$request, $par = null ) { |
25 | | - global $wgUser; |
26 | 25 | $this->request =& $request; |
27 | | - $this->skin =& $wgUser->getSkin(); |
28 | 26 | $this->par = $par; |
29 | 27 | } |
30 | 28 | |
— | — | @@ -59,7 +57,7 @@ |
60 | 58 | |
61 | 59 | $isredir = ' (' . wfMsg( 'isredirect' ) . ")\n"; |
62 | 60 | |
63 | | - $wgOut->addHTML( wfMsg( 'whatlinkshere-barrow' ) . ' ' .$this->skin->makeLinkObj($this->target, '', 'redirect=no' )."<br />\n"); |
| 61 | + $wgOut->addHTML( wfMsg( 'whatlinkshere-barrow' ) .' '.Linker::makeLinkObj($this->target, '', 'redirect=no' )."<br />\n"); |
64 | 62 | |
65 | 63 | $this->showIndirectLinks( 0, $this->target, $this->limit, $this->from, $this->dir ); |
66 | 64 | } |
— | — | @@ -207,7 +205,7 @@ |
208 | 206 | $extra = ''; |
209 | 207 | } |
210 | 208 | |
211 | | - $link = $this->skin->makeKnownLinkObj( $nt, '', $extra ); |
| 209 | + $link = Linker::makeKnownLinkObj( $nt, '', $extra ); |
212 | 210 | $wgOut->addHTML( '<li>'.$link ); |
213 | 211 | |
214 | 212 | // Display properties (redirect or template) |
— | — | @@ -238,7 +236,7 @@ |
239 | 237 | } |
240 | 238 | |
241 | 239 | function makeSelfLink( $text, $query ) { |
242 | | - return $this->skin->makeKnownLinkObj( $this->selfTitle, $text, $query ); |
| 240 | + return Linker::makeKnownLinkObj( $this->selfTitle, $text, $query ); |
243 | 241 | } |
244 | 242 | |
245 | 243 | function getPrevNext( $limit, $prevId, $nextId ) { |
Index: trunk/phase3/includes/SpecialRecentchanges.php |
— | — | @@ -222,7 +222,6 @@ |
223 | 223 | } |
224 | 224 | |
225 | 225 | // And now for the content |
226 | | - $sk = $wgUser->getSkin(); |
227 | 226 | $wgOut->setSyndicated( true ); |
228 | 227 | |
229 | 228 | $list = ChangesList::newFromUser( $wgUser ); |
— | — | @@ -421,9 +420,8 @@ |
422 | 421 | * |
423 | 422 | */ |
424 | 423 | function rcCountLink( $lim, $d, $page='Recentchanges', $more='' ) { |
425 | | - global $wgUser, $wgLang, $wgContLang; |
426 | | - $sk = $wgUser->getSkin(); |
427 | | - $s = $sk->makeKnownLink( $wgContLang->specialPage( $page ), |
| 424 | + global $wgLang, $wgContLang; |
| 425 | + $s = Linker::makeKnownLink( $wgContLang->specialPage( $page ), |
428 | 426 | ($lim ? $wgLang->formatNum( "{$lim}" ) : wfMsg( 'recentchangesall' ) ), "{$more}" . |
429 | 427 | ($d ? "days={$d}&" : '') . 'limit='.$lim ); |
430 | 428 | return $s; |
— | — | @@ -433,9 +431,8 @@ |
434 | 432 | * |
435 | 433 | */ |
436 | 434 | function rcDaysLink( $lim, $d, $page='Recentchanges', $more='' ) { |
437 | | - global $wgUser, $wgLang, $wgContLang; |
438 | | - $sk = $wgUser->getSkin(); |
439 | | - $s = $sk->makeKnownLink( $wgContLang->specialPage( $page ), |
| 435 | + global $wgLang, $wgContLang; |
| 436 | + $s = Linker::makeKnownLink( $wgContLang->specialPage( $page ), |
440 | 437 | ($d ? $wgLang->formatNum( "{$d}" ) : wfMsg( 'recentchangesall' ) ), $more.'days='.$d . |
441 | 438 | ($lim ? '&limit='.$lim : '') ); |
442 | 439 | return $s; |
— | — | @@ -478,9 +475,8 @@ |
479 | 476 | * @param $options |
480 | 477 | */ |
481 | 478 | function makeOptionsLink( $title, $override, $options ) { |
482 | | - global $wgUser, $wgContLang; |
483 | | - $sk = $wgUser->getSkin(); |
484 | | - return $sk->makeKnownLink( $wgContLang->specialPage( 'Recentchanges' ), |
| 479 | + global $wgContLang; |
| 480 | + return Linker::makeKnownLink( $wgContLang->specialPage( 'Recentchanges' ), |
485 | 481 | htmlspecialchars( $title ), wfArrayToCGI( $override, $options ) ); |
486 | 482 | } |
487 | 483 | |
— | — | @@ -621,12 +617,11 @@ |
622 | 618 | } |
623 | 619 | |
624 | 620 | function rcFormatDiffRow( $title, $oldid, $newid, $timestamp, $comment ) { |
625 | | - global $wgFeedDiffCutoff, $wgContLang, $wgUser; |
| 621 | + global $wgFeedDiffCutoff, $wgContLang; |
626 | 622 | $fname = 'rcFormatDiff'; |
627 | 623 | wfProfileIn( $fname ); |
628 | 624 | |
629 | | - $skin = $wgUser->getSkin(); |
630 | | - $completeText = '<p>' . $skin->formatComment( $comment ) . "</p>\n"; |
| 625 | + $completeText = '<p>' . Linker::formatComment( $comment ) . "</p>\n"; |
631 | 626 | |
632 | 627 | if( $title->getNamespace() >= 0 ) { |
633 | 628 | if( $oldid ) { |
Index: trunk/phase3/includes/Linker.php |
— | — | @@ -16,18 +16,20 @@ |
17 | 17 | * @package MediaWiki |
18 | 18 | */ |
19 | 19 | class Linker { |
20 | | - |
21 | 20 | function Linker() {} |
22 | 21 | |
23 | 22 | /** |
24 | 23 | * @deprecated |
25 | 24 | */ |
26 | | - function postParseLinkColour( $s = NULL ) { |
| 25 | + private static function postParseLinkColour( $s = NULL ) { |
27 | 26 | return NULL; |
28 | 27 | } |
29 | 28 | |
30 | | - /** @todo document */ |
31 | | - function getExternalLinkAttributes( $link, $text, $class='' ) { |
| 29 | + /** |
| 30 | + * @todo document |
| 31 | + * @static |
| 32 | + */ |
| 33 | + protected static function getExternalLinkAttributes( $link, $text, $class='' ) { |
32 | 34 | $link = htmlspecialchars( $link ); |
33 | 35 | |
34 | 36 | $r = ($class != '') ? " class=\"$class\"" : " class=\"external\""; |
— | — | @@ -36,7 +38,11 @@ |
37 | 39 | return $r; |
38 | 40 | } |
39 | 41 | |
40 | | - function getInterwikiLinkAttributes( $link, $text, $class='' ) { |
| 42 | + /** |
| 43 | + * @todo document |
| 44 | + * @static |
| 45 | + */ |
| 46 | + protected static function getInterwikiLinkAttributes( $link, $text, $class='' ) { |
41 | 47 | global $wgContLang; |
42 | 48 | |
43 | 49 | $same = ($link == $text); |
— | — | @@ -51,8 +57,12 @@ |
52 | 58 | return $r; |
53 | 59 | } |
54 | 60 | |
55 | | - /** @todo document */ |
56 | | - function getInternalLinkAttributes( $link, $text, $broken = false ) { |
| 61 | + /** |
| 62 | + * Unfortunately cannot be protected because it is needed by ImagePage.php. |
| 63 | + * @todo document |
| 64 | + * @static |
| 65 | + */ |
| 66 | + static function getInternalLinkAttributes( $link, $text, $broken = false ) { |
57 | 67 | $link = urldecode( $link ); |
58 | 68 | $link = str_replace( '_', ' ', $link ); |
59 | 69 | $link = htmlspecialchars( $link ); |
— | — | @@ -70,11 +80,13 @@ |
71 | 81 | } |
72 | 82 | |
73 | 83 | /** |
74 | | - * @param $nt Title object. |
75 | | - * @param $text String: FIXME |
76 | | - * @param $broken Boolean: FIXME, default 'false'. |
| 84 | + * @param $nt Title object |
| 85 | + * @param $text String FIXME |
| 86 | + * @param $broken String FIXME, default false |
| 87 | + * |
| 88 | + * @static |
77 | 89 | */ |
78 | | - function getInternalLinkAttributesObj( &$nt, $text, $broken = false ) { |
| 90 | + protected static function getInternalLinkAttributesObj( &$nt, $text, $broken = false ) { |
79 | 91 | if( $broken == 'stub' ) { |
80 | 92 | $r = ' class="stub"'; |
81 | 93 | } else if ( $broken == 'yes' ) { |
— | — | @@ -90,22 +102,24 @@ |
91 | 103 | /** |
92 | 104 | * This function is a shortcut to makeLinkObj(Title::newFromText($title),...). Do not call |
93 | 105 | * it if you already have a title object handy. See makeLinkObj for further documentation. |
94 | | - * |
95 | | - * @param $title String: the text of the title |
96 | | - * @param $text String: link text |
97 | | - * @param $query String: optional query part |
98 | | - * @param $trail String: optional trail. Alphabetic characters at the start of this string will |
| 106 | + * |
| 107 | + * @param $title String the text of the title |
| 108 | + * @param $text String link text |
| 109 | + * @param $query String optional query part |
| 110 | + * @param $trail String optional trail. Alphabetic characters at the start of this string will |
99 | 111 | * be included in the link text. Other characters will be appended after |
100 | 112 | * the end of the link. |
| 113 | + * |
| 114 | + * @static |
101 | 115 | */ |
102 | | - function makeLink( $title, $text = '', $query = '', $trail = '' ) { |
| 116 | + public static function makeLink( $title, $text = '', $query = '', $trail = '' ) { |
103 | 117 | wfProfileIn( 'Linker::makeLink' ); |
104 | 118 | $nt = Title::newFromText( $title ); |
105 | 119 | if ($nt) { |
106 | | - $result = $this->makeLinkObj( Title::newFromText( $title ), $text, $query, $trail ); |
| 120 | + $result = self::makeLinkObj( $nt, $text, $query, $trail ); |
107 | 121 | } else { |
108 | | - wfDebug( 'Invalid title passed to Linker::makeLink(): "'.$title."\"\n" ); |
109 | | - $result = $text == "" ? $title : $text; |
| 122 | + wfDebug( "Invalid title passed to Linker::makeLink(): \"$title\"\n" ); |
| 123 | + $result = $text == '' ? $title : $text; |
110 | 124 | } |
111 | 125 | |
112 | 126 | wfProfileOut( 'Linker::makeLink' ); |
— | — | @@ -116,19 +130,21 @@ |
117 | 131 | * This function is a shortcut to makeKnownLinkObj(Title::newFromText($title),...). Do not call |
118 | 132 | * it if you already have a title object handy. See makeKnownLinkObj for further documentation. |
119 | 133 | * |
120 | | - * @param $title String: the text of the title |
121 | | - * @param $text String: link text |
122 | | - * @param $query String: optional query part |
123 | | - * @param $trail String: optional trail. Alphabetic characters at the start of this string will |
| 134 | + * @param $title String the text of the title |
| 135 | + * @param $text String link text |
| 136 | + * @param $query String optional query part |
| 137 | + * @param $trail String optional trail. Alphabetic characters at the start of this string will |
124 | 138 | * be included in the link text. Other characters will be appended after |
125 | 139 | * the end of the link. |
| 140 | + * |
| 141 | + * @static |
126 | 142 | */ |
127 | | - function makeKnownLink( $title, $text = '', $query = '', $trail = '', $prefix = '',$aprops = '') { |
| 143 | + public static function makeKnownLink( $title, $text = '', $query = '', $trail = '', $prefix = '',$aprops = '') { |
128 | 144 | $nt = Title::newFromText( $title ); |
129 | 145 | if ($nt) { |
130 | | - return $this->makeKnownLinkObj( Title::newFromText( $title ), $text, $query, $trail, $prefix , $aprops ); |
| 146 | + return self::makeKnownLinkObj( Title::newFromText( $title ), $text, $query, $trail, $prefix, $aprops ); |
131 | 147 | } else { |
132 | | - wfDebug( 'Invalid title passed to Linker::makeKnownLink(): "'.$title."\"\n" ); |
| 148 | + wfDebug( "Invalid title passed to Linker::makeKnownLink(): \"$title\"\n" ); |
133 | 149 | return $text == '' ? $title : $text; |
134 | 150 | } |
135 | 151 | } |
— | — | @@ -137,19 +153,21 @@ |
138 | 154 | * This function is a shortcut to makeBrokenLinkObj(Title::newFromText($title),...). Do not call |
139 | 155 | * it if you already have a title object handy. See makeBrokenLinkObj for further documentation. |
140 | 156 | * |
141 | | - * @param string $title The text of the title |
142 | | - * @param string $text Link text |
143 | | - * @param string $query Optional query part |
144 | | - * @param string $trail Optional trail. Alphabetic characters at the start of this string will |
| 157 | + * @param $title String The text of the title |
| 158 | + * @param $text String Link text |
| 159 | + * @param $query String Optional query part |
| 160 | + * @param $trail String Optional trail. Alphabetic characters at the start of this string will |
145 | 161 | * be included in the link text. Other characters will be appended after |
146 | 162 | * the end of the link. |
| 163 | + * |
| 164 | + * @static |
147 | 165 | */ |
148 | | - function makeBrokenLink( $title, $text = '', $query = '', $trail = '' ) { |
| 166 | + public static function makeBrokenLink( $title, $text = '', $query = '', $trail = '' ) { |
149 | 167 | $nt = Title::newFromText( $title ); |
150 | 168 | if ($nt) { |
151 | | - return $this->makeBrokenLinkObj( Title::newFromText( $title ), $text, $query, $trail ); |
| 169 | + return self::makeBrokenLinkObj( Title::newFromText( $title ), $text, $query, $trail ); |
152 | 170 | } else { |
153 | | - wfDebug( 'Invalid title passed to Linker::makeBrokenLink(): "'.$title."\"\n" ); |
| 171 | + wfDebug( "Invalid title passed to Linker::makeBrokenLink(): \"$title\"\n" ); |
154 | 172 | return $text == '' ? $title : $text; |
155 | 173 | } |
156 | 174 | } |
— | — | @@ -158,19 +176,21 @@ |
159 | 177 | * This function is a shortcut to makeStubLinkObj(Title::newFromText($title),...). Do not call |
160 | 178 | * it if you already have a title object handy. See makeStubLinkObj for further documentation. |
161 | 179 | * |
162 | | - * @param $title String: the text of the title |
163 | | - * @param $text String: link text |
164 | | - * @param $query String: optional query part |
165 | | - * @param $trail String: optional trail. Alphabetic characters at the start of this string will |
| 180 | + * @param $title String the text of the title |
| 181 | + * @param $text String link text |
| 182 | + * @param $query String optional query part |
| 183 | + * @param $trail String optional trail. Alphabetic characters at the start of this string will |
166 | 184 | * be included in the link text. Other characters will be appended after |
167 | 185 | * the end of the link. |
| 186 | + * |
| 187 | + * @static |
168 | 188 | */ |
169 | | - function makeStubLink( $title, $text = '', $query = '', $trail = '' ) { |
| 189 | + public static function makeStubLink( $title, $text = '', $query = '', $trail = '' ) { |
170 | 190 | $nt = Title::newFromText( $title ); |
171 | 191 | if ($nt) { |
172 | | - return $this->makeStubLinkObj( Title::newFromText( $title ), $text, $query, $trail ); |
| 192 | + return self::makeStubLinkObj( Title::newFromText( $title ), $text, $query, $trail ); |
173 | 193 | } else { |
174 | | - wfDebug( 'Invalid title passed to Linker::makeStubLink(): "'.$title."\"\n" ); |
| 194 | + wfDebug( "Invalid title passed to Linker::makeStubLink(): \"$title\"\n" ); |
175 | 195 | return $text == '' ? $title : $text; |
176 | 196 | } |
177 | 197 | } |
— | — | @@ -180,22 +200,22 @@ |
181 | 201 | * call this lots of times, pre-fill the link cache with a LinkBatch, otherwise each |
182 | 202 | * call to this will result in a DB query. |
183 | 203 | * |
184 | | - * @param $nt Title: the title object to make the link from, e.g. from |
185 | | - * Title::newFromText. |
186 | | - * @param $text String: link text |
187 | | - * @param $query String: optional query part |
188 | | - * @param $trail String: optional trail. Alphabetic characters at the start of this string will |
189 | | - * be included in the link text. Other characters will be appended after |
190 | | - * the end of the link. |
191 | | - * @param $prefix String: optional prefix. As trail, only before instead of after. |
| 204 | + * @param $nt Title the title object to make the link from, e.g. from Title::newFromText |
| 205 | + * @param $text String link text |
| 206 | + * @param $query String optional query part |
| 207 | + * @param $trail String optional trail. Alphabetic characters at the start of this string will |
| 208 | + * be included in the link text. Other characters will be appended after |
| 209 | + * the end of the link. |
| 210 | + * @param $prefix String optional prefix. As trail, only before instead of after. |
| 211 | + * @static |
192 | 212 | */ |
193 | | - function makeLinkObj( $nt, $text= '', $query = '', $trail = '', $prefix = '' ) { |
| 213 | + public static function makeLinkObj( $nt, $text= '', $query = '', $trail = '', $prefix = '' ) { |
194 | 214 | global $wgUser; |
195 | 215 | $fname = 'Linker::makeLinkObj'; |
196 | 216 | wfProfileIn( $fname ); |
197 | 217 | |
198 | 218 | # Fail gracefully |
199 | | - if ( ! is_object($nt) ) { |
| 219 | + if ( !is_object($nt) ) { |
200 | 220 | # throw new MWException(); |
201 | 221 | wfProfileOut( $fname ); |
202 | 222 | return "<!-- ERROR -->{$prefix}{$text}{$trail}"; |
— | — | @@ -207,7 +227,7 @@ |
208 | 228 | $u = $nt->getFullURL(); |
209 | 229 | $link = $nt->getPrefixedURL(); |
210 | 230 | if ( '' == $text ) { $text = $nt->getPrefixedText(); } |
211 | | - $style = $this->getInterwikiLinkAttributes( $link, $text, 'extiw' ); |
| 231 | + $style = self::getInterwikiLinkAttributes( $link, $text, 'extiw' ); |
212 | 232 | |
213 | 233 | $inside = ''; |
214 | 234 | if ( '' != $trail ) { |
— | — | @@ -218,7 +238,6 @@ |
219 | 239 | } |
220 | 240 | |
221 | 241 | # Check for anchors, normalize the anchor |
222 | | - |
223 | 242 | $parts = explode( '#', $u, 2 ); |
224 | 243 | if ( count( $parts ) == 2 ) { |
225 | 244 | $anchor = urlencode( Sanitizer::decodeCharReferences( str_replace(' ', '_', $parts[1] ) ) ); |
— | — | @@ -238,13 +257,13 @@ |
239 | 258 | return $t; |
240 | 259 | } elseif ( $nt->isAlwaysKnown() ) { |
241 | 260 | # Image links, special page links and self-links with fragements are always known. |
242 | | - $retVal = $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix ); |
| 261 | + $retVal = self::makeKnownLinkObj( $nt, $text, $query, $trail, $prefix ); |
243 | 262 | } else { |
244 | 263 | wfProfileIn( $fname.'-immediate' ); |
245 | 264 | # Work out link colour immediately |
246 | 265 | $aid = $nt->getArticleID() ; |
247 | 266 | if ( 0 == $aid ) { |
248 | | - $retVal = $this->makeBrokenLinkObj( $nt, $text, $query, $trail, $prefix ); |
| 267 | + $retVal = self::makeBrokenLinkObj( $nt, $text, $query, $trail, $prefix ); |
249 | 268 | } else { |
250 | 269 | $threshold = $wgUser->getOption('stubthreshold') ; |
251 | 270 | if ( $threshold > 0 ) { |
— | — | @@ -267,9 +286,9 @@ |
268 | 287 | $size = 1 ; |
269 | 288 | } |
270 | 289 | if ( $size < $threshold ) { |
271 | | - $retVal = $this->makeStubLinkObj( $nt, $text, $query, $trail, $prefix ); |
| 290 | + $retVal = self::makeStubLinkObj( $nt, $text, $query, $trail, $prefix ); |
272 | 291 | } else { |
273 | | - $retVal = $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix ); |
| 292 | + $retVal = self::makeKnownLinkObj( $nt, $text, $query, $trail, $prefix ); |
274 | 293 | } |
275 | 294 | } |
276 | 295 | wfProfileOut( $fname.'-immediate' ); |
— | — | @@ -282,18 +301,19 @@ |
283 | 302 | * Make a link for a title which definitely exists. This is faster than makeLinkObj because |
284 | 303 | * it doesn't have to do a database query. It's also valid for interwiki titles and special |
285 | 304 | * pages. |
286 | | - * |
287 | | - * @param $nt Title object of target page |
288 | | - * @param $text String: text to replace the title |
289 | | - * @param $query String: link target |
290 | | - * @param $trail String: text after link |
291 | | - * @param $prefix String: text before link text |
292 | | - * @param $aprops String: extra attributes to the a-element |
293 | | - * @param $style String: style to apply - if empty, use getInternalLinkAttributesObj instead |
294 | | - * @return the a-element |
| 305 | + * |
| 306 | + * @param $nt Title object of target page |
| 307 | + * @param $text String text to replace the title |
| 308 | + * @param $query String link target |
| 309 | + * @param $trail String text after link |
| 310 | + * @param $prefix String text before link text |
| 311 | + * @param $aprops String extra attributes to the a-element |
| 312 | + * @param $style String style to apply |
| 313 | + * @return String HTML for link |
| 314 | + * |
| 315 | + * @static |
295 | 316 | */ |
296 | | - function makeKnownLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '', $style = '' ) { |
297 | | - |
| 317 | + public static function makeKnownLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '', $style = '' ) { |
298 | 318 | $fname = 'Linker::makeKnownLinkObj'; |
299 | 319 | wfProfileIn( $fname ); |
300 | 320 | |
— | — | @@ -321,12 +341,12 @@ |
322 | 342 | $text = htmlspecialchars( $nt->getPrefixedText() ); |
323 | 343 | } |
324 | 344 | if ( $style == '' ) { |
325 | | - $style = $this->getInternalLinkAttributesObj( $nt, $text ); |
| 345 | + $style = self::getInternalLinkAttributesObj( $nt, $text ); |
326 | 346 | } |
327 | 347 | |
328 | 348 | if ( $aprops !== '' ) $aprops = ' ' . $aprops; |
329 | 349 | |
330 | | - list( $inside, $trail ) = Linker::splitTrail( $trail ); |
| 350 | + list( $inside, $trail ) = self::splitTrail( $trail ); |
331 | 351 | $r = "<a href=\"{$u}\"{$style}{$aprops}>{$prefix}{$text}{$inside}</a>{$trail}"; |
332 | 352 | wfProfileOut( $fname ); |
333 | 353 | return $r; |
— | — | @@ -335,16 +355,18 @@ |
336 | 356 | /** |
337 | 357 | * Make a red link to the edit page of a given title. |
338 | 358 | * |
339 | | - * @param $title String: The text of the title |
340 | | - * @param $text String: Link text |
341 | | - * @param $query String: Optional query part |
342 | | - * @param $trail String: Optional trail. Alphabetic characters at the start of this string will |
| 359 | + * @param $title String The text of the title |
| 360 | + * @param $text String Link text |
| 361 | + * @param $query String Optional query part |
| 362 | + * @param $trail String Optional trail. Alphabetic characters at the start of this string will |
343 | 363 | * be included in the link text. Other characters will be appended after |
344 | 364 | * the end of the link. |
| 365 | + * |
| 366 | + * @static |
345 | 367 | */ |
346 | | - function makeBrokenLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) { |
| 368 | + public static function makeBrokenLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) { |
347 | 369 | # Fail gracefully |
348 | | - if ( ! isset($nt) ) { |
| 370 | + if ( !isset($nt) ) { |
349 | 371 | # throw new MWException(); |
350 | 372 | return "<!-- ERROR -->{$prefix}{$text}{$trail}"; |
351 | 373 | } |
— | — | @@ -362,9 +384,9 @@ |
363 | 385 | if ( '' == $text ) { |
364 | 386 | $text = htmlspecialchars( $nt->getPrefixedText() ); |
365 | 387 | } |
366 | | - $style = $this->getInternalLinkAttributesObj( $nt, $text, "yes" ); |
| 388 | + $style = self::getInternalLinkAttributesObj( $nt, $text, 'yes' ); |
367 | 389 | |
368 | | - list( $inside, $trail ) = Linker::splitTrail( $trail ); |
| 390 | + list( $inside, $trail ) = self::splitTrail( $trail ); |
369 | 391 | $s = "<a href=\"{$u}\"{$style}>{$prefix}{$text}{$inside}</a>{$trail}"; |
370 | 392 | |
371 | 393 | wfProfileOut( $fname ); |
— | — | @@ -374,14 +396,16 @@ |
375 | 397 | /** |
376 | 398 | * Make a brown link to a short article. |
377 | 399 | * |
378 | | - * @param $title String: the text of the title |
379 | | - * @param $text String: link text |
380 | | - * @param $query String: optional query part |
381 | | - * @param $trail String: optional trail. Alphabetic characters at the start of this string will |
| 400 | + * @param $title String the text of the title |
| 401 | + * @param $text String link text |
| 402 | + * @param $query String optional query part |
| 403 | + * @param $trail String optional trail. Alphabetic characters at the start of this string will |
382 | 404 | * be included in the link text. Other characters will be appended after |
383 | 405 | * the end of the link. |
| 406 | + * |
| 407 | + * @static |
384 | 408 | */ |
385 | | - function makeStubLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) { |
| 409 | + public static function makeStubLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) { |
386 | 410 | $link = $nt->getPrefixedURL(); |
387 | 411 | |
388 | 412 | $u = $nt->escapeLocalURL( $query ); |
— | — | @@ -389,9 +413,9 @@ |
390 | 414 | if ( '' == $text ) { |
391 | 415 | $text = htmlspecialchars( $nt->getPrefixedText() ); |
392 | 416 | } |
393 | | - $style = $this->getInternalLinkAttributesObj( $nt, $text, 'stub' ); |
| 417 | + $style = self::getInternalLinkAttributesObj( $nt, $text, 'stub' ); |
394 | 418 | |
395 | | - list( $inside, $trail ) = Linker::splitTrail( $trail ); |
| 419 | + list( $inside, $trail ) = self::splitTrail( $trail ); |
396 | 420 | $s = "<a href=\"{$u}\"{$style}>{$prefix}{$text}{$inside}</a>{$trail}"; |
397 | 421 | return $s; |
398 | 422 | } |
— | — | @@ -399,40 +423,47 @@ |
400 | 424 | /** |
401 | 425 | * Generate either a normal exists-style link or a stub link, depending |
402 | 426 | * on the given page size. |
403 | | - * |
| 427 | + * |
404 | 428 | * @param $size Integer |
405 | | - * @param $nt Title object. |
| 429 | + * @param $nt Title object |
406 | 430 | * @param $text String |
407 | 431 | * @param $query String |
408 | 432 | * @param $trail String |
409 | 433 | * @param $prefix String |
410 | | - * @return string HTML of link |
| 434 | + * @return String HTML of link |
| 435 | + * |
| 436 | + * @static |
411 | 437 | */ |
412 | | - function makeSizeLinkObj( $size, $nt, $text = '', $query = '', $trail = '', $prefix = '' ) { |
| 438 | + public static function makeSizeLinkObj( $size, $nt, $text = '', $query = '', $trail = '', $prefix = '' ) { |
413 | 439 | global $wgUser; |
414 | 440 | $threshold = intval( $wgUser->getOption( 'stubthreshold' ) ); |
415 | 441 | if( $size < $threshold ) { |
416 | | - return $this->makeStubLinkObj( $nt, $text, $query, $trail, $prefix ); |
| 442 | + return self::makeStubLinkObj( $nt, $text, $query, $trail, $prefix ); |
417 | 443 | } else { |
418 | | - return $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix ); |
| 444 | + return self::makeKnownLinkObj( $nt, $text, $query, $trail, $prefix ); |
419 | 445 | } |
420 | 446 | } |
421 | 447 | |
422 | | - /** |
| 448 | + /** |
423 | 449 | * Make appropriate markup for a link to the current article. This is currently rendered |
424 | 450 | * as the bold link text. The calling sequence is the same as the other make*LinkObj functions, |
425 | 451 | * despite $query not being used. |
| 452 | + * |
| 453 | + * @static |
426 | 454 | */ |
427 | | - function makeSelfLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) { |
| 455 | + public static function makeSelfLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) { |
428 | 456 | if ( '' == $text ) { |
429 | 457 | $text = htmlspecialchars( $nt->getPrefixedText() ); |
430 | 458 | } |
431 | | - list( $inside, $trail ) = Linker::splitTrail( $trail ); |
| 459 | + list( $inside, $trail ) = self::splitTrail( $trail ); |
432 | 460 | return "<strong class=\"selflink\">{$prefix}{$text}{$inside}</strong>{$trail}"; |
433 | 461 | } |
434 | 462 | |
435 | | - /** @todo document */ |
436 | | - function fnamePart( $url ) { |
| 463 | + /** |
| 464 | + * @todo document |
| 465 | + * @static |
| 466 | + */ |
| 467 | + public static function fnamePart( $url ) { |
437 | 468 | $basename = strrchr( $url, '/' ); |
438 | 469 | if ( false === $basename ) { |
439 | 470 | $basename = $url; |
— | — | @@ -442,62 +473,66 @@ |
443 | 474 | return htmlspecialchars( $basename ); |
444 | 475 | } |
445 | 476 | |
446 | | - /** Obsolete alias */ |
447 | | - function makeImage( $url, $alt = '' ) { |
448 | | - return $this->makeExternalImage( $url, $alt ); |
| 477 | + /** |
| 478 | + * @deprecated Obsolete alias |
| 479 | + */ |
| 480 | + private static function makeImage( $url, $alt = '' ) { |
| 481 | + return self::makeExternalImage( $url, $alt ); |
449 | 482 | } |
450 | 483 | |
451 | | - /** @todo document */ |
452 | | - function makeExternalImage( $url, $alt = '' ) { |
| 484 | + /** |
| 485 | + * @todo document |
| 486 | + * @static |
| 487 | + */ |
| 488 | + public static function makeExternalImage( $url, $alt = '' ) { |
453 | 489 | if ( '' == $alt ) { |
454 | | - $alt = $this->fnamePart( $url ); |
| 490 | + $alt = self::fnamePart( $url ); |
455 | 491 | } |
456 | 492 | $s = '<img src="'.$url.'" alt="'.$alt.'" />'; |
457 | 493 | return $s; |
458 | 494 | } |
459 | 495 | |
460 | | - /** @todo document */ |
461 | | - function makeImageLinkObj( $nt, $label, $alt, $align = '', $width = false, $height = false, $framed = false, |
462 | | - $thumb = false, $manual_thumb = '', $page = null ) |
463 | | - { |
| 496 | + /** |
| 497 | + * @todo document |
| 498 | + * @static |
| 499 | + */ |
| 500 | + public static function makeImageLinkObj( $nt, $label, $alt, $align = '', $width = false, $height = false, $framed = false, |
| 501 | + $thumb = false, $manual_thumb = '', $page = null ) { |
464 | 502 | global $wgContLang, $wgUser, $wgThumbLimits, $wgGenerateThumbnailOnParse; |
465 | 503 | |
466 | | - $img = new Image( $nt ); |
| 504 | + $img = new Image( $nt ); |
467 | 505 | |
468 | | - if ( ! is_null( $page ) ) { |
| 506 | + if ( !is_null( $page ) ) { |
469 | 507 | $img->selectPage( $page ); |
470 | 508 | } |
471 | 509 | |
472 | 510 | if ( !$img->allowInlineDisplay() && $img->exists() ) { |
473 | | - return $this->makeKnownLinkObj( $nt ); |
| 511 | + return self::makeKnownLinkObj( $nt ); |
474 | 512 | } |
475 | 513 | |
476 | | - $url = $img->getViewURL(); |
| 514 | + $url = $img->getViewURL(); |
477 | 515 | $error = $prefix = $postfix = ''; |
478 | 516 | |
479 | 517 | wfDebug( "makeImageLinkObj: '$width'x'$height', \"$label\"\n" ); |
480 | 518 | |
481 | | - if ( 'center' == $align ) |
482 | | - { |
| 519 | + if ( 'center' == $align ) { |
483 | 520 | $prefix = '<div class="center">'; |
484 | 521 | $postfix = '</div>'; |
485 | 522 | $align = 'none'; |
486 | 523 | } |
487 | 524 | |
488 | 525 | if ( $thumb || $framed ) { |
489 | | - |
490 | 526 | # Create a thumbnail. Alignment depends on language |
491 | | - # writing direction, # right aligned for left-to-right- |
| 527 | + # writing direction: right-aligned for left-to-right- |
492 | 528 | # languages ("Western languages"), left-aligned |
493 | 529 | # for right-to-left-languages ("Semitic languages") |
494 | 530 | # |
495 | | - # If thumbnail width has not been provided, it is set |
| 531 | + # If thumbnail width has not been provided, it is set |
496 | 532 | # to the default user option as specified in Language*.php |
497 | 533 | if ( $align == '' ) { |
498 | 534 | $align = $wgContLang->isRTL() ? 'left' : 'right'; |
499 | 535 | } |
500 | 536 | |
501 | | - |
502 | 537 | if ( $width === false ) { |
503 | 538 | $wopt = $wgUser->getOption( 'thumbsize' ); |
504 | 539 | |
— | — | @@ -508,14 +543,12 @@ |
509 | 544 | $width = min( $img->getWidth(), $wgThumbLimits[$wopt] ); |
510 | 545 | } |
511 | 546 | |
512 | | - return $prefix.$this->makeThumbLinkObj( $img, $label, $alt, $align, $width, $height, $framed, $manual_thumb ).$postfix; |
| 547 | + return $prefix.self::makeThumbLinkObj( $img, $label, $alt, $align, $width, $height, $framed, $manual_thumb ).$postfix; |
513 | 548 | } |
514 | 549 | |
515 | 550 | if ( $width && $img->exists() ) { |
516 | | - |
517 | 551 | # Create a resized image, without the additional thumbnail |
518 | 552 | # features |
519 | | - |
520 | 553 | if ( $height == false ) |
521 | 554 | $height = -1; |
522 | 555 | if ( $manual_thumb == '') { |
— | — | @@ -549,7 +582,7 @@ |
550 | 583 | if ( $error ) { |
551 | 584 | $s = $error; |
552 | 585 | } elseif ( $url == '' ) { |
553 | | - $s = $this->makeBrokenImageLinkObj( $img->getTitle() ); |
| 586 | + $s = self::makeBrokenImageLinkObj( $img->getTitle() ); |
554 | 587 | //$s .= "<br />{$alt}<br />{$url}<br />\n"; |
555 | 588 | } else { |
556 | 589 | $s = '<a href="'.$u.'" class="image" title="'.$alt.'">' . |
— | — | @@ -568,8 +601,10 @@ |
569 | 602 | /** |
570 | 603 | * Make HTML for a thumbnail including image, border and caption |
571 | 604 | * $img is an Image object |
| 605 | + * |
| 606 | + * @static |
572 | 607 | */ |
573 | | - function makeThumbLinkObj( $img, $label = '', $alt, $align = 'right', $boxwidth = 180, $boxheight=false, $framed=false , $manual_thumb = "" ) { |
| 608 | + public static function makeThumbLinkObj( $img, $label = '', $alt, $align = 'right', $boxwidth = 180, $boxheight=false, $framed=false , $manual_thumb = "" ) { |
574 | 609 | global $wgStylePath, $wgContLang, $wgGenerateThumbnailOnParse; |
575 | 610 | $thumbUrl = ''; |
576 | 611 | $error = ''; |
— | — | @@ -606,19 +641,17 @@ |
607 | 642 | } |
608 | 643 | $oboxwidth = $boxwidth + 2; |
609 | 644 | |
610 | | - if ( $manual_thumb != '' ) # Use manually specified thumbnail |
611 | | - { |
| 645 | + if ( $manual_thumb != '' ) { # Use manually specified thumbnail |
612 | 646 | $manual_title = Title::makeTitleSafe( NS_IMAGE, $manual_thumb ); #new Title ( $manual_thumb ) ; |
613 | 647 | if( $manual_title ) { |
614 | 648 | $manual_img = new Image( $manual_title ); |
615 | 649 | $thumbUrl = $manual_img->getViewURL(); |
616 | | - if ( $manual_img->exists() ) |
617 | | - { |
| 650 | + if ( $manual_img->exists() ) { |
618 | 651 | $width = $manual_img->getWidth(); |
619 | 652 | $height = $manual_img->getHeight(); |
620 | | - $boxwidth = $width ; |
621 | | - $boxheight = $height ; |
622 | | - $oboxwidth = $boxwidth + 2 ; |
| 653 | + $boxwidth = $width; |
| 654 | + $boxheight = $height; |
| 655 | + $oboxwidth = $boxwidth + 2; |
623 | 656 | } |
624 | 657 | } |
625 | 658 | } |
— | — | @@ -638,7 +671,7 @@ |
639 | 672 | $s .= htmlspecialchars( $error ); |
640 | 673 | $zoomicon = ''; |
641 | 674 | } elseif( !$img->exists() ) { |
642 | | - $s .= $this->makeBrokenImageLinkObj( $img->getTitle() ); |
| 675 | + $s .= self::makeBrokenImageLinkObj( $img->getTitle() ); |
643 | 676 | $zoomicon = ''; |
644 | 677 | } else { |
645 | 678 | $s .= '<a href="'.$u.'" class="internal" title="'.$alt.'">'. |
— | — | @@ -660,10 +693,12 @@ |
661 | 694 | |
662 | 695 | /** |
663 | 696 | * Pass a title object, not a title string |
| 697 | + * |
| 698 | + * @static |
664 | 699 | */ |
665 | | - function makeBrokenImageLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) { |
| 700 | + public static function makeBrokenImageLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) { |
666 | 701 | # Fail gracefully |
667 | | - if ( ! isset($nt) ) { |
| 702 | + if ( !isset($nt) ) { |
668 | 703 | # throw new MWException(); |
669 | 704 | return "<!-- ERROR -->{$prefix}{$text}{$trail}"; |
670 | 705 | } |
— | — | @@ -681,33 +716,34 @@ |
682 | 717 | if ( '' == $text ) { |
683 | 718 | $text = htmlspecialchars( $nt->getPrefixedText() ); |
684 | 719 | } |
685 | | - $style = $this->getInternalLinkAttributesObj( $nt, $text, "yes" ); |
686 | | - list( $inside, $trail ) = Linker::splitTrail( $trail ); |
| 720 | + $style = self::getInternalLinkAttributesObj( $nt, $text, 'yes' ); |
| 721 | + list( $inside, $trail ) = self::splitTrail( $trail ); |
687 | 722 | $s = "<a href=\"{$url}\"{$style}>{$prefix}{$text}{$inside}</a>{$trail}"; |
688 | 723 | |
689 | 724 | wfProfileOut( $fname ); |
690 | 725 | return $s; |
691 | 726 | } |
692 | 727 | |
693 | | - /** @todo document */ |
694 | | - function makeMediaLink( $name, /* wtf?! */ $url, $alt = '' ) { |
| 728 | + /** |
| 729 | + * @todo document |
| 730 | + * @static |
| 731 | + */ |
| 732 | + public static function makeMediaLink( $name, /* wtf?! */ $url, $alt = '' ) { |
695 | 733 | $nt = Title::makeTitleSafe( NS_IMAGE, $name ); |
696 | | - return $this->makeMediaLinkObj( $nt, $alt ); |
| 734 | + return self::makeMediaLinkObj( $nt, $alt ); |
697 | 735 | } |
698 | 736 | |
699 | 737 | /** |
700 | 738 | * Create a direct link to a given uploaded file. |
701 | | - * |
702 | | - * @param $title Title object. |
703 | | - * @param $text String: pre-sanitized HTML |
704 | | - * @param $nourl Boolean: Mask absolute URLs, so the parser doesn't |
705 | | - * linkify them (it is currently not context-aware) |
706 | | - * @return string HTML |
707 | | - * |
708 | | - * @public |
| 739 | + * |
| 740 | + * @param $title Title object |
| 741 | + * @param $text String pre-sanitized HTML |
| 742 | + * @return String HTML |
| 743 | + * |
| 744 | + * @static |
709 | 745 | * @todo Handle invalid or missing images better. |
710 | 746 | */ |
711 | | - function makeMediaLinkObj( $title, $text = '' ) { |
| 747 | + public static function makeMediaLinkObj( $title, $text = '' ) { |
712 | 748 | if( is_null( $title ) ) { |
713 | 749 | ### HOTFIX. Instead of breaking, return empty string. |
714 | 750 | return $text; |
— | — | @@ -731,19 +767,24 @@ |
732 | 768 | } |
733 | 769 | } |
734 | 770 | |
735 | | - /** @todo document */ |
736 | | - function specialLink( $name, $key = '' ) { |
| 771 | + /** |
| 772 | + * @todo document |
| 773 | + * @static |
| 774 | + */ |
| 775 | + public static function specialLink( $name, $key = '' ) { |
737 | 776 | global $wgContLang; |
738 | 777 | |
739 | 778 | if ( '' == $key ) { $key = strtolower( $name ); } |
740 | 779 | $pn = $wgContLang->ucfirst( $name ); |
741 | | - return $this->makeKnownLink( $wgContLang->specialPage( $pn ), |
742 | | - wfMsg( $key ) ); |
| 780 | + return self::makeKnownLink( $wgContLang->specialPage( $pn ), wfMsg( $key ) ); |
743 | 781 | } |
744 | 782 | |
745 | | - /** @todo document */ |
746 | | - function makeExternalLink( $url, $text, $escape = true, $linktype = '', $ns = null ) { |
747 | | - $style = $this->getExternalLinkAttributes( $url, $text, 'external ' . $linktype ); |
| 783 | + /** |
| 784 | + * @todo document |
| 785 | + * @static |
| 786 | + */ |
| 787 | + public static function makeExternalLink( $url, $text, $escape = true, $linktype = '', $ns = null ) { |
| 788 | + $style = self::getExternalLinkAttributes( $url, $text, 'external ' . $linktype ); |
748 | 789 | global $wgNoFollowLinks, $wgNoFollowNsExceptions; |
749 | 790 | if( $wgNoFollowLinks && !(isset($ns) && in_array($ns, $wgNoFollowNsExceptions)) ) { |
750 | 791 | $style .= ' rel="nofollow"'; |
— | — | @@ -757,45 +798,47 @@ |
758 | 799 | |
759 | 800 | /** |
760 | 801 | * Make user link (or user contributions for unregistered users) |
761 | | - * @param $userId Integer: user id in database. |
762 | | - * @param $userText String: user name in database |
763 | | - * @return string HTML fragment |
764 | | - * @private |
| 802 | + * @param $userId Integer user id in database |
| 803 | + * @param $userText String user name in database |
| 804 | + * @return String HTML fragment |
| 805 | + * |
| 806 | + * @static |
765 | 807 | */ |
766 | | - function userLink( $userId, $userText ) { |
| 808 | + public static function userLink( $userId, $userText ) { |
767 | 809 | $encName = htmlspecialchars( $userText ); |
768 | 810 | if( $userId == 0 ) { |
769 | 811 | $contribsPage = SpecialPage::getTitleFor( 'Contributions' ); |
770 | | - return $this->makeKnownLinkObj( $contribsPage, |
| 812 | + return self::makeKnownLinkObj( $contribsPage, |
771 | 813 | $encName, 'target=' . urlencode( $userText ) ); |
772 | 814 | } else { |
773 | 815 | $userPage = Title::makeTitle( NS_USER, $userText ); |
774 | | - return $this->makeLinkObj( $userPage, $encName ); |
| 816 | + return self::makeLinkObj( $userPage, $encName ); |
775 | 817 | } |
776 | 818 | } |
777 | 819 | |
778 | 820 | /** |
779 | | - * @param $userId Integer: user id in database. |
780 | | - * @param $userText String: user name in database. |
781 | | - * @return string HTML fragment with talk and/or block links |
782 | | - * @private |
| 821 | + * @param $userId Integer user id in database |
| 822 | + * @param $userText String user name in database |
| 823 | + * @return String HTML fragment with talk and/or block links |
| 824 | + * |
| 825 | + * @static |
783 | 826 | */ |
784 | | - function userToolLinks( $userId, $userText ) { |
| 827 | + public static function userToolLinks( $userId, $userText ) { |
785 | 828 | global $wgUser, $wgDisableAnonTalk, $wgSysopUserBans; |
786 | 829 | $talkable = !( $wgDisableAnonTalk && 0 == $userId ); |
787 | 830 | $blockable = ( $wgSysopUserBans || 0 == $userId ); |
788 | 831 | |
789 | 832 | $items = array(); |
790 | 833 | if( $talkable ) { |
791 | | - $items[] = $this->userTalkLink( $userId, $userText ); |
| 834 | + $items[] = self::userTalkLink( $userId, $userText ); |
792 | 835 | } |
793 | 836 | if( $userId ) { |
794 | 837 | $contribsPage = SpecialPage::getTitleFor( 'Contributions' ); |
795 | | - $items[] = $this->makeKnownLinkObj( $contribsPage, |
| 838 | + $items[] = self::makeKnownLinkObj( $contribsPage, |
796 | 839 | wfMsgHtml( 'contribslink' ), 'target=' . urlencode( $userText ) ); |
797 | 840 | } |
798 | 841 | if( $blockable && $wgUser->isAllowed( 'block' ) ) { |
799 | | - $items[] = $this->blockLink( $userId, $userText ); |
| 842 | + $items[] = self::blockLink( $userId, $userText ); |
800 | 843 | } |
801 | 844 | |
802 | 845 | if( $items ) { |
— | — | @@ -806,41 +849,45 @@ |
807 | 850 | } |
808 | 851 | |
809 | 852 | /** |
810 | | - * @param $userId Integer: user id in database. |
811 | | - * @param $userText String: user name in database. |
812 | | - * @return string HTML fragment with user talk link |
813 | | - * @private |
| 853 | + * @param $userId Integer user id in database |
| 854 | + * @param $userText String user name in database |
| 855 | + * @return String HTML fragment with user talk link |
| 856 | + * |
| 857 | + * @static |
814 | 858 | */ |
815 | | - function userTalkLink( $userId, $userText ) { |
| 859 | + public static function userTalkLink( $userId, $userText ) { |
816 | 860 | global $wgLang; |
817 | 861 | $talkname = $wgLang->getNsText( NS_TALK ); # use the shorter name |
818 | 862 | |
819 | 863 | $userTalkPage = Title::makeTitle( NS_USER_TALK, $userText ); |
820 | | - $userTalkLink = $this->makeLinkObj( $userTalkPage, $talkname ); |
| 864 | + $userTalkLink = self::makeLinkObj( $userTalkPage, $talkname ); |
821 | 865 | return $userTalkLink; |
822 | 866 | } |
823 | 867 | |
824 | 868 | /** |
825 | | - * @param $userId Integer: userid |
826 | | - * @param $userText String: user name in database. |
| 869 | + * @param $userId Integer userid |
| 870 | + * @param $userText String user name in database |
827 | 871 | * @return string HTML fragment with block link |
828 | | - * @private |
| 872 | + * |
| 873 | + * @static |
829 | 874 | */ |
830 | | - function blockLink( $userId, $userText ) { |
| 875 | + public static function blockLink( $userId, $userText ) { |
831 | 876 | $blockPage = SpecialPage::getTitleFor( 'Blockip' ); |
832 | | - $blockLink = $this->makeKnownLinkObj( $blockPage, |
| 877 | + $blockLink = self::makeKnownLinkObj( $blockPage, |
833 | 878 | wfMsgHtml( 'blocklink' ), 'ip=' . urlencode( $userText ) ); |
834 | 879 | return $blockLink; |
835 | 880 | } |
836 | | - |
| 881 | + |
837 | 882 | /** |
838 | 883 | * Generate a user link if the current user is allowed to view it |
839 | | - * @param $rev Revision object. |
| 884 | + * @param $rev Revision object |
840 | 885 | * @return string HTML |
| 886 | + * |
| 887 | + * @static |
841 | 888 | */ |
842 | | - function revUserLink( $rev ) { |
| 889 | + public static function revUserLink( $rev ) { |
843 | 890 | if( $rev->userCan( Revision::DELETED_USER ) ) { |
844 | | - $link = $this->userLink( $rev->getRawUser(), $rev->getRawUserText() ); |
| 891 | + $link = self::userLink( $rev->getRawUser(), $rev->getRawUserText() ); |
845 | 892 | } else { |
846 | 893 | $link = wfMsgHtml( 'rev-deleted-user' ); |
847 | 894 | } |
— | — | @@ -852,14 +899,16 @@ |
853 | 900 | |
854 | 901 | /** |
855 | 902 | * Generate a user tool link cluster if the current user is allowed to view it |
856 | | - * @param $rev Revision object. |
| 903 | + * @param $rev Revision object |
857 | 904 | * @return string HTML |
| 905 | + * |
| 906 | + * @static |
858 | 907 | */ |
859 | | - function revUserTools( $rev ) { |
| 908 | + public static function revUserTools( $rev ) { |
860 | 909 | if( $rev->userCan( Revision::DELETED_USER ) ) { |
861 | | - $link = $this->userLink( $rev->getRawUser(), $rev->getRawUserText() ) . |
| 910 | + $link = self::userLink( $rev->getRawUser(), $rev->getRawUserText() ) . |
862 | 911 | ' ' . |
863 | | - $this->userToolLinks( $rev->getRawUser(), $rev->getRawUserText() ); |
| 912 | + self::userToolLinks( $rev->getRawUser(), $rev->getRawUserText() ); |
864 | 913 | } else { |
865 | 914 | $link = wfMsgHtml( 'rev-deleted-user' ); |
866 | 915 | } |
— | — | @@ -868,22 +917,24 @@ |
869 | 918 | } |
870 | 919 | return $link; |
871 | 920 | } |
872 | | - |
| 921 | + |
873 | 922 | /** |
874 | 923 | * This function is called by all recent changes variants, by the page history, |
875 | 924 | * and by the user contributions list. It is responsible for formatting edit |
876 | 925 | * comments. It escapes any HTML in the comment, but adds some CSS to format |
877 | 926 | * auto-generated comments (from section editing) and formats [[wikilinks]]. |
878 | | - * |
| 927 | + * |
879 | 928 | * The $title parameter must be a title OBJECT. It is used to generate a |
880 | 929 | * direct link to the section in the autocomment. |
881 | 930 | * @author Erik Moeller <moeller@scireview.de> |
882 | | - * |
| 931 | + * |
883 | 932 | * Note: there's not always a title to pass to this function. |
884 | 933 | * Since you can't set a default parameter for a reference, I've turned it |
885 | 934 | * temporarily to a value pass. Should be adjusted further. --brion |
| 935 | + * |
| 936 | + * @static |
886 | 937 | */ |
887 | | - function formatComment($comment, $title = NULL) { |
| 938 | + public static function formatComment( $comment, $title = NULL ) { |
888 | 939 | $fname = 'Linker::formatComment'; |
889 | 940 | wfProfileIn( $fname ); |
890 | 941 | |
— | — | @@ -913,7 +964,7 @@ |
914 | 965 | $section = str_replace( ']]', '', $section ); |
915 | 966 | $sectionTitle = wfClone( $title ); |
916 | 967 | $sectionTitle->mFragment = $section; |
917 | | - $link = $this->makeKnownLinkObj( $sectionTitle, wfMsg( 'sectionlink' ) ); |
| 968 | + $link = self::makeKnownLinkObj( $sectionTitle, wfMsg( 'sectionlink' ) ); |
918 | 969 | } |
919 | 970 | $sep='-'; |
920 | 971 | $auto=$link.$auto; |
— | — | @@ -936,7 +987,7 @@ |
937 | 988 | if( preg_match( '/^' . $medians . '(.*)$/i', $match[1], $submatch ) ) { |
938 | 989 | # Media link; trail not supported. |
939 | 990 | $linkRegexp = '/\[\[(.*?)\]\]/'; |
940 | | - $thelink = $this->makeMediaLink( $submatch[1], "", $text ); |
| 991 | + $thelink = self::makeMediaLink( $submatch[1], "", $text ); |
941 | 992 | } else { |
942 | 993 | # Other kind of link |
943 | 994 | if( preg_match( $wgContLang->linkTrail(), $match[4], $submatch ) ) { |
— | — | @@ -947,7 +998,7 @@ |
948 | 999 | $linkRegexp = '/\[\[(.*?)\]\]' . preg_quote( $trail, '/' ) . '/'; |
949 | 1000 | if ($match[1][0] == ':') |
950 | 1001 | $match[1] = substr($match[1], 1); |
951 | | - $thelink = $this->makeLink( $match[1], $text, "", $trail ); |
| 1002 | + $thelink = self::makeLink( $match[1], $text, "", $trail ); |
952 | 1003 | } |
953 | 1004 | $comment = preg_replace( $linkRegexp, wfRegexReplacement( $thelink ), $comment, 1 ); |
954 | 1005 | } |
— | — | @@ -958,33 +1009,36 @@ |
959 | 1010 | /** |
960 | 1011 | * Wrap a comment in standard punctuation and formatting if |
961 | 1012 | * it's non-empty, otherwise return empty string. |
962 | | - * |
963 | | - * @param $comment String: the comment. |
964 | | - * @param $title Title object. |
965 | | - * |
966 | | - * @return string |
| 1013 | + * |
| 1014 | + * @param $comment String the comment |
| 1015 | + * @param $title Title object |
| 1016 | + * @return String |
| 1017 | + * |
| 1018 | + * @static |
967 | 1019 | */ |
968 | | - function commentBlock( $comment, $title = NULL ) { |
| 1020 | + public static function commentBlock( $comment, $title = NULL ) { |
969 | 1021 | // '*' used to be the comment inserted by the software way back |
970 | 1022 | // in antiquity in case none was provided, here for backwards |
971 | 1023 | // compatability, acc. to brion -ævar |
972 | 1024 | if( $comment == '' || $comment == '*' ) { |
973 | 1025 | return ''; |
974 | 1026 | } else { |
975 | | - $formatted = $this->formatComment( $comment, $title ); |
| 1027 | + $formatted = self::formatComment( $comment, $title ); |
976 | 1028 | return " <span class=\"comment\">($formatted)</span>"; |
977 | 1029 | } |
978 | 1030 | } |
979 | | - |
| 1031 | + |
980 | 1032 | /** |
981 | 1033 | * Wrap and format the given revision's comment block, if the current |
982 | 1034 | * user is allowed to view it. |
983 | | - * @param $rev Revision object. |
984 | | - * @return string HTML |
| 1035 | + * @param $rev Revision object |
| 1036 | + * @return String HTML |
| 1037 | + * |
| 1038 | + * @static |
985 | 1039 | */ |
986 | | - function revComment( $rev ) { |
| 1040 | + public static function revComment( $rev ) { |
987 | 1041 | if( $rev->userCan( Revision::DELETED_COMMENT ) ) { |
988 | | - $block = $this->commentBlock( $rev->getRawComment(), $rev->getTitle() ); |
| 1042 | + $block = self::commentBlock( $rev->getRawComment(), $rev->getTitle() ); |
989 | 1043 | } else { |
990 | 1044 | $block = " <span class=\"comment\">" . |
991 | 1045 | wfMsgHtml( 'rev-deleted-comment' ) . "</span>"; |
— | — | @@ -995,35 +1049,49 @@ |
996 | 1050 | return $block; |
997 | 1051 | } |
998 | 1052 | |
999 | | - /** @todo document */ |
1000 | | - function tocIndent() { |
| 1053 | + /** |
| 1054 | + * @todo document |
| 1055 | + * @static |
| 1056 | + */ |
| 1057 | + public static function tocIndent() { |
1001 | 1058 | return "\n<ul>"; |
1002 | 1059 | } |
1003 | 1060 | |
1004 | | - /** @todo document */ |
1005 | | - function tocUnindent($level) { |
| 1061 | + /** |
| 1062 | + * @todo document |
| 1063 | + * @static |
| 1064 | + */ |
| 1065 | + public static function tocUnindent($level) { |
1006 | 1066 | return "</li>\n" . str_repeat( "</ul>\n</li>\n", $level>0 ? $level : 0 ); |
1007 | 1067 | } |
1008 | 1068 | |
1009 | 1069 | /** |
1010 | 1070 | * parameter level defines if we are on an indentation level |
| 1071 | + * |
| 1072 | + * @static |
1011 | 1073 | */ |
1012 | | - function tocLine( $anchor, $tocline, $tocnumber, $level ) { |
| 1074 | + public static function tocLine( $anchor, $tocline, $tocnumber, $level ) { |
1013 | 1075 | return "\n<li class=\"toclevel-$level\"><a href=\"#" . |
1014 | 1076 | $anchor . '"><span class="tocnumber">' . |
1015 | 1077 | $tocnumber . '</span> <span class="toctext">' . |
1016 | 1078 | $tocline . '</span></a>'; |
1017 | 1079 | } |
1018 | 1080 | |
1019 | | - /** @todo document */ |
1020 | | - function tocLineEnd() { |
| 1081 | + /** |
| 1082 | + * @todo document |
| 1083 | + * @static |
| 1084 | + */ |
| 1085 | + static function tocLineEnd() { |
1021 | 1086 | return "</li>\n"; |
1022 | 1087 | } |
1023 | 1088 | |
1024 | | - /** @todo document */ |
1025 | | - function tocList($toc) { |
| 1089 | + /** |
| 1090 | + * @todo document |
| 1091 | + * @static |
| 1092 | + */ |
| 1093 | + static function tocList($toc) { |
1026 | 1094 | global $wgJsMimeType; |
1027 | | - $title = wfMsgForContent('toc') ; |
| 1095 | + $title = wfMsgForContent('toc') ; |
1028 | 1096 | return |
1029 | 1097 | '<table id="toc" class="toc" summary="' . $title .'"><tr><td>' |
1030 | 1098 | . '<div id="toctitle"><h2>' . $title . "</h2></div>\n" |
— | — | @@ -1040,29 +1108,33 @@ |
1041 | 1109 | . "</script>\n"; |
1042 | 1110 | } |
1043 | 1111 | |
1044 | | - /** @todo document */ |
1045 | | - function editSectionLinkForOther( $title, $section ) { |
| 1112 | + /** |
| 1113 | + * @todo document |
| 1114 | + * @static |
| 1115 | + */ |
| 1116 | + public static function editSectionLinkForOther( $title, $section ) { |
1046 | 1117 | global $wgContLang; |
1047 | 1118 | |
1048 | 1119 | $title = Title::newFromText( $title ); |
1049 | 1120 | $editurl = '§ion='.$section; |
1050 | | - $url = $this->makeKnownLinkObj( $title, wfMsg('editsection'), 'action=edit'.$editurl ); |
| 1121 | + $url = self::makeKnownLinkObj( $title, wfMsg('editsection'), 'action=edit'.$editurl ); |
1051 | 1122 | |
1052 | 1123 | return "<span class=\"editsection\">[".$url."]</span>"; |
1053 | | - |
1054 | 1124 | } |
1055 | 1125 | |
1056 | 1126 | /** |
1057 | | - * @param $title Title object. |
1058 | | - * @param $section Integer: section number. |
1059 | | - * @param $hint Link String: title, or default if omitted or empty |
| 1127 | + * @param $title Title object |
| 1128 | + * @param $section Integer section number |
| 1129 | + * @param $hint Link String title, or default if omitted or empty |
| 1130 | + * |
| 1131 | + * @static |
1060 | 1132 | */ |
1061 | | - function editSectionLink( $nt, $section, $hint='' ) { |
| 1133 | + public static function editSectionLink( $nt, $section, $hint='' ) { |
1062 | 1134 | global $wgContLang; |
1063 | 1135 | |
1064 | 1136 | $editurl = '§ion='.$section; |
1065 | 1137 | $hint = ( $hint=='' ) ? '' : ' title="' . wfMsgHtml( 'editsectionhint', htmlspecialchars( $hint ) ) . '"'; |
1066 | | - $url = $this->makeKnownLinkObj( $nt, wfMsg('editsection'), 'action=edit'.$editurl, '', '', '', $hint ); |
| 1138 | + $url = self::makeKnownLinkObj( $nt, wfMsg('editsection'), 'action=edit'.$editurl, '', '', '', $hint ); |
1067 | 1139 | |
1068 | 1140 | return "<span class=\"editsection\">[".$url."]</span>"; |
1069 | 1141 | } |
— | — | @@ -1070,10 +1142,10 @@ |
1071 | 1143 | /** |
1072 | 1144 | * Split a link trail, return the "inside" portion and the remainder of the trail |
1073 | 1145 | * as a two-element array |
1074 | | - * |
| 1146 | + * |
1075 | 1147 | * @static |
1076 | 1148 | */ |
1077 | | - static function splitTrail( $trail ) { |
| 1149 | + public static function splitTrail( $trail ) { |
1078 | 1150 | static $regex = false; |
1079 | 1151 | if ( $regex === false ) { |
1080 | 1152 | global $wgContLang; |
— | — | @@ -1088,6 +1160,5 @@ |
1089 | 1161 | } |
1090 | 1162 | return array( $inside, $trail ); |
1091 | 1163 | } |
1092 | | - |
1093 | 1164 | } |
1094 | 1165 | ?> |
Index: trunk/phase3/includes/Parser.php |
— | — | @@ -1037,10 +1037,8 @@ |
1038 | 1038 | substr($m[0], 0, 20 ) . '"' ); |
1039 | 1039 | } |
1040 | 1040 | |
1041 | | - $url = wfMsg( $urlmsg, $id); |
1042 | | - $sk =& $this->mOptions->getSkin(); |
1043 | | - $la = $sk->getExternalLinkAttributes( $url, $keyword.$id ); |
1044 | | - $text = "<a href=\"{$url}\"{$la}>{$keyword} {$id}</a>"; |
| 1041 | + $url = wfMsg( $urlmsg, $id ); |
| 1042 | + $text = Linker::makeExternalLink( $url, "$keyword $id" ); |
1045 | 1043 | } |
1046 | 1044 | return $text; |
1047 | 1045 | } |
— | — | @@ -1258,8 +1256,6 @@ |
1259 | 1257 | $fname = 'Parser::replaceExternalLinks'; |
1260 | 1258 | wfProfileIn( $fname ); |
1261 | 1259 | |
1262 | | - $sk =& $this->mOptions->getSkin(); |
1263 | | - |
1264 | 1260 | $bits = preg_split( EXT_LINK_BRACKETED, $text, -1, PREG_SPLIT_DELIM_CAPTURE ); |
1265 | 1261 | |
1266 | 1262 | $s = $this->replaceFreeExternalLinks( array_shift( $bits ) ); |
— | — | @@ -1321,7 +1317,7 @@ |
1322 | 1318 | # This means that users can paste URLs directly into the text |
1323 | 1319 | # Funny characters like ö aren't valid in URLs anyway |
1324 | 1320 | # This was changed in August 2004 |
1325 | | - $s .= $sk->makeExternalLink( $url, $text, false, $linktype, $this->mTitle->getNamespace() ) . $dtrail . $trail; |
| 1321 | + $s .= Linker::makeExternalLink( $url, $text, false, $linktype, $this->mTitle->getNamespace() ) . $dtrail . $trail; |
1326 | 1322 | |
1327 | 1323 | # Register link in the output object. |
1328 | 1324 | # Replace unnecessary URL escape codes with the referenced character |
— | — | @@ -1347,8 +1343,6 @@ |
1348 | 1344 | $s = array_shift( $bits ); |
1349 | 1345 | $i = 0; |
1350 | 1346 | |
1351 | | - $sk =& $this->mOptions->getSkin(); |
1352 | | - |
1353 | 1347 | while ( $i < count( $bits ) ){ |
1354 | 1348 | $protocol = $bits[$i++]; |
1355 | 1349 | $remainder = $bits[$i++]; |
— | — | @@ -1400,7 +1394,7 @@ |
1401 | 1395 | $text = $this->maybeMakeExternalImage( $url ); |
1402 | 1396 | if ( $text === false ) { |
1403 | 1397 | # Not an image, make a link |
1404 | | - $text = $sk->makeExternalLink( $url, $wgContLang->markNoConversion($url), true, 'free', $this->mTitle->getNamespace() ); |
| 1398 | + $text = Linker::makeExternalLink( $url, $wgContLang->markNoConversion($url), true, 'free', $this->mTitle->getNamespace() ); |
1405 | 1399 | # Register it in the output object... |
1406 | 1400 | # Replace unnecessary URL escape codes with their equivalent characters |
1407 | 1401 | $pasteurized = Parser::replaceUnusualEscapes( $url ); |
— | — | @@ -1455,7 +1449,6 @@ |
1456 | 1450 | * @private |
1457 | 1451 | */ |
1458 | 1452 | function maybeMakeExternalImage( $url ) { |
1459 | | - $sk =& $this->mOptions->getSkin(); |
1460 | 1453 | $imagesfrom = $this->mOptions->getAllowExternalImagesFrom(); |
1461 | 1454 | $imagesexception = !empty($imagesfrom); |
1462 | 1455 | $text = false; |
— | — | @@ -1463,7 +1456,7 @@ |
1464 | 1457 | || ( $imagesexception && strpos( $url, $imagesfrom ) === 0 ) ) { |
1465 | 1458 | if ( preg_match( EXT_IMAGE_REGEX, $url ) ) { |
1466 | 1459 | # Image found |
1467 | | - $text = $sk->makeExternalImage( htmlspecialchars( $url ) ); |
| 1460 | + $text = Linker::makeExternalImage( htmlspecialchars( $url ) ); |
1468 | 1461 | } |
1469 | 1462 | } |
1470 | 1463 | return $text; |
— | — | @@ -1485,8 +1478,6 @@ |
1486 | 1479 | # the % is needed to support urlencoded titles as well |
1487 | 1480 | if ( !$tc ) { $tc = Title::legalChars() . '#%'; } |
1488 | 1481 | |
1489 | | - $sk =& $this->mOptions->getSkin(); |
1490 | | - |
1491 | 1482 | #split the entire text string on occurences of [[ |
1492 | 1483 | $a = explode( '[[', ' ' . $s ); |
1493 | 1484 | #get the first element (all text up to first [[), and remove the space we added |
— | — | @@ -1734,13 +1725,13 @@ |
1735 | 1726 | if( ( $nt->getPrefixedText() === $selflink ) && |
1736 | 1727 | ( $nt->getFragment() === '' ) ) { |
1737 | 1728 | # Self-links are handled specially; generally de-link and change to bold. |
1738 | | - $s .= $prefix . $sk->makeSelfLinkObj( $nt, $text, '', $trail ); |
| 1729 | + $s .= $prefix . Linker::makeSelfLinkObj( $nt, $text, '', $trail ); |
1739 | 1730 | continue; |
1740 | 1731 | } |
1741 | 1732 | |
1742 | 1733 | # Special and Media are pseudo-namespaces; no pages actually exist in them |
1743 | 1734 | if( $ns == NS_MEDIA ) { |
1744 | | - $link = $sk->makeMediaLinkObj( $nt, $text ); |
| 1735 | + $link = Linker::makeMediaLinkObj( $nt, $text ); |
1745 | 1736 | # Cloak with NOPARSE to avoid replacement in replaceExternalLinks |
1746 | 1737 | $s .= $prefix . $this->armorLinks( $link ) . $trail; |
1747 | 1738 | $this->mOutput->addImage( $nt->getDBkey() ); |
— | — | @@ -1815,8 +1806,7 @@ |
1816 | 1807 | */ |
1817 | 1808 | function makeKnownLinkHolder( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) { |
1818 | 1809 | list( $inside, $trail ) = Linker::splitTrail( $trail ); |
1819 | | - $sk =& $this->mOptions->getSkin(); |
1820 | | - $link = $sk->makeKnownLinkObj( $nt, $text, $query, $inside, $prefix ); |
| 1810 | + $link = Linker::makeKnownLinkObj( $nt, $text, $query, $inside, $prefix ); |
1821 | 1811 | return $this->armorLinks( $link ) . $trail; |
1822 | 1812 | } |
1823 | 1813 | |
— | — | @@ -3381,9 +3371,6 @@ |
3382 | 3372 | $enoughToc = false; |
3383 | 3373 | } |
3384 | 3374 | |
3385 | | - # We need this to perform operations on the HTML |
3386 | | - $sk =& $this->mOptions->getSkin(); |
3387 | | - |
3388 | 3375 | # headline counter |
3389 | 3376 | $headlineCount = 0; |
3390 | 3377 | $sectionCount = 0; # headlineCount excluding template sections |
— | — | @@ -3427,7 +3414,7 @@ |
3428 | 3415 | $toclevel++; |
3429 | 3416 | $sublevelCount[$toclevel] = 0; |
3430 | 3417 | if( $toclevel<$wgMaxTocLevel ) { |
3431 | | - $toc .= $sk->tocIndent(); |
| 3418 | + $toc .= Linker::tocIndent(); |
3432 | 3419 | } |
3433 | 3420 | } |
3434 | 3421 | elseif ( $level < $prevlevel && $toclevel > 1 ) { |
— | — | @@ -3451,13 +3438,13 @@ |
3452 | 3439 | } |
3453 | 3440 | } |
3454 | 3441 | if( $toclevel<$wgMaxTocLevel ) { |
3455 | | - $toc .= $sk->tocUnindent( $prevtoclevel - $toclevel ); |
| 3442 | + $toc .= Linker::tocUnindent( $prevtoclevel - $toclevel ); |
3456 | 3443 | } |
3457 | 3444 | } |
3458 | 3445 | else { |
3459 | 3446 | # No change in level, end TOC line |
3460 | 3447 | if( $toclevel<$wgMaxTocLevel ) { |
3461 | | - $toc .= $sk->tocLineEnd(); |
| 3448 | + $toc .= Linker::tocLineEnd(); |
3462 | 3449 | } |
3463 | 3450 | } |
3464 | 3451 | |
— | — | @@ -3517,7 +3504,7 @@ |
3518 | 3505 | $anchor .= '_' . $refcount[$headlineCount]; |
3519 | 3506 | } |
3520 | 3507 | if( $enoughToc && ( !isset($wgMaxTocLevel) || $toclevel<$wgMaxTocLevel ) ) { |
3521 | | - $toc .= $sk->tocLine($anchor, $tocline, $numbering, $toclevel); |
| 3508 | + $toc .= Linker::tocLine($anchor, $tocline, $numbering, $toclevel); |
3522 | 3509 | } |
3523 | 3510 | # give headline the correct <h#> tag |
3524 | 3511 | @$head[$headlineCount] .= "<a name=\"$anchor\"></a><h".$level.$matches[2][$headlineCount]; |
— | — | @@ -3527,9 +3514,9 @@ |
3528 | 3515 | $head[$headlineCount] = ''; |
3529 | 3516 | } |
3530 | 3517 | if( $istemplate ) |
3531 | | - $head[$headlineCount] .= $sk->editSectionLinkForOther($templatetitle, $templatesection); |
| 3518 | + $head[$headlineCount] .= Linker::editSectionLinkForOther($templatetitle, $templatesection); |
3532 | 3519 | else |
3533 | | - $head[$headlineCount] .= $sk->editSectionLink($this->mTitle, $sectionCount+1, $headline_hint); |
| 3520 | + $head[$headlineCount] .= Linker::editSectionLink($this->mTitle, $sectionCount+1, $headline_hint); |
3534 | 3521 | } |
3535 | 3522 | // Yes, the headline logically goes before the edit section. Why isn't it there |
3536 | 3523 | // in source? Ask the CSS people. The float gets screwed up if you do that. |
— | — | @@ -3544,9 +3531,9 @@ |
3545 | 3532 | |
3546 | 3533 | if( $enoughToc ) { |
3547 | 3534 | if( $toclevel<$wgMaxTocLevel ) { |
3548 | | - $toc .= $sk->tocUnindent( $toclevel - 1 ); |
| 3535 | + $toc .= Linker::tocUnindent( $toclevel - 1 ); |
3549 | 3536 | } |
3550 | | - $toc = $sk->tocList( $toc ); |
| 3537 | + $toc = Linker::tocList( $toc ); |
3551 | 3538 | } |
3552 | 3539 | |
3553 | 3540 | # split up and insert constructed headlines |
— | — | @@ -3561,7 +3548,7 @@ |
3562 | 3549 | |
3563 | 3550 | # Disabled because it broke block formatting |
3564 | 3551 | # For example, a bullet point in the top line |
3565 | | - # $full .= $sk->editSectionLink(0); |
| 3552 | + # $full .= Linker::editSectionLink(0); |
3566 | 3553 | } |
3567 | 3554 | $full .= $block; |
3568 | 3555 | if( $enoughToc && !$i && $isMain && !$this->mForceTocPosition ) { |
— | — | @@ -3904,7 +3891,7 @@ |
3905 | 3892 | |
3906 | 3893 | /** |
3907 | 3894 | * Replace <!--LINK--> link placeholders with actual links, in the buffer |
3908 | | - * Placeholders created in Skin::makeLinkObj() |
| 3895 | + * Placeholders created in Linker::makeLinkObj() |
3909 | 3896 | * Returns an array of links found, indexed by PDBK: |
3910 | 3897 | * 0 - broken |
3911 | 3898 | * 1 - normal link |
— | — | @@ -3921,7 +3908,6 @@ |
3922 | 3909 | |
3923 | 3910 | $pdbks = array(); |
3924 | 3911 | $colours = array(); |
3925 | | - $sk =& $this->mOptions->getSkin(); |
3926 | 3912 | $linkCache =& LinkCache::singleton(); |
3927 | 3913 | |
3928 | 3914 | if ( !empty( $this->mLinkHolders['namespaces'] ) ) { |
— | — | @@ -4102,15 +4088,15 @@ |
4103 | 4089 | $linkCache->addBadLinkObj( $title ); |
4104 | 4090 | $colours[$pdbk] = 0; |
4105 | 4091 | $this->mOutput->addLink( $title, 0 ); |
4106 | | - $wgOutputReplace[$searchkey] = $sk->makeBrokenLinkObj( $title, |
| 4092 | + $wgOutputReplace[$searchkey] = Linker::makeBrokenLinkObj( $title, |
4107 | 4093 | $this->mLinkHolders['texts'][$key], |
4108 | 4094 | $this->mLinkHolders['queries'][$key] ); |
4109 | 4095 | } elseif ( $colours[$pdbk] == 1 ) { |
4110 | | - $wgOutputReplace[$searchkey] = $sk->makeKnownLinkObj( $title, |
| 4096 | + $wgOutputReplace[$searchkey] = Linker::makeKnownLinkObj( $title, |
4111 | 4097 | $this->mLinkHolders['texts'][$key], |
4112 | 4098 | $this->mLinkHolders['queries'][$key] ); |
4113 | 4099 | } elseif ( $colours[$pdbk] == 2 ) { |
4114 | | - $wgOutputReplace[$searchkey] = $sk->makeStubLinkObj( $title, |
| 4100 | + $wgOutputReplace[$searchkey] = Linker::makeStubLinkObj( $title, |
4115 | 4101 | $this->mLinkHolders['texts'][$key], |
4116 | 4102 | $this->mLinkHolders['queries'][$key] ); |
4117 | 4103 | } |
— | — | @@ -4136,7 +4122,7 @@ |
4137 | 4123 | $wgOutputReplace = array(); |
4138 | 4124 | foreach( $this->mInterwikiLinkHolders['texts'] as $key => $link ) { |
4139 | 4125 | $title = $this->mInterwikiLinkHolders['titles'][$key]; |
4140 | | - $wgOutputReplace[$key] = $sk->makeLinkObj( $title, $link ); |
| 4126 | + $wgOutputReplace[$key] = Linker::makeLinkObj( $title, $link ); |
4141 | 4127 | } |
4142 | 4128 | |
4143 | 4129 | $text = preg_replace_callback( |
— | — | @@ -4216,7 +4202,6 @@ |
4217 | 4203 | $ig->setShowBytes( false ); |
4218 | 4204 | $ig->setShowFilename( false ); |
4219 | 4205 | $ig->setParsing(); |
4220 | | - $ig->useSkin( $this->mOptions->getSkin() ); |
4221 | 4206 | |
4222 | 4207 | if( isset( $params['caption'] ) ) |
4223 | 4208 | $ig->setCaption( $params['caption'] ); |
— | — | @@ -4345,8 +4330,7 @@ |
4346 | 4331 | $alt = Sanitizer::stripAllTags( $alt ); |
4347 | 4332 | |
4348 | 4333 | # Linker does the rest |
4349 | | - $sk =& $this->mOptions->getSkin(); |
4350 | | - return $sk->makeImageLinkObj( $nt, $caption, $alt, $align, $width, $height, $framed, $thumb, $manual_thumb, $page ); |
| 4334 | + return Linker::makeImageLinkObj( $nt, $caption, $alt, $align, $width, $height, $framed, $thumb, $manual_thumb, $page ); |
4351 | 4335 | } |
4352 | 4336 | |
4353 | 4337 | /** |
— | — | @@ -4682,7 +4666,6 @@ |
4683 | 4667 | var $mInterwikiMagic; # Interlanguage links are removed and returned in an array |
4684 | 4668 | var $mAllowExternalImages; # Allow external images inline |
4685 | 4669 | var $mAllowExternalImagesFrom; # If not, any exception? |
4686 | | - var $mSkin; # Reference to the preferred skin |
4687 | 4670 | var $mDateFormat; # Date format index |
4688 | 4671 | var $mEditSection; # Create "edit section" links |
4689 | 4672 | var $mNumberHeadings; # Automatically number headings |
— | — | @@ -4692,7 +4675,7 @@ |
4693 | 4676 | var $mMaxIncludeSize; # Maximum size of template expansions, in bytes |
4694 | 4677 | var $mRemoveComments; # Remove HTML comments. ONLY APPLIES TO PREPROCESS OPERATIONS |
4695 | 4678 | |
4696 | | - var $mUser; # Stored user object, just used to initialise the skin |
| 4679 | + var $mUser; # Stored user object, just used to initialise the date format |
4697 | 4680 | |
4698 | 4681 | function getUseTeX() { return $this->mUseTeX; } |
4699 | 4682 | function getUseDynamicDates() { return $this->mUseDynamicDates; } |
— | — | @@ -4707,13 +4690,6 @@ |
4708 | 4691 | function getMaxIncludeSize() { return $this->mMaxIncludeSize; } |
4709 | 4692 | function getRemoveComments() { return $this->mRemoveComments; } |
4710 | 4693 | |
4711 | | - function &getSkin() { |
4712 | | - if ( !isset( $this->mSkin ) ) { |
4713 | | - $this->mSkin = $this->mUser->getSkin(); |
4714 | | - } |
4715 | | - return $this->mSkin; |
4716 | | - } |
4717 | | - |
4718 | 4694 | function getDateFormat() { |
4719 | 4695 | if ( !isset( $this->mDateFormat ) ) { |
4720 | 4696 | $this->mDateFormat = $this->mUser->getDatePreference(); |
— | — | @@ -4731,7 +4707,6 @@ |
4732 | 4708 | function setNumberHeadings( $x ) { return wfSetVar( $this->mNumberHeadings, $x ); } |
4733 | 4709 | function setAllowSpecialInclusion( $x ) { return wfSetVar( $this->mAllowSpecialInclusion, $x ); } |
4734 | 4710 | function setTidy( $x ) { return wfSetVar( $this->mTidy, $x); } |
4735 | | - function setSkin( $x ) { $this->mSkin = $x; } |
4736 | 4711 | function setInterfaceMessage( $x ) { return wfSetVar( $this->mInterfaceMessage, $x); } |
4737 | 4712 | function setMaxIncludeSize( $x ) { return wfSetVar( $this->mMaxIncludeSize, $x ); } |
4738 | 4713 | function setRemoveComments( $x ) { return wfSetVar( $this->mRemoveComments, $x ); } |
— | — | @@ -4772,7 +4747,6 @@ |
4773 | 4748 | $this->mInterwikiMagic = $wgInterwikiMagic; |
4774 | 4749 | $this->mAllowExternalImages = $wgAllowExternalImages; |
4775 | 4750 | $this->mAllowExternalImagesFrom = $wgAllowExternalImagesFrom; |
4776 | | - $this->mSkin = null; # Deferred |
4777 | 4751 | $this->mDateFormat = null; # Deferred |
4778 | 4752 | $this->mEditSection = true; |
4779 | 4753 | $this->mNumberHeadings = $user->getOption( 'numberheadings' ); |
Index: trunk/phase3/includes/Credits.php |
— | — | @@ -171,9 +171,8 @@ |
172 | 172 | * |
173 | 173 | */ |
174 | 174 | function creditLink($user_name, $link_text = '') { |
175 | | - global $wgUser, $wgContLang; |
176 | | - $skin = $wgUser->getSkin(); |
177 | | - return $skin->makeLink($wgContLang->getNsText(NS_USER) . ':' . $user_name, |
| 175 | + global $wgContLang; |
| 176 | + return Linker::makeLink($wgContLang->getNsText(NS_USER) . ':' . $user_name, |
178 | 177 | htmlspecialchars( (empty($link_text)) ? $user_name : $link_text )); |
179 | 178 | } |
180 | 179 | |
— | — | @@ -181,9 +180,7 @@ |
182 | 181 | * |
183 | 182 | */ |
184 | 183 | function creditOthersLink($article) { |
185 | | - global $wgUser; |
186 | | - $skin = $wgUser->getSkin(); |
187 | | - return $skin->makeKnownLink($article->mTitle->getPrefixedText(), wfMsg('others'), 'action=credits'); |
| 184 | + return Linker::makeKnownLink($article->mTitle->getPrefixedText(), wfMsg('others'), 'action=credits'); |
188 | 185 | } |
189 | 186 | |
190 | 187 | ?> |
Index: trunk/phase3/includes/PageHistory.php |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | const DIR_PREV = 0; |
23 | 23 | const DIR_NEXT = 1; |
24 | 24 | |
25 | | - var $mArticle, $mTitle, $mSkin; |
| 25 | + var $mArticle, $mTitle; |
26 | 26 | var $lastdate; |
27 | 27 | var $linesonpage; |
28 | 28 | var $mNotificationTimestamp; |
— | — | @@ -34,12 +34,9 @@ |
35 | 35 | * @returns nothing |
36 | 36 | */ |
37 | 37 | function PageHistory($article) { |
38 | | - global $wgUser; |
39 | | - |
40 | 38 | $this->mArticle =& $article; |
41 | 39 | $this->mTitle =& $article->mTitle; |
42 | 40 | $this->mNotificationTimestamp = NULL; |
43 | | - $this->mSkin = $wgUser->getSkin(); |
44 | 41 | } |
45 | 42 | |
46 | 43 | /** |
— | — | @@ -71,7 +68,7 @@ |
72 | 69 | $wgOut->setSyndicated( true ); |
73 | 70 | |
74 | 71 | $logPage = SpecialPage::getTitleFor( 'Log' ); |
75 | | - $logLink = $this->mSkin->makeKnownLinkObj( $logPage, wfMsgHtml( 'viewpagelogs' ), 'page=' . $this->mTitle->getPrefixedUrl() ); |
| 72 | + $logLink = Linker::makeKnownLinkObj( $logPage, wfMsgHtml( 'viewpagelogs' ), 'page=' . $this->mTitle->getPrefixedUrl() ); |
76 | 73 | |
77 | 74 | $subtitle = wfMsgHtml( 'revhistory' ) . '<br />' . $logLink; |
78 | 75 | $wgOut->setSubtitle( $subtitle ); |
— | — | @@ -178,8 +175,8 @@ |
179 | 176 | $arbitrary = $this->diffButtons( $rev, $firstInList, $counter ); |
180 | 177 | $link = $this->revLink( $rev ); |
181 | 178 | |
182 | | - $user = $this->mSkin->userLink( $rev->getUser(), $rev->getUserText() ) |
183 | | - . $this->mSkin->userToolLinks( $rev->getUser(), $rev->getUserText() ); |
| 179 | + $user = Linker::userLink( $rev->getUser(), $rev->getUserText() ) |
| 180 | + . Linker::userToolLinks( $rev->getUser(), $rev->getUserText() ); |
184 | 181 | |
185 | 182 | $s .= "($curlink) ($lastlink) $arbitrary"; |
186 | 183 | |
— | — | @@ -189,7 +186,7 @@ |
190 | 187 | // We don't currently handle well changing the top revision's settings |
191 | 188 | $del = wfMsgHtml( 'rev-delundel' ); |
192 | 189 | } else { |
193 | | - $del = $this->mSkin->makeKnownLinkObj( $revdel, |
| 190 | + $del = Linker::makeKnownLinkObj( $revdel, |
194 | 191 | wfMsg( 'rev-delundel' ), |
195 | 192 | 'target=' . urlencode( $this->mTitle->getPrefixedDbkey() ) . |
196 | 193 | '&oldid=' . urlencode( $rev->getId() ) ); |
— | — | @@ -203,7 +200,7 @@ |
204 | 201 | $s .= ' ' . wfElement( 'span', array( 'class' => 'minor' ), wfMsg( 'minoreditletter') ); |
205 | 202 | } |
206 | 203 | |
207 | | - $s .= $this->mSkin->revComment( $rev ); |
| 204 | + $s .= Linker::revComment( $rev ); |
208 | 205 | if ($notificationtimestamp && ($row->rev_timestamp >= $notificationtimestamp)) { |
209 | 206 | $s .= ' <span class="updatedmarker">' . wfMsgHtml( 'updatedmarker' ) . '</span>'; |
210 | 207 | } |
— | — | @@ -220,7 +217,7 @@ |
221 | 218 | global $wgLang; |
222 | 219 | $date = $wgLang->timeanddate( wfTimestamp(TS_MW, $rev->getTimestamp()), true ); |
223 | 220 | if( $rev->userCan( Revision::DELETED_TEXT ) ) { |
224 | | - $link = $this->mSkin->makeKnownLinkObj( |
| 221 | + $link = Linker::makeKnownLinkObj( |
225 | 222 | $this->mTitle, $date, "oldid=" . $rev->getId() ); |
226 | 223 | } else { |
227 | 224 | $link = $date; |
— | — | @@ -237,7 +234,7 @@ |
238 | 235 | if( $latest || !$rev->userCan( Revision::DELETED_TEXT ) ) { |
239 | 236 | return $cur; |
240 | 237 | } else { |
241 | | - return $this->mSkin->makeKnownLinkObj( |
| 238 | + return Linker::makeKnownLinkObj( |
242 | 239 | $this->mTitle, $cur, |
243 | 240 | 'diff=' . $this->getLatestID() . |
244 | 241 | "&oldid=" . $rev->getId() ); |
— | — | @@ -252,14 +249,14 @@ |
253 | 250 | return $last; |
254 | 251 | } elseif ( $next === 'unknown' ) { |
255 | 252 | # Next row probably exists but is unknown, use an oldid=prev link |
256 | | - return $this->mSkin->makeKnownLinkObj( |
| 253 | + return Linker::makeKnownLinkObj( |
257 | 254 | $this->mTitle, |
258 | 255 | $last, |
259 | 256 | "diff=" . $rev->getId() . "&oldid=prev" ); |
260 | 257 | } elseif( !$rev->userCan( Revision::DELETED_TEXT ) ) { |
261 | 258 | return $last; |
262 | 259 | } else { |
263 | | - return $this->mSkin->makeKnownLinkObj( |
| 260 | + return Linker::makeKnownLinkObj( |
264 | 261 | $this->mTitle, |
265 | 262 | $last, |
266 | 263 | "diff=" . $rev->getId() . "&oldid={$next->rev_id}" |
Index: trunk/phase3/includes/QueryPage.php |
— | — | @@ -156,12 +156,11 @@ |
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
160 | | - * Formats the results of the query for display. The skin is the current |
161 | | - * skin; you can use it for making links. The result is a single row of |
162 | | - * result data. You should be able to grab SQL results off of it. |
| 160 | + * Formats the results of the query for display. The result is a single |
| 161 | + * row of result data. You should be able to grab SQL results off of it. |
163 | 162 | * If the function return "false", the line output will be skipped. |
164 | 163 | */ |
165 | | - function formatResult( $skin, $result ) { |
| 164 | + function formatResult( $result ) { |
166 | 165 | return ''; |
167 | 166 | } |
168 | 167 | |
— | — | @@ -275,7 +274,7 @@ |
276 | 275 | * @param $shownavigation show navigation like "next 200"? |
277 | 276 | */ |
278 | 277 | function doQuery( $offset, $limit, $shownavigation=true ) { |
279 | | - global $wgUser, $wgOut, $wgLang, $wgContLang; |
| 278 | + global $wgOut, $wgLang, $wgContLang; |
280 | 279 | |
281 | 280 | $this->offset = $offset; |
282 | 281 | $this->limit = $limit; |
— | — | @@ -321,8 +320,6 @@ |
322 | 321 | |
323 | 322 | $this->preprocessResults( $dbr, $res ); |
324 | 323 | |
325 | | - $sk = $wgUser->getSkin( ); |
326 | | - |
327 | 324 | if($shownavigation) { |
328 | 325 | $wgOut->addHTML( $this->getPageHeader() ); |
329 | 326 | $top = wfShowingResults( $offset, $num); |
— | — | @@ -343,7 +340,7 @@ |
344 | 341 | |
345 | 342 | # Only read at most $num rows, because $res may contain the whole 1000 |
346 | 343 | for ( $i = 0; $i < $num && $obj = $dbr->fetchObject( $res ); $i++ ) { |
347 | | - $format = $this->formatResult( $sk, $obj ); |
| 344 | + $format = $this->formatResult( $obj ); |
348 | 345 | if ( $format ) { |
349 | 346 | $attr = ( isset ( $obj->usepatrol ) && $obj->usepatrol && |
350 | 347 | $obj->patrolled == 0 ) ? ' class="not-patrolled"' : ''; |
— | — | @@ -354,7 +351,7 @@ |
355 | 352 | if($this->tryLastResult()) { |
356 | 353 | // flush the very last result |
357 | 354 | $obj = null; |
358 | | - $format = $this->formatResult( $sk, $obj ); |
| 355 | + $format = $this->formatResult( $obj ); |
359 | 356 | if( $format ) { |
360 | 357 | $attr = ( isset ( $obj->usepatrol ) && $obj->usepatrol && |
361 | 358 | $obj->patrolled == 0 ) ? ' class="not-patrolled"' : ''; |
— | — | @@ -473,10 +470,10 @@ |
474 | 471 | */ |
475 | 472 | class PageQueryPage extends QueryPage { |
476 | 473 | |
477 | | - function formatResult( $skin, $result ) { |
| 474 | + function formatResult( $result ) { |
478 | 475 | global $wgContLang; |
479 | 476 | $nt = Title::makeTitle( $result->namespace, $result->title ); |
480 | | - return $skin->makeKnownLinkObj( $nt, htmlspecialchars( $wgContLang->convert( $nt->getPrefixedText() ) ) ); |
| 477 | + return Linker::makeKnownLinkObj( $nt, htmlspecialchars( $wgContLang->convert( $nt->getPrefixedText() ) ) ); |
481 | 478 | } |
482 | 479 | } |
483 | 480 | |
Index: trunk/phase3/includes/SpecialContributions.php |
— | — | @@ -291,9 +291,8 @@ |
292 | 292 | |
293 | 293 | $wgOut->addHTML( "<ul>\n" ); |
294 | 294 | |
295 | | - $sk = $wgUser->getSkin(); |
296 | 295 | foreach ( $contribs as $contrib ) |
297 | | - $wgOut->addHTML( ucListEdit( $sk, $contrib ) ); |
| 296 | + $wgOut->addHTML( ucListEdit( $contrib ) ); |
298 | 297 | |
299 | 298 | $wgOut->addHTML( "</ul>\n" ); |
300 | 299 | $wgOut->addHTML( "<p>{$prevnextbits}</p>\n" ); |
— | — | @@ -306,27 +305,26 @@ |
307 | 306 | function contributionsSub( $nt ) { |
308 | 307 | global $wgSysopUserBans, $wgLang, $wgUser; |
309 | 308 | |
310 | | - $sk = $wgUser->getSkin(); |
311 | 309 | $id = User::idFromName( $nt->getText() ); |
312 | 310 | |
313 | 311 | if ( 0 == $id ) { |
314 | 312 | $ul = $nt->getText(); |
315 | 313 | } else { |
316 | | - $ul = $sk->makeLinkObj( $nt, htmlspecialchars( $nt->getText() ) ); |
| 314 | + $ul = Linker::makeLinkObj( $nt, htmlspecialchars( $nt->getText() ) ); |
317 | 315 | } |
318 | 316 | $talk = $nt->getTalkPage(); |
319 | 317 | if( $talk ) { |
320 | 318 | # Talk page link |
321 | | - $tools[] = $sk->makeLinkObj( $talk, $wgLang->getNsText( NS_TALK ) ); |
| 319 | + $tools[] = Linker::makeLinkObj( $talk, $wgLang->getNsText( NS_TALK ) ); |
322 | 320 | if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && User::isIP( $nt->getText() ) ) ) { |
323 | 321 | # Block link |
324 | 322 | if( $wgUser->isAllowed( 'block' ) ) |
325 | | - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ), wfMsgHtml( 'blocklink' ) ); |
| 323 | + $tools[] = Linker::makeKnownLinkObj( SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ), wfMsgHtml( 'blocklink' ) ); |
326 | 324 | # Block log link |
327 | | - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), htmlspecialchars( LogPage::logName( 'block' ) ), 'type=block&page=' . $nt->getPrefixedUrl() ); |
| 325 | + $tools[] = Linker::makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), htmlspecialchars( LogPage::logName( 'block' ) ), 'type=block&page=' . $nt->getPrefixedUrl() ); |
328 | 326 | } |
329 | 327 | # Other logs link |
330 | | - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsgHtml( 'log' ), 'user=' . $nt->getPartialUrl() ); |
| 328 | + $tools[] = Linker::makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsgHtml( 'log' ), 'user=' . $nt->getPartialUrl() ); |
331 | 329 | $ul .= ' (' . implode( ' | ', $tools ) . ')'; |
332 | 330 | } |
333 | 331 | return $ul; |
— | — | @@ -377,7 +375,7 @@ |
378 | 376 | * |
379 | 377 | * @todo This would probably look a lot nicer in a table. |
380 | 378 | */ |
381 | | -function ucListEdit( $sk, $row ) { |
| 379 | +function ucListEdit( $row ) { |
382 | 380 | $fname = 'ucListEdit'; |
383 | 381 | wfProfileIn( $fname ); |
384 | 382 | |
— | — | @@ -392,12 +390,12 @@ |
393 | 391 | $rev = new Revision( $row ); |
394 | 392 | |
395 | 393 | $page = Title::makeTitle( $row->page_namespace, $row->page_title ); |
396 | | - $link = $sk->makeKnownLinkObj( $page ); |
| 394 | + $link = Linker::makeKnownLinkObj( $page ); |
397 | 395 | $difftext = $topmarktext = ''; |
398 | 396 | if( $row->rev_id == $row->page_latest ) { |
399 | 397 | $topmarktext .= '<strong>' . $messages['uctop'] . '</strong>'; |
400 | 398 | if( !$row->page_is_new ) { |
401 | | - $difftext .= '(' . $sk->makeKnownLinkObj( $page, $messages['diff'], 'diff=0' ) . ')'; |
| 399 | + $difftext .= '(' . Linker::makeKnownLinkObj( $page, $messages['diff'], 'diff=0' ) . ')'; |
402 | 400 | } else { |
403 | 401 | $difftext .= $messages['newarticle']; |
404 | 402 | } |
— | — | @@ -406,20 +404,20 @@ |
407 | 405 | $extraRollback = $wgRequest->getBool( 'bot' ) ? '&bot=1' : ''; |
408 | 406 | $extraRollback .= '&token=' . urlencode( |
409 | 407 | $wgUser->editToken( array( $page->getPrefixedText(), $row->rev_user_text ) ) ); |
410 | | - $topmarktext .= ' ['. $sk->makeKnownLinkObj( $page, |
| 408 | + $topmarktext .= ' ['. Linker::makeKnownLinkObj( $page, |
411 | 409 | $messages['rollbacklink'], |
412 | 410 | 'action=rollback&from=' . urlencode( $row->rev_user_text ) . $extraRollback ) .']'; |
413 | 411 | } |
414 | 412 | |
415 | 413 | } |
416 | 414 | if( $rev->userCan( Revision::DELETED_TEXT ) ) { |
417 | | - $difftext = '(' . $sk->makeKnownLinkObj( $page, $messages['diff'], 'diff=prev&oldid='.$row->rev_id ) . ')'; |
| 415 | + $difftext = '(' . Linker::makeKnownLinkObj( $page, $messages['diff'], 'diff=prev&oldid='.$row->rev_id ) . ')'; |
418 | 416 | } else { |
419 | 417 | $difftext = '(' . $messages['diff'] . ')'; |
420 | 418 | } |
421 | | - $histlink='('.$sk->makeKnownLinkObj( $page, $messages['hist'], 'action=history' ) . ')'; |
| 419 | + $histlink = '(' . Linker::makeKnownLinkObj( $page, $messages['hist'], 'action=history' ) . ')'; |
422 | 420 | |
423 | | - $comment = $sk->revComment( $rev ); |
| 421 | + $comment = Linker::revComment( $rev ); |
424 | 422 | $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true ); |
425 | 423 | |
426 | 424 | if( $rev->isDeleted( Revision::DELETED_TEXT ) ) { |
Index: trunk/phase3/includes/LogPage.php |
— | — | @@ -130,7 +130,7 @@ |
131 | 131 | /** |
132 | 132 | * @static |
133 | 133 | */ |
134 | | - function actionText( $type, $action, $title = NULL, $skin = NULL, $params = array(), $filterWikilinks=false, $translate=false ) { |
| 134 | + static function actionText( $type, $action, $title = NULL, $forContent = true, $params = array(), $filterWikilinks=false, $translate=false ) { |
135 | 135 | global $wgLang, $wgContLang, $wgLogActions; |
136 | 136 | |
137 | 137 | $key = "$type/$action"; |
— | — | @@ -138,37 +138,35 @@ |
139 | 139 | if( is_null( $title ) ) { |
140 | 140 | $rv=wfMsg( $wgLogActions[$key] ); |
141 | 141 | } else { |
142 | | - if( $skin ) { |
143 | | - |
| 142 | + if( $forContent ) { |
| 143 | + $titleLink = $title->getPrefixedText(); |
| 144 | + } else { |
144 | 145 | switch( $type ) { |
145 | 146 | case 'move': |
146 | | - $titleLink = $skin->makeLinkObj( $title, $title->getPrefixedText(), 'redirect=no' ); |
147 | | - $params[0] = $skin->makeLinkObj( Title::newFromText( $params[0] ), $params[0] ); |
| 147 | + $titleLink = Linker::makeLinkObj( $title, $title->getPrefixedText(), 'redirect=no' ); |
| 148 | + $params[0] = Linker::makeLinkObj( Title::newFromText( $params[0] ), $params[0] ); |
148 | 149 | break; |
149 | 150 | case 'block': |
150 | 151 | if( substr( $title->getText(), 0, 1 ) == '#' ) { |
151 | 152 | $titleLink = $title->getText(); |
152 | 153 | } else { |
153 | | - $titleLink = $skin->makeLinkObj( $title, $title->getText() ); |
154 | | - $titleLink .= ' (' . $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Contributions', $title->getDBkey() ), wfMsg( 'contribslink' ) ) . ')'; |
| 154 | + $titleLink = Linker::makeLinkObj( $title, $title->getText() ); |
| 155 | + $titleLink .= ' (' . Linker::makeKnownLinkObj( SpecialPage::getTitleFor( 'Contributions', $title->getDBkey() ), wfMsg( 'contribslink' ) ) . ')'; |
155 | 156 | } |
156 | 157 | break; |
157 | 158 | case 'rights': |
158 | 159 | $text = $wgContLang->ucfirst( $title->getText() ); |
159 | | - $titleLink = $skin->makeLinkObj( Title::makeTitle( NS_USER, $text ) ); |
| 160 | + $titleLink = Linker::makeLinkObj( Title::makeTitle( NS_USER, $text ) ); |
160 | 161 | break; |
161 | 162 | default: |
162 | | - $titleLink = $skin->makeLinkObj( $title ); |
| 163 | + $titleLink = Linker::makeLinkObj( $title ); |
163 | 164 | } |
164 | | - |
165 | | - } else { |
166 | | - $titleLink = $title->getPrefixedText(); |
167 | 165 | } |
168 | 166 | if( $key == 'rights/rights' ) { |
169 | | - if ($skin) { |
170 | | - $rightsnone = wfMsg( 'rightsnone' ); |
171 | | - } else { |
| 167 | + if( $forContent ) { |
172 | 168 | $rightsnone = wfMsgForContent( 'rightsnone' ); |
| 169 | + } else { |
| 170 | + $rightsnone = wfMsg( 'rightsnone' ); |
173 | 171 | } |
174 | 172 | if( !isset( $params[0] ) || trim( $params[0] ) == '' ) |
175 | 173 | $params[0] = $rightsnone; |
— | — | @@ -176,17 +174,17 @@ |
177 | 175 | $params[1] = $rightsnone; |
178 | 176 | } |
179 | 177 | if( count( $params ) == 0 ) { |
180 | | - if ( $skin ) { |
181 | | - $rv = wfMsg( $wgLogActions[$key], $titleLink ); |
182 | | - } else { |
| 178 | + if ( $forContent ) { |
183 | 179 | $rv = wfMsgForContent( $wgLogActions[$key], $titleLink ); |
| 180 | + } else { |
| 181 | + $rv = wfMsg( $wgLogActions[$key], $titleLink ); |
184 | 182 | } |
185 | 183 | } else { |
186 | 184 | array_unshift( $params, $titleLink ); |
187 | 185 | if ( $translate && $key == 'block/block' ) { |
188 | 186 | $params[1] = $wgLang->translateBlockExpiry($params[1]); |
189 | 187 | } |
190 | | - $rv = wfMsgReal( $wgLogActions[$key], $params, true, !$skin ); |
| 188 | + $rv = wfMsgReal( $wgLogActions[$key], $params, true, $forContent ); |
191 | 189 | } |
192 | 190 | } |
193 | 191 | } else { |
— | — | @@ -194,8 +192,8 @@ |
195 | 193 | $rv = "$action"; |
196 | 194 | } |
197 | 195 | if( $filterWikilinks ) { |
198 | | - $rv = str_replace( "[[", "", $rv ); |
199 | | - $rv = str_replace( "]]", "", $rv ); |
| 196 | + $rv = str_replace( '[[', '', $rv ); |
| 197 | + $rv = str_replace( ']]', '', $rv ); |
200 | 198 | } |
201 | 199 | return $rv; |
202 | 200 | } |
— | — | @@ -215,9 +213,9 @@ |
216 | 214 | $this->action = $action; |
217 | 215 | $this->target = $target; |
218 | 216 | $this->comment = $comment; |
219 | | - $this->params = LogPage::makeParamBlob( $params ); |
| 217 | + $this->params = self::makeParamBlob( $params ); |
220 | 218 | |
221 | | - $this->actionText = LogPage::actionText( $this->type, $action, $target, NULL, $params ); |
| 219 | + $this->actionText = self::actionText( $this->type, $action, $target, true, $params ); |
222 | 220 | |
223 | 221 | return $this->saveContent(); |
224 | 222 | } |
— | — | @@ -226,7 +224,7 @@ |
227 | 225 | * Create a blob from a parameter array |
228 | 226 | * @static |
229 | 227 | */ |
230 | | - function makeParamBlob( $params ) { |
| 228 | + static function makeParamBlob( $params ) { |
231 | 229 | return implode( "\n", $params ); |
232 | 230 | } |
233 | 231 | |
— | — | @@ -234,7 +232,7 @@ |
235 | 233 | * Extract a parameter array from a blob |
236 | 234 | * @static |
237 | 235 | */ |
238 | | - function extractParams( $blob ) { |
| 236 | + static function extractParams( $blob ) { |
239 | 237 | if ( $blob === '' ) { |
240 | 238 | return array(); |
241 | 239 | } else { |
Index: trunk/phase3/includes/SpecialShortpages.php |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | return false; |
62 | 62 | } |
63 | 63 | |
64 | | - function formatResult( $skin, $result ) { |
| 64 | + function formatResult( $result ) { |
65 | 65 | global $wgLang, $wgContLang; |
66 | 66 | $dm = $wgContLang->getDirMark(); |
67 | 67 | |
— | — | @@ -68,10 +68,10 @@ |
69 | 69 | if ( !$title ) { |
70 | 70 | return '<!-- Invalid title ' . htmlspecialchars( "{$result->namespace}:{$result->title}" ). '-->'; |
71 | 71 | } |
72 | | - $hlink = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' ); |
| 72 | + $hlink = Linker::makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' ); |
73 | 73 | $plink = $this->isCached() |
74 | | - ? $skin->makeLinkObj( $title ) |
75 | | - : $skin->makeKnownLinkObj( $title ); |
| 74 | + ? Linker::makeLinkObj( $title ) |
| 75 | + : Linker::makeKnownLinkObj( $title ); |
76 | 76 | $size = wfMsgHtml( 'nbytes', $wgLang->formatNum( htmlspecialchars( $result->value ) ) ); |
77 | 77 | |
78 | 78 | return $title->exists() |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -820,8 +820,6 @@ |
821 | 821 | $fname = 'EditPage::showEditForm'; |
822 | 822 | wfProfileIn( $fname ); |
823 | 823 | |
824 | | - $sk =& $wgUser->getSkin(); |
825 | | - |
826 | 824 | wfRunHooks( 'EditPage::showEditForm:initial', array( &$this ) ) ; |
827 | 825 | |
828 | 826 | $wgOut->setRobotpolicy( 'noindex,nofollow' ); |
— | — | @@ -943,7 +941,7 @@ |
944 | 942 | $minor = wfMsgExt('minoredit', array('parseinline')); |
945 | 943 | $watchthis = wfMsgExt('watchthis', array('parseinline')); |
946 | 944 | |
947 | | - $cancel = $sk->makeKnownLink( $this->mTitle->getPrefixedText(), |
| 945 | + $cancel = Linker::makeKnownLink( $this->mTitle->getPrefixedText(), |
948 | 946 | wfMsgExt('cancel', array('parseinline')) ); |
949 | 947 | $edithelpurl = Skin::makeInternalOrExternalUrl( wfMsgForContent( 'edithelppage' )); |
950 | 948 | $edithelp = '<a target="helpwindow" href="'.$edithelpurl.'">'. |
— | — | @@ -1254,13 +1252,9 @@ |
1255 | 1253 | * Prepare a list of templates used by this page. Returns HTML. |
1256 | 1254 | */ |
1257 | 1255 | function formatTemplates() { |
1258 | | - global $wgUser; |
1259 | | - |
1260 | 1256 | $fname = 'EditPage::formatTemplates'; |
1261 | 1257 | wfProfileIn( $fname ); |
1262 | 1258 | |
1263 | | - $sk =& $wgUser->getSkin(); |
1264 | | - |
1265 | 1259 | $outText = ''; |
1266 | 1260 | $templates = $this->mArticle->getUsedTemplates(); |
1267 | 1261 | if ( count( $templates ) > 0 ) { |
— | — | @@ -1276,7 +1270,7 @@ |
1277 | 1271 | wfMsgExt( 'templatesused', array( 'parse' ) ) . |
1278 | 1272 | '</div><ul>'; |
1279 | 1273 | foreach ( $templates as $titleObj ) { |
1280 | | - $outText .= '<li>' . $sk->makeLinkObj( $titleObj ) . '</li>'; |
| 1274 | + $outText .= '<li>' . Linker::makeLinkObj( $titleObj ) . '</li>'; |
1281 | 1275 | } |
1282 | 1276 | $outText .= '</ul>'; |
1283 | 1277 | } |
— | — | @@ -1436,11 +1430,10 @@ |
1437 | 1431 | * Produce the stock "please login to edit pages" page |
1438 | 1432 | */ |
1439 | 1433 | function userNotLoggedInPage() { |
1440 | | - global $wgUser, $wgOut; |
1441 | | - $skin = $wgUser->getSkin(); |
| 1434 | + global $wgOut; |
1442 | 1435 | |
1443 | 1436 | $loginTitle = SpecialPage::getTitleFor( 'Userlogin' ); |
1444 | | - $loginLink = $skin->makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $this->mTitle->getPrefixedUrl() ); |
| 1437 | + $loginLink = Linker::makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $this->mTitle->getPrefixedUrl() ); |
1445 | 1438 | |
1446 | 1439 | $wgOut->setPageTitle( wfMsg( 'whitelistedittitle' ) ); |
1447 | 1440 | $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
Index: trunk/phase3/includes/SpecialWantedcategories.php |
— | — | @@ -55,15 +55,15 @@ |
56 | 56 | $db->dataSeek( $res, 0 ); |
57 | 57 | } |
58 | 58 | |
59 | | - function formatResult( $skin, $result ) { |
| 59 | + function formatResult( $result ) { |
60 | 60 | global $wgLang, $wgContLang; |
61 | 61 | |
62 | 62 | $nt = Title::makeTitle( $result->namespace, $result->title ); |
63 | 63 | $text = $wgContLang->convert( $nt->getText() ); |
64 | 64 | |
65 | 65 | $plink = $this->isCached() ? |
66 | | - $skin->makeLinkObj( $nt, htmlspecialchars( $text ) ) : |
67 | | - $skin->makeBrokenLinkObj( $nt, htmlspecialchars( $text ) ); |
| 66 | + Linker::makeLinkObj( $nt, htmlspecialchars( $text ) ) : |
| 67 | + Linker::makeBrokenLinkObj( $nt, htmlspecialchars( $text ) ); |
68 | 68 | |
69 | 69 | $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'), |
70 | 70 | $wgLang->formatNum( $result->value ) ); |
Index: trunk/phase3/includes/SpecialUncategorizedimages.php |
— | — | @@ -37,11 +37,11 @@ |
38 | 38 | WHERE cl_from IS NULL AND page_namespace = {$ns} AND page_is_redirect = 0"; |
39 | 39 | } |
40 | 40 | |
41 | | - function formatResult( &$skin, $row ) { |
| 41 | + function formatResult( $row ) { |
42 | 42 | global $wgContLang; |
43 | 43 | $title = Title::makeTitleSafe( NS_IMAGE, $row->title ); |
44 | 44 | $label = htmlspecialchars( $wgContLang->convert( $title->getText() ) ); |
45 | | - return $skin->makeKnownLinkObj( $title, $label ); |
| 45 | + return Linker::makeKnownLinkObj( $title, $label ); |
46 | 46 | } |
47 | 47 | |
48 | 48 | } |
Index: trunk/phase3/includes/SpecialUnusedimages.php |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | | - function formatResult( $skin, $result ) { |
| 44 | + function formatResult( $result ) { |
45 | 45 | global $wgLang, $wgContLang; |
46 | 46 | $title = Title::makeTitle( NS_IMAGE, $result->title ); |
47 | 47 | |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | |
51 | 51 | $return = |
52 | 52 | # The 'desc' linking to the image page |
53 | | - '('.$skin->makeKnownLinkObj( $title, wfMsg('imgdesc') ).') ' . $dirmark . |
| 53 | + '('.Linker::makeKnownLinkObj( $title, wfMsg('imgdesc') ).') ' . $dirmark . |
54 | 54 | |
55 | 55 | # Link to the image itself |
56 | 56 | '<a href="' . $imageUrl . '">' . htmlspecialchars( $title->getText() ) . |
— | — | @@ -59,11 +59,11 @@ |
60 | 60 | $wgLang->timeanddate($result->value) . ' . . ' . $dirmark . |
61 | 61 | |
62 | 62 | # Link to username |
63 | | - $skin->makeLinkObj( Title::makeTitle( NS_USER, $result->img_user_text ), |
| 63 | + Linker::makeLinkObj( Title::makeTitle( NS_USER, $result->img_user_text ), |
64 | 64 | $result->img_user_text) . $dirmark . |
65 | 65 | |
66 | 66 | # If there is a description, show it |
67 | | - $skin->commentBlock( $wgContLang->convert( $result->img_description ) ); |
| 67 | + Linker::commentBlock( $wgContLang->convert( $result->img_description ) ); |
68 | 68 | |
69 | 69 | return $return; |
70 | 70 | } |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -231,7 +231,7 @@ |
232 | 232 | * Add an array of categories, with names in the keys |
233 | 233 | */ |
234 | 234 | public function addCategoryLinks($categories) { |
235 | | - global $wgUser, $wgContLang; |
| 235 | + global $wgContLang; |
236 | 236 | |
237 | 237 | if ( !is_array( $categories ) ) { |
238 | 238 | return; |
— | — | @@ -242,11 +242,10 @@ |
243 | 243 | $lb->setArray( $arr ); |
244 | 244 | $lb->execute(); |
245 | 245 | |
246 | | - $sk =& $wgUser->getSkin(); |
247 | 246 | foreach ( $categories as $category => $arbitrary ) { |
248 | 247 | $title = Title::makeTitleSafe( NS_CATEGORY, $category ); |
249 | 248 | $text = $wgContLang->convertHtml( $title->getText() ); |
250 | | - $this->mCategoryLinks[] = $sk->makeLinkObj( $title, $text ); |
| 249 | + $this->mCategoryLinks[] = Linker::makeLinkObj( $title, $text ); |
251 | 250 | } |
252 | 251 | } |
253 | 252 | |
— | — | @@ -615,9 +614,6 @@ |
616 | 615 | # Buffer output; final headers may depend on later processing |
617 | 616 | ob_start(); |
618 | 617 | |
619 | | - # Disable temporary placeholders, so that the skin produces HTML |
620 | | - $sk->postParseLinkColour( false ); |
621 | | - |
622 | 618 | $wgRequest->response()->header( "Content-type: $wgMimeType; charset={$wgOutputEncoding}" ); |
623 | 619 | $wgRequest->response()->header( 'Content-language: '.$wgContLanguageCode ); |
624 | 620 | |
— | — | @@ -760,7 +756,7 @@ |
761 | 757 | * @param string $permission key required |
762 | 758 | */ |
763 | 759 | public function permissionRequired( $permission ) { |
764 | | - global $wgGroupPermissions, $wgUser; |
| 760 | + global $wgGroupPermissions; |
765 | 761 | |
766 | 762 | $this->setPageTitle( wfMsg( 'badaccess' ) ); |
767 | 763 | $this->setHTMLTitle( wfMsg( 'errorpagetitle' ) ); |
— | — | @@ -774,8 +770,7 @@ |
775 | 771 | $groupName = User::getGroupName( $key ); |
776 | 772 | $groupPage = User::getGroupPage( $key ); |
777 | 773 | if( $groupPage ) { |
778 | | - $skin =& $wgUser->getSkin(); |
779 | | - $groups[] = '"'.$skin->makeLinkObj( $groupPage, $groupName ).'"'; |
| 774 | + $groups[] = '"'.Linker::makeLinkObj( $groupPage, $groupName ).'"'; |
780 | 775 | } else { |
781 | 776 | $groups[] = '"'.$groupName.'"'; |
782 | 777 | } |
— | — | @@ -823,15 +818,13 @@ |
824 | 819 | return; |
825 | 820 | } |
826 | 821 | |
827 | | - $skin = $wgUser->getSkin(); |
828 | | - |
829 | 822 | $this->setPageTitle( wfMsg( 'loginreqtitle' ) ); |
830 | 823 | $this->setHtmlTitle( wfMsg( 'errorpagetitle' ) ); |
831 | 824 | $this->setRobotPolicy( 'noindex,nofollow' ); |
832 | 825 | $this->setArticleFlag( false ); |
833 | 826 | |
834 | 827 | $loginTitle = SpecialPage::getTitleFor( 'Userlogin' ); |
835 | | - $loginLink = $skin->makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $wgTitle->getPrefixedUrl() ); |
| 828 | + $loginLink = Linker::makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $wgTitle->getPrefixedUrl() ); |
836 | 829 | $this->addHtml( wfMsgWikiHtml( 'loginreqpagetext', $loginLink ) ); |
837 | 830 | $this->addHtml( "\n<!--" . $wgTitle->getPrefixedUrl() . "-->" ); |
838 | 831 | |
— | — | @@ -859,9 +852,8 @@ |
860 | 853 | $this->setArticleRelated( false ); |
861 | 854 | |
862 | 855 | if( $protected ) { |
863 | | - $skin = $wgUser->getSkin(); |
864 | 856 | $this->setPageTitle( wfMsg( 'viewsource' ) ); |
865 | | - $this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) ); |
| 857 | + $this->setSubtitle( wfMsg( 'viewsourcefor', Linker::makeKnownLinkObj( $wgTitle ) ) ); |
866 | 858 | |
867 | 859 | # Determine if protection is due to the page being a system message |
868 | 860 | # and show an appropriate explanation |
— | — | @@ -965,7 +957,7 @@ |
966 | 958 | * @param $returnto page title to return to. Default is Main Page. |
967 | 959 | */ |
968 | 960 | public function returnToMain( $auto = true, $returnto = NULL ) { |
969 | | - global $wgUser, $wgOut, $wgRequest; |
| 961 | + global $wgOut, $wgRequest; |
970 | 962 | |
971 | 963 | if ( $returnto == NULL ) { |
972 | 964 | $returnto = $wgRequest->getText( 'returnto' ); |
— | — | @@ -984,8 +976,7 @@ |
985 | 977 | $titleObj = Title::newMainPage(); |
986 | 978 | } |
987 | 979 | |
988 | | - $sk = $wgUser->getSkin(); |
989 | | - $link = $sk->makeLinkObj( $titleObj, '' ); |
| 980 | + $link = Linker::makeLinkObj( $titleObj, '' ); |
990 | 981 | |
991 | 982 | $r = wfMsg( 'returnto', $link ); |
992 | 983 | if ( $auto ) { |
Index: trunk/phase3/includes/Pager.php |
— | — | @@ -225,7 +225,7 @@ |
226 | 226 | if ( $query === null ) { |
227 | 227 | return $text; |
228 | 228 | } else { |
229 | | - return $this->getSkin()->makeKnownLinkObj( $this->getTitle(), $text, |
| 229 | + return Linker::makeKnownLinkObj( $this->getTitle(), $text, |
230 | 230 | wfArrayToCGI( $query, $this->getDefaultQuery() ) ); |
231 | 231 | } |
232 | 232 | } |
— | — | @@ -262,17 +262,6 @@ |
263 | 263 | } |
264 | 264 | |
265 | 265 | /** |
266 | | - * Get the current skin. This can be overridden if necessary. |
267 | | - */ |
268 | | - function getSkin() { |
269 | | - if ( !isset( $this->mSkin ) ) { |
270 | | - global $wgUser; |
271 | | - $this->mSkin = $wgUser->getSkin(); |
272 | | - } |
273 | | - return $this->mSkin; |
274 | | - } |
275 | | - |
276 | | - /** |
277 | 266 | * Get an array of query parameters that should be put into self-links. |
278 | 267 | * By default, all parameters passed in the URL are used, except for a |
279 | 268 | * short blacklist. |
Index: trunk/phase3/includes/SpecialAncientpages.php |
— | — | @@ -44,12 +44,12 @@ |
45 | 45 | return false; |
46 | 46 | } |
47 | 47 | |
48 | | - function formatResult( $skin, $result ) { |
| 48 | + function formatResult( $result ) { |
49 | 49 | global $wgLang, $wgContLang; |
50 | 50 | |
51 | 51 | $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true ); |
52 | 52 | $title = Title::makeTitle( $result->namespace, $result->title ); |
53 | | - $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) ); |
| 53 | + $link = Linker::makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) ); |
54 | 54 | return wfSpecialList($link, $d); |
55 | 55 | } |
56 | 56 | } |
Index: trunk/phase3/includes/SpecialWatchlist.php |
— | — | @@ -22,14 +22,13 @@ |
23 | 23 | global $wgEnotifWatchlist; |
24 | 24 | $fname = 'wfSpecialWatchlist'; |
25 | 25 | |
26 | | - $skin =& $wgUser->getSkin(); |
27 | 26 | $specialTitle = SpecialPage::getTitleFor( 'Watchlist' ); |
28 | 27 | $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
29 | 28 | |
30 | 29 | # Anons don't get a watchlist |
31 | 30 | if( $wgUser->isAnon() ) { |
32 | 31 | $wgOut->setPageTitle( wfMsg( 'watchnologin' ) ); |
33 | | - $llink = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Userlogin' ), wfMsgHtml( 'loginreqlink' ), 'returnto=' . $specialTitle->getPrefixedUrl() ); |
| 32 | + $llink = Linker::makeKnownLinkObj( SpecialPage::getTitleFor( 'Userlogin' ), wfMsgHtml( 'loginreqlink' ), 'returnto=' . $specialTitle->getPrefixedUrl() ); |
34 | 33 | $wgOut->addHtml( wfMsgWikiHtml( 'watchlistanontext', $llink ) ); |
35 | 34 | return; |
36 | 35 | } else { |
— | — | @@ -190,8 +189,6 @@ |
191 | 190 | $linkBatch->execute(); |
192 | 191 | if( $dbr->numRows( $res ) > 0 ) |
193 | 192 | $dbr->dataSeek( $res, 0 ); # Let's do the time warp again! |
194 | | - |
195 | | - $sk = $wgUser->getSkin(); |
196 | 193 | |
197 | 194 | $list = array(); |
198 | 195 | while( $s = $dbr->fetchObject( $res ) ) { |
— | — | @@ -216,10 +213,10 @@ |
217 | 214 | global $wgContLang; |
218 | 215 | $toolLinks = array(); |
219 | 216 | $titleText = $titleObj->getPrefixedText(); |
220 | | - $pageLink = $sk->makeLinkObj( $titleObj ); |
221 | | - $toolLinks[] = $sk->makeLinkObj( $titleObj->getTalkPage(), $wgLang->getNsText( NS_TALK ) ); |
| 217 | + $pageLink = Linker::makeLinkObj( $titleObj ); |
| 218 | + $toolLinks[] = Linker::makeLinkObj( $titleObj->getTalkPage(), $wgLang->getNsText( NS_TALK ) ); |
222 | 219 | if( $titleObj->exists() ) |
223 | | - $toolLinks[] = $sk->makeKnownLinkObj( $titleObj, wfMsgHtml( 'history_short' ), 'action=history' ); |
| 220 | + $toolLinks[] = Linker::makeKnownLinkObj( $titleObj, wfMsgHtml( 'history_short' ), 'action=history' ); |
224 | 221 | $toolLinks = '(' . implode( ' | ', $toolLinks ) . ')'; |
225 | 222 | $checkbox = '<input type="checkbox" name="id[]" value="' . htmlspecialchars( $titleObj->getPrefixedText() ) . '" /> ' . ( $wgContLang->isRTL() ? '‏' : '‎' ); |
226 | 223 | if( $redir ) { |
— | — | @@ -326,18 +323,17 @@ |
327 | 324 | |
328 | 325 | # Spit out some control panel links |
329 | 326 | $thisTitle = SpecialPage::getTitleFor( 'Watchlist' ); |
330 | | - $skin = $wgUser->getSkin(); |
331 | 327 | $linkElements = array( 'hideOwn' => 'wlhideshowown', 'hideBots' => 'wlhideshowbots' ); |
332 | 328 | |
333 | 329 | # Problems encountered using the fancier method |
334 | 330 | $label = $hideBots ? wfMsgHtml( 'show' ) : wfMsgHtml( 'hide' ); |
335 | 331 | $linkBits = wfArrayToCGI( array( 'hideBots' => 1 - (int)$hideBots ), $nondefaults ); |
336 | | - $link = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); |
| 332 | + $link = Linker::makeKnownLinkObj( $thisTitle, $label, $linkBits ); |
337 | 333 | $links[] = wfMsgHtml( 'wlhideshowbots', $link ); |
338 | 334 | |
339 | 335 | $label = $hideOwn ? wfMsgHtml( 'show' ) : wfMsgHtml( 'hide' ); |
340 | 336 | $linkBits = wfArrayToCGI( array( 'hideOwn' => 1 - (int)$hideOwn ), $nondefaults ); |
341 | | - $link = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ); |
| 337 | + $link = Linker::makeKnownLinkObj( $thisTitle, $label, $linkBits ); |
342 | 338 | $links[] = wfMsgHtml( 'wlhideshowown', $link ); |
343 | 339 | |
344 | 340 | $wgOut->addHTML( implode( ' | ', $links ) ); |
— | — | @@ -403,9 +399,8 @@ |
404 | 400 | } |
405 | 401 | |
406 | 402 | function wlHoursLink( $h, $page, $options = array() ) { |
407 | | - global $wgUser, $wgLang, $wgContLang; |
408 | | - $sk = $wgUser->getSkin(); |
409 | | - $s = $sk->makeKnownLink( |
| 403 | + global $wgLang, $wgContLang; |
| 404 | + $s = Linker::makeKnownLink( |
410 | 405 | $wgContLang->specialPage( $page ), |
411 | 406 | $wgLang->formatNum( $h ), |
412 | 407 | wfArrayToCGI( array('days' => ($h / 24.0)), $options ) ); |
— | — | @@ -413,9 +408,8 @@ |
414 | 409 | } |
415 | 410 | |
416 | 411 | function wlDaysLink( $d, $page, $options = array() ) { |
417 | | - global $wgUser, $wgLang, $wgContLang; |
418 | | - $sk = $wgUser->getSkin(); |
419 | | - $s = $sk->makeKnownLink( |
| 412 | + global $wgLang, $wgContLang; |
| 413 | + $s = Linker::makeKnownLink( |
420 | 414 | $wgContLang->specialPage( $page ), |
421 | 415 | ($d ? $wgLang->formatNum( $d ) : wfMsgHtml( 'watchlistall2' ) ), |
422 | 416 | wfArrayToCGI( array('days' => $d), $options ) ); |
Index: trunk/phase3/includes/SpecialSearch.php |
— | — | @@ -126,8 +126,7 @@ |
127 | 127 | |
128 | 128 | $this->setupPage( $term ); |
129 | 129 | |
130 | | - global $wgUser, $wgOut; |
131 | | - $sk = $wgUser->getSkin(); |
| 130 | + global $wgOut; |
132 | 131 | $wgOut->addWikiText( wfMsg( 'searchresulttext' ) ); |
133 | 132 | |
134 | 133 | #if ( !$this->parseQuery() ) { |
— | — | @@ -321,14 +320,13 @@ |
322 | 321 | wfProfileOut( $fname ); |
323 | 322 | return "<!-- Broken link in search result -->\n"; |
324 | 323 | } |
325 | | - $sk =& $wgUser->getSkin(); |
326 | 324 | |
327 | 325 | $contextlines = $wgUser->getOption( 'contextlines' ); |
328 | 326 | if ( '' == $contextlines ) { $contextlines = 5; } |
329 | 327 | $contextchars = $wgUser->getOption( 'contextchars' ); |
330 | 328 | if ( '' == $contextchars ) { $contextchars = 50; } |
331 | 329 | |
332 | | - $link = $sk->makeKnownLinkObj( $t ); |
| 330 | + $link = Linker::makeKnownLinkObj( $t ); |
333 | 331 | $revision = Revision::newFromTitle( $t ); |
334 | 332 | $text = $revision->getText(); |
335 | 333 | $size = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'), |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -153,6 +153,7 @@ |
154 | 154 | if they have selected that option in preferences. |
155 | 155 | * (bug 5936) Show an 'm' to the left of the edit summary on diff pages for minor edits. |
156 | 156 | * (bug 7820) Improve error reporting for uploads via URL. |
| 157 | +* (bug 7405) Make Linker methods static. |
157 | 158 | |
158 | 159 | |
159 | 160 | == Languages updated == |
Index: trunk/phase3/skins/Nostalgia.php |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | $sep = " |\n"; |
59 | 59 | |
60 | 60 | $s = $this->mainPageLink() . $sep |
61 | | - . $this->specialLink( "recentchanges" ); |
| 61 | + . self::specialLink( "recentchanges" ); |
62 | 62 | |
63 | 63 | if ( $wgOut->isArticle() ) { |
64 | 64 | $s .= $sep . $this->editThisPage() |
— | — | @@ -69,9 +69,9 @@ |
70 | 70 | $s .= $this->extensionTabLinks(); |
71 | 71 | |
72 | 72 | if ( $wgUser->isAnon() ) { |
73 | | - $s .= $sep . $this->specialLink( "userlogin" ); |
| 73 | + $s .= $sep . self::specialLink( "userlogin" ); |
74 | 74 | } else { |
75 | | - $s .= $sep . $this->specialLink( "userlogout" ); |
| 75 | + $s .= $sep . self::specialLink( "userlogout" ); |
76 | 76 | } |
77 | 77 | |
78 | 78 | $s .= $sep . $this->specialPagesList(); |
Index: trunk/phase3/skins/disabled/HTMLDump.php |
— | — | @@ -80,7 +80,7 @@ |
81 | 81 | $hasMembers = $dbr->selectField( 'categorylinks', '1', |
82 | 82 | array( 'cl_to' => $nt->getDBkey() ), __METHOD__ ); |
83 | 83 | if ( $hasMembers ) { |
84 | | - return $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix ); |
| 84 | + return self::makeKnownLinkObj( $nt, $text, $query, $trail, $prefix ); |
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
Index: trunk/phase3/skins/disabled/MonoBookCBT.php |
— | — | @@ -428,12 +428,12 @@ |
429 | 429 | $usertalktitle = $usertitle->getTalkPage(); |
430 | 430 | if( !$usertalktitle->equals( $this->mTitle ) ) { |
431 | 431 | $ntl = wfMsg( 'youhavenewmessages', |
432 | | - $this->makeKnownLinkObj( |
| 432 | + self::makeKnownLinkObj( |
433 | 433 | $usertalktitle, |
434 | 434 | wfMsgHtml( 'newmessageslink' ), |
435 | 435 | 'redirect=no' |
436 | 436 | ), |
437 | | - $this->makeKnownLinkObj( |
| 437 | + self::makeKnownLinkObj( |
438 | 438 | $usertalktitle, |
439 | 439 | wfMsgHtml( 'newmessagesdifflink' ), |
440 | 440 | 'diff=cur' |
Index: trunk/phase3/skins/CologneBlue.php |
— | — | @@ -84,7 +84,7 @@ |
85 | 85 | $s .= "<td class='bottom' align='center' valign='top'>"; |
86 | 86 | |
87 | 87 | $s .= $this->bottomLinks(); |
88 | | - $s .= "\n<br />" . $this->makeKnownLink( wfMsgForContent( "mainpage" ) ) . " | " |
| 88 | + $s .= "\n<br />" . self::makeKnownLink( wfMsgForContent( "mainpage" ) ) . " | " |
89 | 89 | . $this->aboutLink() . " | " |
90 | 90 | . $this->searchForm( wfMsg( "qbfind" ) ); |
91 | 91 | |
— | — | @@ -138,15 +138,15 @@ |
139 | 139 | } |
140 | 140 | |
141 | 141 | $s = "" . |
142 | | - $this->makeKnownLink( wfMsgForContent( "mainpage" ), wfMsg( "mainpage" ) ) |
| 142 | + self::makeKnownLink( wfMsgForContent( "mainpage" ), wfMsg( "mainpage" ) ) |
143 | 143 | . " | " . |
144 | | - $this->makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) ) |
| 144 | + self::makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) ) |
145 | 145 | . " | " . |
146 | | - $this->makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) ) |
| 146 | + self::makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) ) |
147 | 147 | . " | " . |
148 | | - $this->makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") ) |
| 148 | + self::makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") ) |
149 | 149 | . " | " . |
150 | | - $this->specialLink( "specialpages" ); |
| 150 | + self::specialLink( "specialpages" ); |
151 | 151 | |
152 | 152 | /* show links to different language variants */ |
153 | 153 | $s .= $this->variantLinks(); |
— | — | @@ -154,9 +154,9 @@ |
155 | 155 | |
156 | 156 | $s .= " | "; |
157 | 157 | if ( $wgUser->isLoggedIn() ) { |
158 | | - $s .= $this->makeKnownLink( $lo, wfMsg( "logout" ), $q ); |
| 158 | + $s .= self::makeKnownLink( $lo, wfMsg( "logout" ), $q ); |
159 | 159 | } else { |
160 | | - $s .= $this->makeKnownLink( $li, wfMsg( "login" ), $q ); |
| 160 | + $s .= self::makeKnownLink( $li, wfMsg( "login" ), $q ); |
161 | 161 | } |
162 | 162 | |
163 | 163 | return $s; |
— | — | @@ -195,7 +195,7 @@ |
196 | 196 | $s .= $this->menuHead( "qbedit" ); |
197 | 197 | $s .= "<strong>" . $this->editThisPage() . "</strong>"; |
198 | 198 | |
199 | | - $s .= $sep . $this->makeKnownLink( wfMsgForContent( "edithelppage" ), wfMsg( "edithelp" ) ); |
| 199 | + $s .= $sep . self::makeKnownLink( wfMsgForContent( "edithelppage" ), wfMsg( "edithelp" ) ); |
200 | 200 | |
201 | 201 | if( $wgUser->isLoggedIn() ) { |
202 | 202 | $s .= $sep . $this->moveThisPage(); |
— | — | @@ -244,31 +244,31 @@ |
245 | 245 | $s .= $this->menuHead( "qbmyoptions" ); |
246 | 246 | if ( $wgUser->isLoggedIn() ) { |
247 | 247 | $name = $wgUser->getName(); |
248 | | - $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(), |
| 248 | + $tl = self::makeKnownLinkObj( $wgUser->getTalkPage(), |
249 | 249 | wfMsg( 'mytalk' ) ); |
250 | 250 | if ( $wgUser->getNewtalk() ) { |
251 | 251 | $tl .= " *"; |
252 | 252 | } |
253 | 253 | |
254 | | - $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(), |
| 254 | + $s .= self::makeKnownLinkObj( $wgUser->getUserPage(), |
255 | 255 | wfMsg( "mypage" ) ) |
256 | 256 | . $sep . $tl |
257 | | - . $sep . $this->specialLink( "watchlist" ) |
258 | | - . $sep . $this->makeKnownLinkObj( SpecialPage::getSafeTitleFor( "Contributions", $wgUser->getName() ), |
| 257 | + . $sep . self::specialLink( "watchlist" ) |
| 258 | + . $sep . self::makeKnownLinkObj( SpecialPage::getSafeTitleFor( "Contributions", $wgUser->getName() ), |
259 | 259 | wfMsg( "mycontris" ) ) |
260 | | - . $sep . $this->specialLink( "preferences" ) |
261 | | - . $sep . $this->specialLink( "userlogout" ); |
| 260 | + . $sep . self::specialLink( "preferences" ) |
| 261 | + . $sep . self::specialLink( "userlogout" ); |
262 | 262 | } else { |
263 | | - $s .= $this->specialLink( "userlogin" ); |
| 263 | + $s .= self::specialLink( "userlogin" ); |
264 | 264 | } |
265 | 265 | |
266 | 266 | $s .= $this->menuHead( "qbspecialpages" ) |
267 | | - . $this->specialLink( "newpages" ) |
268 | | - . $sep . $this->specialLink( "imagelist" ) |
269 | | - . $sep . $this->specialLink( "statistics" ) |
| 267 | + . self::specialLink( "newpages" ) |
| 268 | + . $sep . self::specialLink( "imagelist" ) |
| 269 | + . $sep . self::specialLink( "statistics" ) |
270 | 270 | . $sep . $this->bugReportsLink(); |
271 | 271 | if ( $wgUser->isLoggedIn() && $wgEnableUploads ) { |
272 | | - $s .= $sep . $this->specialLink( "upload" ); |
| 272 | + $s .= $sep . self::specialLink( "upload" ); |
273 | 273 | } |
274 | 274 | global $wgSiteSupportPage; |
275 | 275 | if( $wgSiteSupportPage) { |
— | — | @@ -276,7 +276,7 @@ |
277 | 277 | .wfMsg( "sitesupport" )."</a>"; |
278 | 278 | } |
279 | 279 | |
280 | | - $s .= $sep . $this->makeKnownLinkObj( |
| 280 | + $s .= $sep . self::makeKnownLinkObj( |
281 | 281 | SpecialPage::getTitleFor( 'Specialpages' ), |
282 | 282 | wfMsg( 'moredotdotdot' ) ); |
283 | 283 | |
Index: trunk/phase3/skins/Standard.php |
— | — | @@ -118,7 +118,7 @@ |
119 | 119 | $s .= $this->bottomLinks(); |
120 | 120 | $s .= "\n<br />" . $this->mainPageLink() |
121 | 121 | . ' | ' . $this->aboutLink() |
122 | | - . ' | ' . $this->specialLink( 'recentchanges' ) |
| 122 | + . ' | ' . self::specialLink( 'recentchanges' ) |
123 | 123 | . ' | ' . $this->searchForm() |
124 | 124 | . '<br /><span id="pagestats">' . $this->pageStats() . '</span>'; |
125 | 125 | |
— | — | @@ -164,8 +164,8 @@ |
165 | 165 | } |
166 | 166 | |
167 | 167 | if( $wgUser->isLoggedIn() ) { |
168 | | - $s.= $this->specialLink( 'watchlist' ) ; |
169 | | - $s .= $sep . $this->makeKnownLink( $wgContLang->specialPage( 'Contributions' ), |
| 168 | + $s.= self::specialLink( 'watchlist' ) ; |
| 169 | + $s .= $sep . self::makeKnownLink( $wgContLang->specialPage( 'Contributions' ), |
170 | 170 | wfMsg( 'mycontris' ), 'target=' . wfUrlencode($wgUser->getName() ) ); |
171 | 171 | } |
172 | 172 | // only show watchlist link if logged in |
— | — | @@ -220,7 +220,7 @@ |
221 | 221 | $link = $nstext . ':' . $link ; |
222 | 222 | } |
223 | 223 | |
224 | | - $s .= $this->makeLink( $link, $text ); |
| 224 | + $s .= self::makeLink( $link, $text ); |
225 | 225 | } elseif( $wgTitle->getNamespace() != NS_SPECIAL ) { |
226 | 226 | # we just throw in a "New page" text to tell the user that he's in edit mode, |
227 | 227 | # and to avoid messing with the separator that is prepended to the next item |
— | — | @@ -231,10 +231,10 @@ |
232 | 232 | |
233 | 233 | # "Post a comment" link |
234 | 234 | if( ( $wgTitle->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview ) |
235 | | - $s .= '<br />' . $this->makeKnownLinkObj( $wgTitle, wfMsg( 'postcomment' ), 'action=edit§ion=new' ); |
| 235 | + $s .= '<br />' . self::makeKnownLinkObj( $wgTitle, wfMsg( 'postcomment' ), 'action=edit§ion=new' ); |
236 | 236 | |
237 | 237 | #if( $tns%2 && $action!='edit' && !$wpPreview) { |
238 | | - #$s.= '<br />'.$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg('postcomment'),'action=edit§ion=new'); |
| 238 | + #$s.= '<br />'.self::makeKnownLink($wgTitle->getPrefixedText(),wfMsg('postcomment'),'action=edit§ion=new'); |
239 | 239 | #} |
240 | 240 | |
241 | 241 | /* |
— | — | @@ -282,9 +282,9 @@ |
283 | 283 | } |
284 | 284 | |
285 | 285 | if ( $wgUser->isLoggedIn() && ( $wgEnableUploads || $wgRemoteUploads ) ) { |
286 | | - $s .= $this->specialLink( 'upload' ) . $sep; |
| 286 | + $s .= self::specialLink( 'upload' ) . $sep; |
287 | 287 | } |
288 | | - $s .= $this->specialLink( 'specialpages' ) |
| 288 | + $s .= self::specialLink( 'specialpages' ) |
289 | 289 | . $sep . $this->bugReportsLink(); |
290 | 290 | |
291 | 291 | global $wgSiteSupportPage; |