r17479 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17478‎ | r17479 | r17480 >
Date:05:21, 8 November 2006
Author:nickj
Status:old
Tags:
Comment:
* (bug 7405) Make Linker methods static. Patch by Dan Li.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/AjaxFunctions.php (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/CategoryPage.php (modified) (history)
  • /trunk/phase3/includes/ChangesList.php (modified) (history)
  • /trunk/phase3/includes/Credits.php (modified) (history)
  • /trunk/phase3/includes/DifferenceEngine.php (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/ImageGallery.php (modified) (history)
  • /trunk/phase3/includes/ImagePage.php (modified) (history)
  • /trunk/phase3/includes/Linker.php (modified) (history)
  • /trunk/phase3/includes/LogPage.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/PageHistory.php (modified) (history)
  • /trunk/phase3/includes/Pager.php (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)
  • /trunk/phase3/includes/QueryPage.php (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/includes/SpecialAllpages.php (modified) (history)
  • /trunk/phase3/includes/SpecialAncientpages.php (modified) (history)
  • /trunk/phase3/includes/SpecialBrokenRedirects.php (modified) (history)
  • /trunk/phase3/includes/SpecialCategories.php (modified) (history)
  • /trunk/phase3/includes/SpecialConfirmemail.php (modified) (history)
  • /trunk/phase3/includes/SpecialContributions.php (modified) (history)
  • /trunk/phase3/includes/SpecialDisambiguations.php (modified) (history)
  • /trunk/phase3/includes/SpecialDoubleRedirects.php (modified) (history)
  • /trunk/phase3/includes/SpecialImagelist.php (modified) (history)
  • /trunk/phase3/includes/SpecialImport.php (modified) (history)
  • /trunk/phase3/includes/SpecialIpblocklist.php (modified) (history)
  • /trunk/phase3/includes/SpecialListredirects.php (modified) (history)
  • /trunk/phase3/includes/SpecialListusers.php (modified) (history)
  • /trunk/phase3/includes/SpecialLog.php (modified) (history)
  • /trunk/phase3/includes/SpecialMIMEsearch.php (modified) (history)
  • /trunk/phase3/includes/SpecialMostcategories.php (modified) (history)
  • /trunk/phase3/includes/SpecialMostimages.php (modified) (history)
  • /trunk/phase3/includes/SpecialMostlinked.php (modified) (history)
  • /trunk/phase3/includes/SpecialMostlinkedcategories.php (modified) (history)
  • /trunk/phase3/includes/SpecialMostrevisions.php (modified) (history)
  • /trunk/phase3/includes/SpecialNewimages.php (modified) (history)
  • /trunk/phase3/includes/SpecialNewpages.php (modified) (history)
  • /trunk/phase3/includes/SpecialPopularpages.php (modified) (history)
  • /trunk/phase3/includes/SpecialPreferences.php (modified) (history)
  • /trunk/phase3/includes/SpecialPrefixindex.php (modified) (history)
  • /trunk/phase3/includes/SpecialRecentchanges.php (modified) (history)
  • /trunk/phase3/includes/SpecialRecentchangeslinked.php (modified) (history)
  • /trunk/phase3/includes/SpecialRevisiondelete.php (modified) (history)
  • /trunk/phase3/includes/SpecialSearch.php (modified) (history)
  • /trunk/phase3/includes/SpecialShortpages.php (modified) (history)
  • /trunk/phase3/includes/SpecialSpecialpages.php (modified) (history)
  • /trunk/phase3/includes/SpecialStatistics.php (modified) (history)
  • /trunk/phase3/includes/SpecialUncategorizedimages.php (modified) (history)
  • /trunk/phase3/includes/SpecialUndelete.php (modified) (history)
  • /trunk/phase3/includes/SpecialUnusedcategories.php (modified) (history)
  • /trunk/phase3/includes/SpecialUnusedimages.php (modified) (history)
  • /trunk/phase3/includes/SpecialUnusedtemplates.php (modified) (history)
  • /trunk/phase3/includes/SpecialUnwatchedpages.php (modified) (history)
  • /trunk/phase3/includes/SpecialUpload.php (modified) (history)
  • /trunk/phase3/includes/SpecialUserlogin.php (modified) (history)
  • /trunk/phase3/includes/SpecialWantedcategories.php (modified) (history)
  • /trunk/phase3/includes/SpecialWantedpages.php (modified) (history)
  • /trunk/phase3/includes/SpecialWatchlist.php (modified) (history)
  • /trunk/phase3/includes/SpecialWhatlinkshere.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/skins/CologneBlue.php (modified) (history)
  • /trunk/phase3/skins/Nostalgia.php (modified) (history)
  • /trunk/phase3/skins/Standard.php (modified) (history)
  • /trunk/phase3/skins/disabled/HTMLDump.php (modified) (history)
  • /trunk/phase3/skins/disabled/MonoBookCBT.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialDoubleRedirects.php
@@ -61,7 +61,7 @@
6262 return '';
6363 }
6464
65 - function formatResult( $skin, $result ) {
 65+ function formatResult( $result ) {
6666 global $wgContLang;
6767
6868 $fname = 'DoubleRedirectsPage::formatResult';
@@ -83,10 +83,10 @@
8484 $titleB = Title::makeTitle( $result->nsb, $result->tb );
8585 $titleC = Title::makeTitle( $result->nsc, $result->tc );
8686
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 );
9191 $arr = $wgContLang->getArrow() . $wgContLang->getDirMark();
9292
9393 return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
Index: trunk/phase3/includes/SpecialNewimages.php
@@ -9,11 +9,10 @@
1010 *
1111 */
1212 function wfSpecialNewimages( $par, $specialPage ) {
13 - global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgGroupPermissions;
 13+ global $wgOut, $wgLang, $wgContLang, $wgRequest, $wgGroupPermissions;
1414
1515 $wpIlMatch = $wgRequest->getText( 'wpIlMatch' );
1616 $dbr =& wfGetDB( DB_SLAVE );
17 - $sk = $wgUser->getSkin();
1817 $shownav = !$specialPage->including();
1918 $hidebots = $wgRequest->getBool('hidebots',1);
2019
@@ -135,7 +134,7 @@
136135
137136 $nt = Title::newFromText( $name, NS_IMAGE );
138137 $img = new Image( $nt );
139 - $ul = $sk->makeLinkObj( Title::makeTitle( NS_USER, $ut ), $ut );
 138+ $ul = Linker::makeLinkObj( Title::makeTitle( NS_USER, $ut ), $ut );
140139
141140 $gallery->add( $img, "$ul<br />\n<i>".$wgLang->timeanddate( $s->img_timestamp, true )."</i><br />\n" );
142141
@@ -177,18 +176,18 @@
178177 }
179178 $now = wfTimestampNow();
180179 $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 );
182181
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);
184183
185184 $prevLink = wfMsg( 'prevn', $wgLang->formatNum( $limit ) );
186185 if( $firstTimestamp && $firstTimestamp != $latestTimestamp ) {
187 - $prevLink = $sk->makeKnownLinkObj( $titleObj, $prevLink, 'from=' . $firstTimestamp . $botpar . $searchpar );
 186+ $prevLink = Linker::makeKnownLinkObj( $titleObj, $prevLink, 'from=' . $firstTimestamp . $botpar . $searchpar );
188187 }
189188
190189 $nextLink = wfMsg( 'nextn', $wgLang->formatNum( $limit ) );
191190 if( $shownImages > $limit && $lastTimestamp ) {
192 - $nextLink = $sk->makeKnownLinkObj( $titleObj, $nextLink, 'until=' . $lastTimestamp.$botpar.$searchpar );
 191+ $nextLink = Linker::makeKnownLinkObj( $titleObj, $nextLink, 'until=' . $lastTimestamp.$botpar.$searchpar );
193192 }
194193
195194 $prevnext = '<p>' . $botLink . ' '. wfMsg( 'viewprevnext', $prevLink, $nextLink, $dateLink ) .'</p>';
Index: trunk/phase3/includes/SpecialListredirects.php
@@ -27,13 +27,13 @@
2828 return( $sql );
2929 }
3030
31 - function formatResult( $skin, $result ) {
 31+ function formatResult( $result ) {
3232 global $wgContLang;
3333
3434 # Make a link to the redirect itself
3535 $rd_title = Title::makeTitle( $result->namespace, $result->title );
3636 $arr = $wgContLang->getArrow() . $wgContLang->getDirMark();
37 - $rd_link = $skin->makeKnownLinkObj( $rd_title, '', 'redirect=no' );
 37+ $rd_link = Linker::makeKnownLinkObj( $rd_title, '', 'redirect=no' );
3838
3939 # Find out where the redirect leads
4040 $revision = Revision::newFromTitle( $rd_title );
@@ -41,7 +41,7 @@
4242 # Make a link to the destination page
4343 $target = Title::newFromRedirect( $revision->getText() );
4444 if( $target ) {
45 - $targetLink = $skin->makeLinkObj( $target );
 45+ $targetLink = Linker::makeLinkObj( $target );
4646 } else {
4747 /** @todo Put in some decent error display here */
4848 $targetLink = '*';
Index: trunk/phase3/includes/SpecialAllpages.php
@@ -83,8 +83,7 @@
8484 * @param integer $namespace (default NS_MAIN)
8585 */
8686 function showToplevel ( $namespace = NS_MAIN, $including = false ) {
87 - global $wgOut, $wgUser;
88 - $sk = $wgUser->getSkin();
 87+ global $wgOut;
8988 $fname = "indexShowToplevel";
9089
9190 # TODO: Either make this *much* faster or cache the title index points
@@ -185,8 +184,6 @@
186185 * @param integer $namespace (Default NS_MAIN)
187186 */
188187 function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) {
189 - global $wgUser;
190 - $sk = $wgUser->getSkin();
191188 $dbr =& wfGetDB( DB_SLAVE );
192189
193190 $inpointf = htmlspecialchars( str_replace( '_', ' ', $inpoint ) );
@@ -208,12 +205,10 @@
209206 * @param string $from list all pages from this name (default FALSE)
210207 */
211208 function showChunk( $namespace = NS_MAIN, $from, $including = false ) {
212 - global $wgOut, $wgUser, $wgContLang;
 209+ global $wgOut, $wgContLang;
213210
214211 $fname = 'indexShowChunk';
215212
216 - $sk = $wgUser->getSkin();
217 -
218213 $fromList = $this->getNamespaceKeyAndText($namespace, $from);
219214
220215 if ( !$fromList ) {
@@ -246,7 +241,7 @@
247242 $t = Title::makeTitle( $s->page_namespace, $s->page_title );
248243 if( $t ) {
249244 $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 ) .
251246 ($s->page_is_redirect ? '</div>' : '' );
252247 } else {
253248 $link = '[[' . htmlspecialchars( $s->page_title ) . ']]';
@@ -273,12 +268,12 @@
274269 $out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">';
275270 $out2 .= '<tr valign="top"><td align="left">' . $nsForm;
276271 $out2 .= '</td><td align="right" style="font-size: smaller; margin-bottom: 1em;">' .
277 - $sk->makeKnownLink( $wgContLang->specialPage( "Allpages" ),
 272+ Linker::makeKnownLink( $wgContLang->specialPage( "Allpages" ),
278273 wfMsgHtml ( 'allpages' ) );
279274 if ( isset($dbr) && $dbr && ($n == $this->maxPerPage) && ($s = $dbr->fetchObject( $res )) ) {
280275 $self = SpecialPage::getTitleFor( 'Allpages' );
281276 $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 );
283278 }
284279 $out2 .= "</td></tr></table><hr />";
285280 }
Index: trunk/phase3/includes/SpecialImport.php
@@ -176,16 +176,14 @@
177177 }
178178
179179 function reportPage( $title, $origTitle, $revisionCount, $successCount ) {
180 - global $wgOut, $wgUser, $wgLang, $wgContLang;
181 -
182 - $skin = $wgUser->getSkin();
183 -
 180+ global $wgOut, $wgLang, $wgContLang;
 181+
184182 $this->mPageCount++;
185183
186184 $localCount = $wgLang->formatNum( $successCount );
187185 $contentCount = $wgContLang->formatNum( $successCount );
188186
189 - $wgOut->addHtml( "<li>" . $skin->makeKnownLinkObj( $title ) .
 187+ $wgOut->addHtml( "<li>" . Linker::makeKnownLinkObj( $title ) .
190188 " " .
191189 wfMsgExt( 'import-revision-count', array( 'parsemag', 'escape' ), $localCount ) .
192190 "</li>\n" );
Index: trunk/phase3/includes/SpecialImagelist.php
@@ -112,7 +112,7 @@
113113 $name = $this->mCurrentRow->img_name;
114114 $ilink = "<a href=\"" . htmlspecialchars( Image::imageUrl( $name ) ) .
115115 "\">" . $this->mMessages['imgfile'] . "</a>";
116 - $desc = $this->getSkin()->makeKnownLinkObj( Title::makeTitle( NS_IMAGE, $name ),
 116+ $desc = Linker::makeKnownLinkObj( Title::makeTitle( NS_IMAGE, $name ),
117117 $this->mMessages['imgdesc'] );
118118 return "$desc | $ilink";
119119 case 'img_timestamp':
@@ -121,7 +121,7 @@
122122 return htmlspecialchars( $value );
123123 case 'img_user_text':
124124 if ( $this->mCurrentRow->img_user ) {
125 - $link = $this->getSkin()->makeLinkObj( Title::makeTitle( NS_USER, $value ),
 125+ $link = Linker::makeLinkObj( Title::makeTitle( NS_USER, $value ),
126126 htmlspecialchars( $value ) );
127127 } else {
128128 $link = htmlspecialchars( $value );
@@ -130,7 +130,7 @@
131131 case 'img_size':
132132 return $wgLang->formatNum( $value );
133133 case 'img_description':
134 - return $this->getSkin()->commentBlock( $value );
 134+ return Linker::commentBlock( $value );
135135 }
136136 }
137137
Index: trunk/phase3/includes/DifferenceEngine.php
@@ -143,13 +143,12 @@
144144 exit;
145145 }
146146
147 - $sk = $wgUser->getSkin();
148147 $talk = $wgContLang->getNsText( NS_TALK );
149148 $contribs = wfMsg( 'contribslink' );
150149
151150 if ( $this->mNewRev->isCurrent() && $wgUser->isAllowed('rollback') ) {
152151 $username = $this->mNewRev->getUserText();
153 - $rollback = '&nbsp;&nbsp;&nbsp;<strong>[' . $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'rollbacklink' ),
 152+ $rollback = '&nbsp;&nbsp;&nbsp;<strong>[' . Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'rollbacklink' ),
154153 'action=rollback&from=' . urlencode( $username ) .
155154 '&token=' . urlencode( $wgUser->editToken( array( $this->mTitle->getPrefixedText(), $username ) ) ) ) .
156155 ']</strong>';
@@ -157,17 +156,17 @@
158157 $rollback = '';
159158 }
160159 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}" ) . ']';
162161 } else {
163162 $patrol = '';
164163 }
165164
166 - $prevlink = $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'previousdiff' ),
 165+ $prevlink = Linker::makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'previousdiff' ),
167166 'diff=prev&oldid='.$this->mOldid, '', '', 'id="differences-prevlink"' );
168167 if ( $this->mNewRev->isCurrent() ) {
169168 $nextlink = '&nbsp;';
170169 } else {
171 - $nextlink = $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'nextdiff' ),
 170+ $nextlink = Linker::makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'nextdiff' ),
172171 'diff=next&oldid='.$this->mNewid, '', '', 'id="differences-nextlink"' );
173172 }
174173
@@ -185,12 +184,12 @@
186185 }
187186
188187 $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 />" .
191190 $prevlink;
192191 $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 />" .
195194 $nextlink . $patrol;
196195
197196 $this->showDiff( $oldHeader, $newHeader );
@@ -218,7 +217,7 @@
219218 * contrast to normal "old revision" display style.
220219 */
221220 function showFirstRevision() {
222 - global $wgOut, $wgUser;
 221+ global $wgOut;
223222
224223 $fname = 'DifferenceEngine::showFirstRevision';
225224 wfProfileIn( $fname );
@@ -249,12 +248,10 @@
250249
251250 # Prepare the header box
252251 #
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"' );
256253 $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 />" .
259256 $nextlink . "</div>\n";
260257
261258 $wgOut->addHTML( $header );
Index: trunk/phase3/includes/SpecialIpblocklist.php
@@ -234,10 +234,8 @@
235235
236236 wfProfileIn( __METHOD__ );
237237
238 - static $sk=null, $msg=null;
 238+ static $msg=null;
239239
240 - if( is_null( $sk ) )
241 - $sk = $wgUser->getSkin();
242240 if( is_null( $msg ) ) {
243241 $msg = array();
244242 $keys = array( 'infiniteblock', 'expiringblock', 'contribslink', 'unblocklink',
@@ -251,15 +249,15 @@
252250
253251 # Prepare links to the blocker's user and talk pages
254252 $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 ) ) . ')';
257255
258256 # Prepare links to the block target's user and contribs. pages (as applicable, don't do it for autoblocks)
259257 if( $block->mAuto ) {
260258 $target = $block->getRedactedName(); # Hide the IP addresses of auto-blocks; privacy
261259 } 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'] ) . ')';
264262 }
265263
266264 $formattedTime = $wgLang->timeanddate( $block->mTimestamp, true );
@@ -289,9 +287,9 @@
290288
291289 if ( $wgUser->isAllowed('block') ) {
292290 $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 ) ) . ')';
294292 }
295 - $s .= $sk->commentBlock( $block->mReason );
 293+ $s .= Linker::commentBlock( $block->mReason );
296294 $s .= "</li>\n";
297295 wfProfileOut( __METHOD__ );
298296 return $s;
Index: trunk/phase3/includes/SpecialLog.php
@@ -218,8 +218,6 @@
219219 * @param LogReader &$reader where to get our data from
220220 */
221221 function LogViewer( &$reader ) {
222 - global $wgUser;
223 - $this->skin =& $wgUser->getSkin();
224222 $this->reader =& $reader;
225223 }
226224
@@ -316,15 +314,15 @@
317315 $linkCache->addBadLinkObj( $title );
318316 }
319317
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 );
322320 $paramArray = LogPage::extractParams( $s->log_params );
323321 $revert = '';
324322 if ( $s->log_type == 'move' && isset( $paramArray[0] ) ) {
325323 $specialTitle = SpecialPage::getTitleFor( 'Movepage' );
326324 $destTitle = Title::newFromText( $paramArray[0] );
327325 if ( $destTitle ) {
328 - $revert = '(' . $this->skin->makeKnownLinkObj( $specialTitle, wfMsg( 'revertmove' ),
 326+ $revert = '(' . Linker::makeKnownLinkObj( $specialTitle, wfMsg( 'revertmove' ),
329327 'wpOldTitle=' . urlencode( $destTitle->getPrefixedDBkey() ) .
330328 '&wpNewTitle=' . urlencode( $title->getPrefixedDBkey() ) .
331329 '&wpReason=' . urlencode( wfMsgForContent( 'revertmove' ) ) .
@@ -332,7 +330,7 @@
333331 }
334332 }
335333
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 );
337335 $out = "<li>$time $userLink $action $comment $revert</li>\n";
338336 return $out;
339337 }
Index: trunk/phase3/includes/Article.php
@@ -613,7 +613,6 @@
614614 global $wgUser, $wgOut, $wgRequest, $wgContLang;
615615 global $wgEnableParserCache, $wgStylePath, $wgUseRCPatrol, $wgParser;
616616 global $wgUseTrackbacks, $wgNamespaceRobotPolicies;
617 - $sk = $wgUser->getSkin();
618617
619618 wfProfileIn( __METHOD__ );
620619
@@ -693,8 +692,7 @@
694693 // This is an internally redirected page view.
695694 // We'll need a backlink to the source page for navigation.
696695 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' );
699697 $s = wfMsg( 'redirectedfrom', $redir );
700698 $wgOut->setSubtitle( $s );
701699 $wasRedirected = true;
@@ -704,8 +702,7 @@
705703 // If it was reported from a trusted site, supply a backlink.
706704 global $wgRedirectSources;
707705 if( $wgRedirectSources && preg_match( $wgRedirectSources, $rdfrom ) ) {
708 - $sk = $wgUser->getSkin();
709 - $redir = $sk->makeExternalLink( $rdfrom, $rdfrom );
 706+ $redir = Linker::makeExternalLink( $rdfrom, $rdfrom );
710707 $s = wfMsg( 'redirectedfrom', $redir );
711708 $wgOut->setSubtitle( $s );
712709 $wasRedirected = true;
@@ -787,7 +784,7 @@
788785 $targetUrl = $rt->escapeLocalURL();
789786 # fixme unused $titleText :
790787 $titleText = htmlspecialchars( $rt->getPrefixedText() );
791 - $link = $sk->makeLinkObj( $rt );
 788+ $link = Linker::makeLinkObj( $rt );
792789
793790 $wgOut->addHTML( '<img src="'.$imageUrl.'" alt="#REDIRECT" />' .
794791 '<span class="redirectText">'.$link.'</span>' );
@@ -829,7 +826,7 @@
830827 $wgOut->addHTML(
831828 "<div class='patrollink'>" .
832829 wfMsg ( 'markaspatrolledlink',
833 - $sk->makeKnownLinkObj( $this->mTitle, wfMsg('markaspatrolledtext'), "action=markpatrolled&rcid=$rcid" )
 830+ Linker::makeKnownLinkObj( $this->mTitle, wfMsg('markaspatrolledtext'), "action=markpatrolled&rcid=$rcid" )
834831 ) .
835832 '</div>'
836833 );
@@ -2256,7 +2253,7 @@
22572254 * @param string $oldid Revision ID of this article revision
22582255 */
22592256 function setOldSubtitle( $oldid=0 ) {
2260 - global $wgLang, $wgOut, $wgUser;
 2257+ global $wgLang, $wgOut;
22612258
22622259 if ( !wfRunHooks( 'DisplayOldSubtitle', array(&$this, &$oldid) ) ) {
22632260 return;
@@ -2266,26 +2263,25 @@
22672264
22682265 $current = ( $oldid == $this->mLatest );
22692266 $td = $wgLang->timeanddate( $this->mTimestamp, true );
2270 - $sk = $wgUser->getSkin();
22712267 $lnk = $current
22722268 ? wfMsg( 'currentrevisionlink' )
2273 - : $lnk = $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'currentrevisionlink' ) );
 2269+ : $lnk = Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'currentrevisionlink' ) );
22742270 $prev = $this->mTitle->getPreviousRevisionID( $oldid ) ;
22752271 $prevlink = $prev
2276 - ? $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'previousrevision' ), 'direction=prev&oldid='.$oldid )
 2272+ ? Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'previousrevision' ), 'direction=prev&oldid='.$oldid )
22772273 : wfMsg( 'previousrevision' );
22782274 $prevdiff = $prev
2279 - ? $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'diff' ), 'diff=prev&oldid='.$oldid )
 2275+ ? Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'diff' ), 'diff=prev&oldid='.$oldid )
22802276 : wfMsg( 'diff' );
22812277 $nextlink = $current
22822278 ? wfMsg( 'nextrevision' )
2283 - : $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'nextrevision' ), 'direction=next&oldid='.$oldid );
 2279+ : Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'nextrevision' ), 'direction=next&oldid='.$oldid );
22842280 $nextdiff = $current
22852281 ? wfMsg( 'diff' )
2286 - : $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'diff' ), 'diff=next&oldid='.$oldid );
 2282+ : Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'diff' ), 'diff=next&oldid='.$oldid );
22872283
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() );
22902286
22912287 $r = wfMsg( 'old-revision-navigation', $td, $lnk, $prevlink, $nextlink, $userlinks, $prevdiff, $nextdiff );
22922288 $wgOut->setSubtitle( $r );
Index: trunk/phase3/includes/SpecialBrokenRedirects.php
@@ -45,7 +45,7 @@
4646 return '';
4747 }
4848
49 - function formatResult( $skin, $result ) {
 49+ function formatResult( $result ) {
5050 global $wgContLang;
5151
5252 $fromObj = Title::makeTitle( $result->namespace, $result->title );
@@ -62,12 +62,12 @@
6363
6464 // $toObj may very easily be false if the $result list is cached
6565 if ( !is_object( $toObj ) ) {
66 - return '<s>' . $skin->makeLinkObj( $fromObj ) . '</s>';
 66+ return '<s>' . Linker::makeLinkObj( $fromObj ) . '</s>';
6767 }
6868
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 );
7272 $arr = $wgContLang->getArrow();
7373
7474 return "$from $edit $arr $to";
Index: trunk/phase3/includes/SpecialMostcategories.php
@@ -36,18 +36,18 @@
3737 ";
3838 }
3939
40 - function formatResult( $skin, $result ) {
 40+ function formatResult( $result ) {
4141 global $wgContLang, $wgLang;
4242
4343 $nt = Title::makeTitle( $result->namespace, $result->title );
4444 $text = $wgContLang->convert( $nt->getPrefixedText() );
4545
46 - $plink = $skin->makeKnownLink( $nt->getPrefixedText(), $text );
 46+ $plink = Linker::makeKnownLink( $nt->getPrefixedText(), $text );
4747
4848 $nl = wfMsgExt( 'ncategories', array( 'parsemag', 'escape' ),
4949 $wgLang->formatNum( $result->value ) );
5050
51 - $nlink = $skin->makeKnownLink( $wgContLang->specialPage( 'Categories' ),
 51+ $nlink = Linker::makeKnownLink( $wgContLang->specialPage( 'Categories' ),
5252 $nl, 'article=' . $nt->getPrefixedURL() );
5353
5454 return wfSpecialList($plink, $nlink);
Index: trunk/phase3/includes/SkinTemplate.php
@@ -295,12 +295,12 @@
296296 $usertalktitle = $usertitle->getTalkPage();
297297 if( !$usertalktitle->equals( $this->mTitle ) ) {
298298 $ntl = wfMsg( 'youhavenewmessages',
299 - $this->makeKnownLinkObj(
 299+ self::makeKnownLinkObj(
300300 $usertalktitle,
301301 wfMsgHtml( 'newmessageslink' ),
302302 'redirect=no'
303303 ),
304 - $this->makeKnownLinkObj(
 304+ self::makeKnownLinkObj(
305305 $usertalktitle,
306306 wfMsgHtml( 'newmessagesdifflink' ),
307307 'diff=cur'
Index: trunk/phase3/includes/SpecialPreferences.php
@@ -506,9 +506,8 @@
507507 $disableEmailPrefs = false;
508508 } else {
509509 $disableEmailPrefs = true;
510 - $skin = $wgUser->getSkin();
511510 $emailauthenticated = wfMsg('emailnotauthenticated').'<br />' .
512 - $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Confirmemail' ),
 511+ Linker::makeKnownLinkObj( SpecialPage::getTitleFor( 'Confirmemail' ),
513512 wfMsg( 'emailconfirmlink' ) );
514513 }
515514 } else {
Index: trunk/phase3/includes/SpecialPopularpages.php
@@ -35,10 +35,10 @@
3636 WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0";
3737 }
3838
39 - function formatResult( $skin, $result ) {
 39+ function formatResult( $result ) {
4040 global $wgLang, $wgContLang;
4141 $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() ) ) );
4343 $nv = wfMsgExt( 'nviews', array( 'parsemag', 'escape'),
4444 $wgLang->formatNum( $result->value ) );
4545 return wfSpecialList($link, $nv);
Index: trunk/phase3/includes/SpecialMostimages.php
@@ -34,17 +34,17 @@
3535 ";
3636 }
3737
38 - function formatResult( $skin, $result ) {
 38+ function formatResult( $result ) {
3939 global $wgLang, $wgContLang;
4040
4141 $nt = Title::makeTitle( $result->namespace, $result->title );
4242 $text = $wgContLang->convert( $nt->getPrefixedText() );
4343
44 - $plink = $skin->makeKnownLink( $nt->getPrefixedText(), $text );
 44+ $plink = Linker::makeKnownLink( $nt->getPrefixedText(), $text );
4545
4646 $nl = wfMsgExt( 'nlinks', array( 'parsemag', 'escape'),
4747 $wgLang->formatNum ( $result->value ) );
48 - $nlink = $skin->makeKnownLink( $nt->getPrefixedText() . '#filelinks', $nl );
 48+ $nlink = Linker::makeKnownLink( $nt->getPrefixedText() . '#filelinks', $nl );
4949
5050 return wfSpecialList($plink, $nlink);
5151 }
Index: trunk/phase3/includes/ImagePage.php
@@ -181,7 +181,6 @@
182182 $max = $wgImageLimits[$sizeSel];
183183 $maxWidth = $max[0];
184184 $maxHeight = $max[1];
185 - $sk = $wgUser->getSkin();
186185
187186 if ( $this->img->exists() ) {
188187 # image
@@ -254,9 +253,9 @@
255254
256255 if ( $page > 1 ) {
257256 $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) );
259258 $this->img->selectPage( $page - 1 );
260 - $thumb1 = $sk->makeThumbLinkObj( $this->img, $link, $label, 'none' );
 259+ $thumb1 = Linker::makeThumbLinkObj( $this->img, $link, $label, 'none' );
261260 } else {
262261 $thumb1 = '';
263262 }
@@ -264,8 +263,8 @@
265264 if ( $page < $count ) {
266265 $label = wfMsg( 'imgmultipagenext' );
267266 $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' );
270269 } else {
271270 $thumb2 = '';
272271 }
@@ -334,22 +333,20 @@
335334 # Image does not exist
336335
337336 $title = SpecialPage::getTitleFor( 'Upload' );
338 - $link = $sk->makeKnownLinkObj($title, wfMsgHtml('noimage-linktext'),
 337+ $link = Linker::makeKnownLinkObj($title, wfMsgHtml('noimage-linktext'),
339338 'wpDestFile=' . urlencode( $this->img->getName() ) );
340339 $wgOut->addHTML( wfMsgWikiHtml( 'noimage', $link ) );
341340 }
342341 }
343342
344343 function printSharedImageText() {
345 - global $wgRepositoryBaseUrl, $wgFetchCommonsDescriptions, $wgOut, $wgUser;
 344+ global $wgRepositoryBaseUrl, $wgFetchCommonsDescriptions, $wgOut;
346345
347346 $url = $wgRepositoryBaseUrl . urlencode($this->mTitle->getDBkey());
348347 $sharedtext = "<div class='sharedUploadNotice'>" . wfMsgWikiHtml("sharedupload");
349348 if ($wgRepositoryBaseUrl && !$wgFetchCommonsDescriptions) {
350 -
351 - $sk = $wgUser->getSkin();
352349 $title = SpecialPage::getTitleFor( 'Upload' );
353 - $link = $sk->makeKnownLinkObj($title, wfMsgHtml('shareduploadwiki-linktext'),
 350+ $link = Linker::makeKnownLinkObj($title, wfMsgHtml('shareduploadwiki-linktext'),
354351 array( 'wpDestFile' => urlencode( $this->img->getName() )));
355352 $sharedtext .= " " . wfMsgWikiHtml('shareduploadwiki', $link);
356353 }
@@ -379,18 +376,16 @@
380377 if( $this->img->fromSharedDirectory )
381378 return;
382379
383 - $sk = $wgUser->getSkin();
384 -
385380 $wgOut->addHtml( '<br /><ul>' );
386381
387382 # "Upload a new version of this file" link
388383 if( $wgUser->isAllowed( 'reupload' ) ) {
389 - $ulink = $sk->makeExternalLink( $this->getUploadUrl(), wfMsg( 'uploadnewversion-linktext' ) );
 384+ $ulink = Linker::makeExternalLink( $this->getUploadUrl(), wfMsg( 'uploadnewversion-linktext' ) );
390385 $wgOut->addHtml( "<li><div>{$ulink}</div></li>" );
391386 }
392387
393388 # 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' );
395390 $wgOut->addHtml( '<li>' . $elink . '<div>' . wfMsgWikiHtml( 'edit-externally-help' ) . '</div></li>' );
396391
397392 $wgOut->addHtml( '</ul>' );
@@ -406,16 +401,13 @@
407402 * If the page we've just displayed is in the "Image" namespace,
408403 * we follow it with an upload history of the image and its usage.
409404 */
410 - function imageHistory()
411 - {
412 - global $wgUser, $wgOut, $wgUseExternalEditor;
 405+ function imageHistory() {
 406+ global $wgOut, $wgUseExternalEditor;
413407
414 - $sk = $wgUser->getSkin();
415 -
416408 $line = $this->img->nextHistoryLine();
417409
418410 if ( $line ) {
419 - $list = new ImageHistoryList( $sk );
 411+ $list = new ImageHistoryList();
420412 $s = $list->beginImageHistoryList() .
421413 $list->imageHistoryLine( true, wfTimestamp(TS_MW, $line->img_timestamp),
422414 $this->mTitle->getDBkey(), $line->img_user,
@@ -442,9 +434,8 @@
443435
444436 }
445437
446 - function imageLinks()
447 - {
448 - global $wgUser, $wgOut;
 438+ function imageLinks() {
 439+ global $wgOut;
449440
450441 $wgOut->addHTML( '<h2 id="filelinks">' . wfMsg( 'imagelinks' ) . "</h2>\n" );
451442
@@ -463,10 +454,9 @@
464455 }
465456 $wgOut->addHTML( '<p>' . wfMsg( 'linkstoimage' ) . "</p>\n<ul>" );
466457
467 - $sk = $wgUser->getSkin();
468458 while ( $s = $dbr->fetchObject( $res ) ) {
469459 $name = Title::MakeTitle( $s->page_namespace, $s->page_title );
470 - $link = $sk->makeKnownLinkObj( $name, "" );
 460+ $link = Linker::makeKnownLinkObj( $name, "" );
471461 $wgOut->addHTML( "<li>{$link}</li>\n" );
472462 }
473463 $wgOut->addHTML( "</ul>\n" );
@@ -699,8 +689,7 @@
700690 * @package MediaWiki
701691 */
702692 class ImageHistoryList {
703 - function ImageHistoryList( &$skin ) {
704 - $this->skin =& $skin;
 693+ function ImageHistoryList() {
705694 }
706695
707696 function beginImageHistoryList() {
@@ -726,11 +715,8 @@
727716 $url = Image::imageUrl( $img );
728717 $rlink = $cur;
729718 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');
735721 } else {
736722 $dlink = $del;
737723 }
@@ -738,10 +724,10 @@
739725 $url = htmlspecialchars( wfImageArchiveUrl( $img ) );
740726 if( $wgUser->getID() != 0 && $wgTitle->userCanEdit() ) {
741727 $token = urlencode( $wgUser->editToken( $img ) );
742 - $rlink = $this->skin->makeKnownLinkObj( $wgTitle,
 728+ $rlink = Linker::makeKnownLinkObj( $wgTitle,
743729 wfMsg( 'revertimg' ), 'action=revert&oldimage=' .
744730 urlencode( $img ) . "&wpEditToken=$token" );
745 - $dlink = $this->skin->makeKnownLinkObj( $wgTitle,
 731+ $dlink = Linker::makeKnownLinkObj( $wgTitle,
746732 $del, 'action=delete&oldimage=' . urlencode( $img ) .
747733 "&wpEditToken=$token" );
748734 } else {
@@ -753,15 +739,15 @@
754740 }
755741 }
756742
757 - $userlink = $this->skin->userLink( $user, $usertext ) . $this->skin->userToolLinks( $user, $usertext );
 743+ $userlink = Linker::userLink( $user, $usertext ) . Linker::userToolLinks( $user, $usertext );
758744 $nbytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ),
759745 $wgLang->formatNum( $size ) );
760746 $widthheight = wfMsg( 'widthheight', $width, $height );
761 - $style = $this->skin->getInternalLinkAttributes( $url, $datetime );
 747+ $style = Linker::getInternalLinkAttributes( $url, $datetime );
762748
763749 $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$datetime}</a> . . {$userlink} . . {$widthheight} ({$nbytes})";
764750
765 - $s .= $this->skin->commentBlock( $description, $wgTitle );
 751+ $s .= Linker::commentBlock( $description, $wgTitle );
766752 $s .= "</li>\n";
767753 return $s;
768754 }
Index: trunk/phase3/includes/SpecialRevisiondelete.php
@@ -10,12 +10,11 @@
1111 */
1212
1313 function wfSpecialRevisiondelete( $par = null ) {
14 - global $wgOut, $wgRequest, $wgUser;
 14+ global $wgOut, $wgRequest;
1515
1616 $target = $wgRequest->getVal( 'target' );
1717 $oldid = $wgRequest->getIntArray( 'oldid' );
1818
19 - $sk = $wgUser->getSkin();
2019 $page = Title::newFromUrl( $target );
2120
2221 if( is_null( $page ) ) {
@@ -49,7 +48,6 @@
5049
5150 $this->revisions = $request->getIntArray( 'oldid', array() );
5251
53 - $this->skin = $wgUser->getSkin();
5452 $this->checks = array(
5553 array( 'revdelete-hide-text', 'wpHideText', Revision::DELETED_TEXT ),
5654 array( 'revdelete-hide-comment', 'wpHideComment', Revision::DELETED_COMMENT ),
@@ -122,11 +120,11 @@
123121 $date = $wgContLang->timeanddate( $rev->getTimestamp() );
124122 return
125123 "<li>" .
126 - $this->skin->makeLinkObj( $this->page, $date, 'oldid=' . $rev->getId() ) .
 124+ Linker::makeLinkObj( $this->page, $date, 'oldid=' . $rev->getId() ) .
127125 " " .
128 - $this->skin->revUserLink( $rev ) .
 126+ Linker::revUserLink( $rev ) .
129127 " " .
130 - $this->skin->revComment( $rev ) .
 128+ Linker::revComment( $rev ) .
131129 "</li>";
132130 }
133131
Index: trunk/phase3/includes/SpecialPrefixindex.php
@@ -56,12 +56,10 @@
5757 * @param string $from list all pages from this name (default FALSE)
5858 */
5959 function showChunk( $namespace = NS_MAIN, $prefix, $including = false, $from = null ) {
60 - global $wgOut, $wgUser, $wgContLang;
 60+ global $wgOut, $wgContLang;
6161
6262 $fname = 'indexShowChunk';
6363
64 - $sk = $wgUser->getSkin();
65 -
6664 if (!isset($from)) $from = $prefix;
6765
6866 $fromList = $this->getNamespaceKeyAndText($namespace, $from);
@@ -102,7 +100,7 @@
103101 $t = Title::makeTitle( $s->page_namespace, $s->page_title );
104102 if( $t ) {
105103 $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 ) .
107105 ($s->page_is_redirect ? '</div>' : '' );
108106 } else {
109107 $link = '[[' . htmlspecialchars( $s->page_title ) . ']]';
@@ -129,11 +127,11 @@
130128 $out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">';
131129 $out2 .= '<tr valign="top"><td align="left">' . $nsForm;
132130 $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 ),
134132 wfMsg ( 'allpages' ) );
135133 if ( isset($dbr) && $dbr && ($n == $this->maxPerPage) && ($s = $dbr->fetchObject( $res )) ) {
136134 $namespaceparam = $namespace ? "&namespace=$namespace" : "";
137 - $out2 .= " | " . $sk->makeKnownLink(
 135+ $out2 .= " | " . Linker::makeKnownLink(
138136 $wgContLang->specialPage( $this->name ),
139137 wfMsg ( 'nextpage', $s->page_title ),
140138 "from=" . wfUrlEncode ( $s->page_title ) .
Index: trunk/phase3/includes/Skin.php
@@ -70,7 +70,7 @@
7171 */
7272 static function normalizeKey( $key ) {
7373 global $wgDefaultSkin;
74 - $skinNames = Skin::getSkinNames();
 74+ $skinNames = self::getSkinNames();
7575
7676 if( $key == '' ) {
7777 // Don't return the default immediately;
@@ -110,9 +110,9 @@
111111 static function &newFromKey( $key ) {
112112 global $wgStyleDirectory;
113113
114 - $key = Skin::normalizeKey( $key );
 114+ $key = self::normalizeKey( $key );
115115
116 - $skinNames = Skin::getSkinNames();
 116+ $skinNames = self::getSkinNames();
117117 $skinName = $skinNames[$key];
118118
119119 # Grab the skin class and initialise it.
@@ -579,7 +579,7 @@
580580 $t = $embed . implode ( "{$pop} {$sep} {$embed}" , $wgOut->mCategoryLinks ) . $pop;
581581
582582 $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 )
584584 . ': ' . $t;
585585
586586 # optional 'dmoz-like' category browser. Will be shown under the list
@@ -591,7 +591,7 @@
592592 $parenttree = $wgTitle->getParentCategoryTree();
593593 # Skin object passed by reference cause it can not be
594594 # accessed under the method subfunction drawCategoryBrowser
595 - $tempout = explode("\n", Skin::drawCategoryBrowser($parenttree, $this) );
 595+ $tempout = explode("\n", self::drawCategoryBrowser($parenttree, $this) );
596596 # Clean out bogus first entry and sort them
597597 unset($tempout[0]);
598598 asort($tempout);
@@ -602,12 +602,14 @@
603603 return $s;
604604 }
605605
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
609610 * @return String separated by &gt;, terminate with "\n"
 611+ * @static
610612 */
611 - function drawCategoryBrowser($tree, &$skin) {
 613+ static function drawCategoryBrowser($tree, &$skin) {
612614 $return = '';
613615 foreach ($tree as $element => $parent) {
614616 if (empty($parent)) {
@@ -615,11 +617,11 @@
616618 $return .= "\n";
617619 } else {
618620 # grab the others elements
619 - $return .= Skin::drawCategoryBrowser($parent, $skin) . ' &gt; ';
 621+ $return .= self::drawCategoryBrowser($parent, $skin) . ' &gt; ';
620622 }
621623 # add our current element to the list
622624 $eltitle = Title::NewFromText($element);
623 - $return .= $skin->makeLinkObj( $eltitle, $eltitle->getText() ) ;
 625+ $return .= self::makeLinkObj( $eltitle, $eltitle->getText() ) ;
624626 }
625627 return $return;
626628 }
@@ -690,13 +692,13 @@
691693 $image = new Image( $wgTitle );
692694 if( $image->exists() ) {
693695 $link = htmlspecialchars( $image->getURL() );
694 - $style = $this->getInternalLinkAttributes( $link, $name );
 696+ $style = self::getInternalLinkAttributes( $link, $name );
695697 $s .= " | <a href=\"{$link}\"{$style}>{$name}</a>";
696698 }
697699 }
698700 }
699701 if ( 'history' == $action || isset( $diff ) || isset( $oldid ) ) {
700 - $s .= ' | ' . $this->makeKnownLinkObj( $wgTitle,
 702+ $s .= ' | ' . self::makeKnownLinkObj( $wgTitle,
701703 wfMsg( 'currentrev' ) );
702704 }
703705
@@ -704,8 +706,8 @@
705707 # do not show "You have new messages" text when we are viewing our
706708 # own talk page
707709 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' );
710712 $s.= ' | <strong>'. wfMsg( 'youhavenewmessages', $tl, $dl ) . '</strong>';
711713 # disable caching
712714 $wgOut->setSquidMaxage(0);
@@ -732,7 +734,7 @@
733735 $msg = 'viewdeleted';
734736 }
735737 return wfMsg( $msg,
736 - $this->makeKnownLink(
 738+ self::makeKnownLink(
737739 $wgContLang->SpecialPage( 'Undelete/' . $wgTitle->getPrefixedDBkey() ),
738740 wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $n ) ) );
739741 }
@@ -794,7 +796,7 @@
795797 $c++;
796798 if ($c<count($links)) {
797799 $growinglink .= $link;
798 - $getlink = $this->makeLink( $growinglink, htmlspecialchars( $link ) );
 800+ $getlink = self::makeLink( $growinglink, htmlspecialchars( $link ) );
799801 if(preg_match('/class="new"/i',$getlink)) { break; } # this is a hack, but it saves time
800802 if ($c>1) {
801803 $subpages .= ' | ';
@@ -821,7 +823,7 @@
822824 if( $wgShowIPinHeader && isset( $_COOKIE[ini_get('session.name')] ) ) {
823825 $n = wfGetIP();
824826
825 - $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
 827+ $tl = self::makeKnownLinkObj( $wgUser->getTalkPage(),
826828 $wgLang->getNsText( NS_TALK ) );
827829
828830 $s .= $n . ' ('.$tl.')';
@@ -834,24 +836,24 @@
835837 $q = '';
836838 } else { $q = "returnto={$rt}"; }
837839
838 - $s .= "\n<br />" . $this->makeKnownLinkObj(
 840+ $s .= "\n<br />" . self::makeKnownLinkObj(
839841 SpecialPage::getTitleFor( 'Userlogin' ),
840842 wfMsg( 'login' ), $q );
841843 } else {
842844 $n = $wgUser->getName();
843845 $rt = $wgTitle->getPrefixedURL();
844 - $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
 846+ $tl = self::makeKnownLinkObj( $wgUser->getTalkPage(),
845847 $wgLang->getNsText( NS_TALK ) );
846848
847849 $tl = " ({$tl})";
848850
849 - $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(),
 851+ $s .= self::makeKnownLinkObj( $wgUser->getUserPage(),
850852 $n ) . "{$tl}<br />" .
851 - $this->makeKnownLinkObj( SpecialPage::getTitleFor( 'Userlogout' ), wfMsg( 'logout' ),
 853+ self::makeKnownLinkObj( SpecialPage::getTitleFor( 'Userlogout' ), wfMsg( 'logout' ),
852854 "returnto={$rt}" ) . ' | ' .
853 - $this->specialLink( 'preferences' );
 855+ self::specialLink( 'preferences' );
854856 }
855 - $s .= ' | ' . $this->makeKnownLink( wfMsgForContent( 'helppage' ),
 857+ $s .= ' | ' . self::makeKnownLink( wfMsgForContent( 'helppage' ),
856858 wfMsg( 'help' ) );
857859
858860 return $s;
@@ -885,7 +887,7 @@
886888 $sep = " |\n";
887889
888890 $s = $this->mainPageLink() . $sep
889 - . $this->specialLink( 'recentchanges' );
 891+ . self::specialLink( 'recentchanges' );
890892
891893 if ( $wgOut->isArticleRelated() ) {
892894 $s .= $sep . $this->editThisPage()
@@ -1042,9 +1044,9 @@
10431045
10441046 $out = '';
10451047 if( $wgRightsPage ) {
1046 - $link = $this->makeKnownLink( $wgRightsPage, $wgRightsText );
 1048+ $link = self::makeKnownLink( $wgRightsPage, $wgRightsText );
10471049 } elseif( $wgRightsUrl ) {
1048 - $link = $this->makeExternalLink( $wgRightsUrl, $wgRightsText );
 1050+ $link = self::makeExternalLink( $wgRightsUrl, $wgRightsText );
10491051 } else {
10501052 # Give up now
10511053 return $out;
@@ -1148,12 +1150,12 @@
11491151 function mainPageLink() {
11501152 $mp = wfMsgForContent( 'mainpage' );
11511153 $mptxt = wfMsg( 'mainpage');
1152 - $s = $this->makeKnownLink( $mp, $mptxt );
 1154+ $s = self::makeKnownLink( $mp, $mptxt );
11531155 return $s;
11541156 }
11551157
11561158 function copyrightLink() {
1157 - $s = $this->makeKnownLink( wfMsgForContent( 'copyrightpage' ),
 1159+ $s = self::makeKnownLink( wfMsgForContent( 'copyrightpage' ),
11581160 wfMsg( 'copyrightpagename' ) );
11591161 return $s;
11601162 }
@@ -1163,12 +1165,12 @@
11641166 if ($privacy == '-') {
11651167 return '';
11661168 } else {
1167 - return $this->makeKnownLink( wfMsgForContent( 'privacypage' ), $privacy);
 1169+ return self::makeKnownLink( wfMsgForContent( 'privacypage' ), $privacy);
11681170 }
11691171 }
11701172
11711173 function aboutLink() {
1172 - $s = $this->makeKnownLink( wfMsgForContent( 'aboutpage' ),
 1174+ $s = self::makeKnownLink( wfMsgForContent( 'aboutpage' ),
11731175 wfMsg( 'aboutsite' ) );
11741176 return $s;
11751177 }
@@ -1178,7 +1180,7 @@
11791181 if ($disclaimers == '-') {
11801182 return '';
11811183 } else {
1182 - return $this->makeKnownLink( wfMsgForContent( 'disclaimerpage' ),
 1184+ return self::makeKnownLink( wfMsgForContent( 'disclaimerpage' ),
11831185 $disclaimers );
11841186 }
11851187 }
@@ -1195,7 +1197,7 @@
11961198 $t = wfMsg( 'viewsource' );
11971199 }
11981200
1199 - $s = $this->makeKnownLinkObj( $wgTitle, $t, $this->editUrlOptions() );
 1201+ $s = self::makeKnownLinkObj( $wgTitle, $t, $this->editUrlOptions() );
12001202 }
12011203 return $s;
12021204 }
@@ -1224,7 +1226,7 @@
12251227 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isAllowed('delete') ) {
12261228 $t = wfMsg( 'deletethispage' );
12271229
1228 - $s = $this->makeKnownLinkObj( $wgTitle, $t, 'action=delete' );
 1230+ $s = self::makeKnownLinkObj( $wgTitle, $t, 'action=delete' );
12291231 } else {
12301232 $s = '';
12311233 }
@@ -1243,7 +1245,7 @@
12441246 $t = wfMsg( 'protectthispage' );
12451247 $q = 'action=protect';
12461248 }
1247 - $s = $this->makeKnownLinkObj( $wgTitle, $t, $q );
 1249+ $s = self::makeKnownLinkObj( $wgTitle, $t, $q );
12481250 } else {
12491251 $s = '';
12501252 }
@@ -1261,7 +1263,7 @@
12621264 $t = wfMsg( 'watchthispage' );
12631265 $q = 'action=watch';
12641266 }
1265 - $s = $this->makeKnownLinkObj( $wgTitle, $t, $q );
 1267+ $s = self::makeKnownLinkObj( $wgTitle, $t, $q );
12661268 } else {
12671269 $s = wfMsg( 'notanarticle' );
12681270 }
@@ -1272,7 +1274,7 @@
12731275 global $wgTitle;
12741276
12751277 if ( $wgTitle->userCanMove() ) {
1276 - return $this->makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ),
 1278+ return self::makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ),
12771279 wfMsg( 'movethispage' ), 'target=' . $wgTitle->getPrefixedURL() );
12781280 } else {
12791281 // no message if page is protected - would be redundant
@@ -1283,14 +1285,14 @@
12841286 function historyLink() {
12851287 global $wgTitle;
12861288
1287 - return $this->makeKnownLinkObj( $wgTitle,
 1289+ return self::makeKnownLinkObj( $wgTitle,
12881290 wfMsg( 'history' ), 'action=history' );
12891291 }
12901292
12911293 function whatLinksHere() {
12921294 global $wgTitle;
12931295
1294 - return $this->makeKnownLinkObj(
 1296+ return self::makeKnownLinkObj(
12951297 SpecialPage::getTitleFor( 'Whatlinkshere', $wgTitle->getPrefixedDBkey() ),
12961298 wfMsg( 'whatlinkshere' ) );
12971299 }
@@ -1298,7 +1300,7 @@
12991301 function userContribsLink() {
13001302 global $wgTitle;
13011303
1302 - return $this->makeKnownLinkObj(
 1304+ return self::makeKnownLinkObj(
13031305 SpecialPage::getTitleFor( 'Contributions', $wgTitle->getDBkey() ),
13041306 wfMsg( 'contributions' ) );
13051307 }
@@ -1317,7 +1319,7 @@
13181320 function emailUserLink() {
13191321 global $wgTitle;
13201322
1321 - return $this->makeKnownLinkObj(
 1323+ return self::makeKnownLinkObj(
13221324 SpecialPage::getTitleFor( 'Emailuser', $wgTitle->getDBkey() ),
13231325 wfMsg( 'emailuser' ) );
13241326 }
@@ -1328,7 +1330,7 @@
13291331 if ( ! $wgOut->isArticleRelated() ) {
13301332 return '(' . wfMsg( 'notanarticle' ) . ')';
13311333 } else {
1332 - return $this->makeKnownLinkObj(
 1334+ return self::makeKnownLinkObj(
13331335 SpecialPage::getTitleFor( 'Recentchangeslinked', $wgTitle->getPrefixedDBkey() ),
13341336 wfMsg( 'recentchangeslinked' ) );
13351337 }
@@ -1365,7 +1367,7 @@
13661368 $text = $wgContLang->getLanguageName( $nt->getInterwiki() );
13671369
13681370 if ( '' == $text ) { $text = $l; }
1369 - $style = $this->getExternalLinkAttributes( $l, $text );
 1371+ $style = self::getExternalLinkAttributes( $l, $text );
13701372 $s .= "<a href=\"{$url}\"{$style}>{$text}</a>";
13711373 }
13721374 if($wgContLang->isRTL()) $s .= '</span>';
@@ -1373,7 +1375,7 @@
13741376 }
13751377
13761378 function bugReportsLink() {
1377 - $s = $this->makeKnownLink( wfMsgForContent( 'bugreportspage' ),
 1379+ $s = self::makeKnownLink( wfMsgForContent( 'bugreportspage' ),
13781380 wfMsg( 'bugreports' ) );
13791381 return $s;
13801382 }
@@ -1385,18 +1387,18 @@
13861388 $id = $t1->getArticleID();
13871389
13881390 if ( 0 == $id ) {
1389 - $s = $this->makeBrokenLink( $t1->getText() );
 1391+ $s = self::makeBrokenLink( $t1->getText() );
13901392 } else {
1391 - $s = $this->makeKnownLink( $t1->getText() );
 1393+ $s = self::makeKnownLink( $t1->getText() );
13921394 }
13931395 $s .= ', ';
13941396
13951397 $id = $t2->getArticleID();
13961398
13971399 if ( 0 == $id ) {
1398 - $s .= $this->makeBrokenLink( $t2->getText() );
 1400+ $s .= self::makeBrokenLink( $t2->getText() );
13991401 } else {
1400 - $s .= $this->makeKnownLink( $t2->getText() );
 1402+ $s .= self::makeKnownLink( $t2->getText() );
14011403 }
14021404 return $s;
14031405 }
@@ -1444,7 +1446,7 @@
14451447 $text = wfMsg( 'talkpage' );
14461448 }
14471449
1448 - $s = $this->makeLinkObj( $link, $text );
 1450+ $s = self::makeLinkObj( $link, $text );
14491451
14501452 return $s;
14511453 }
@@ -1467,7 +1469,7 @@
14681470 $title =& $wgTitle->getTalkPage();
14691471 }
14701472
1471 - return $this->makeKnownLinkObj( $title, wfMsg( 'postcomment' ), 'action=edit&section=new' );
 1473+ return self::makeKnownLinkObj( $title, wfMsg( 'postcomment' ), 'action=edit&section=new' );
14721474 }
14731475
14741476 /* these are used extensively in SkinTemplate, but also some other places */
Index: trunk/phase3/includes/SpecialUnusedcategories.php
@@ -33,9 +33,9 @@
3434 AND page_is_redirect = 0";
3535 }
3636
37 - function formatResult( $skin, $result ) {
 37+ function formatResult( $result ) {
3838 $title = Title::makeTitle( NS_CATEGORY, $result->title );
39 - return $skin->makeLinkObj( $title, $title->getText() );
 39+ return Linker::makeLinkObj( $title, $title->getText() );
4040 }
4141 }
4242
Index: trunk/phase3/includes/SpecialUnusedtemplates.php
@@ -33,10 +33,10 @@
3434 return $sql;
3535 }
3636
37 - function formatResult( $skin, $result ) {
 37+ function formatResult( $result ) {
3838 $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(
4141 SpecialPage::getTitleFor( 'Whatlinkshere' ),
4242 wfMsgHtml( 'unusedtemplateswlh' ),
4343 'target=' . $title->getPrefixedUrl() );
Index: trunk/phase3/includes/SpecialUpload.php
@@ -254,7 +254,7 @@
255255 * @access private
256256 */
257257 function processUpload() {
258 - global $wgUser, $wgOut;
 258+ global $wgOut;
259259
260260 /* Check for PHP error if any, requires php 4.2 or newer */
261261 if( $this->mUploadError == 1/*UPLOAD_ERR_INI_SIZE*/ ) {
@@ -395,18 +395,15 @@
396396 }
397397
398398 if( $nt->getArticleID() ) {
399 - global $wgUser;
400 - $sk = $wgUser->getSkin();
401 - $dlink = $sk->makeKnownLinkObj( $nt );
 399+ $dlink = Linker::makeKnownLinkObj( $nt );
402400 $warning .= '<li>'.wfMsgHtml( 'fileexists', $dlink ).'</li>';
403401 } else {
404402 # If the file existed before and was deleted, warn the user of this
405403 # Don't bother doing so if the image exists now, however
406404 $image = new Image( $nt );
407405 if( $image->wasDeleted() ) {
408 - $skin = $wgUser->getSkin();
409406 $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() );
411408 $warning .= wfOpenElement( 'li' ) . wfMsgWikiHtml( 'filewasdeleted', $llink ) . wfCloseElement( 'li' );
412409 }
413410 }
@@ -591,12 +588,11 @@
592589 * @access private
593590 */
594591 function showSuccess() {
595 - global $wgUser, $wgOut, $wgContLang;
 592+ global $wgOut, $wgContLang;
596593
597 - $sk = $wgUser->getSkin();
598 - $ilink = $sk->makeMediaLink( $this->mUploadSaveName, Image::imageUrl( $this->mUploadSaveName ) );
 594+ $ilink = Linker::makeMediaLink( $this->mUploadSaveName, Image::imageUrl( $this->mUploadSaveName ) );
599595 $dname = $wgContLang->getNsText( NS_IMAGE ) . ':'.$this->mUploadSaveName;
600 - $dlink = $sk->makeKnownLink( $dname, $dname );
 596+ $dlink = Linker::makeKnownLink( $dname, $dname );
601597
602598 $wgOut->addHTML( '<h2>' . wfMsgHtml( 'successfulupload' ) . "</h2>\n" );
603599 $text = wfMsgWikiHtml( 'fileuploaded', $ilink, $dlink );
@@ -704,7 +700,6 @@
705701 $wgOut->addHTML( '<div id="uploadtext">' );
706702 $wgOut->addWikiText( wfMsg( 'uploadtext' ) );
707703 $wgOut->addHTML( '</div>' );
708 - $sk = $wgUser->getSkin();
709704
710705
711706 $sourcefilename = wfMsgHtml( 'sourcefilename' );
Index: trunk/phase3/includes/SpecialListusers.php
@@ -173,9 +173,9 @@
174174 return false;
175175 }
176176
177 - function formatResult( $skin, $result ) {
 177+ function formatResult( $result ) {
178178 $userPage = Title::makeTitle( $result->namespace, $result->title );
179 - $name = $skin->makeLinkObj( $userPage, htmlspecialchars( $userPage->getText() ) );
 179+ $name = Linker::makeLinkObj( $userPage, htmlspecialchars( $userPage->getText() ) );
180180 $groups = null;
181181
182182 if( !isset( $result->numgroups ) || $result->numgroups > 0 ) {
Index: trunk/phase3/includes/ImageGallery.php
@@ -17,7 +17,6 @@
1818 {
1919 var $mImages, $mShowBytes, $mShowFilename;
2020 var $mCaption = false;
21 - var $mSkin = false;
2221
2322 /**
2423 * Is the gallery on a wiki page (i.e. not a special page)
@@ -51,30 +50,6 @@
5251 }
5352
5453 /**
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 - /**
7954 * Add an image to the gallery.
8055 *
8156 * @param $image Image object that is added to the gallery
@@ -136,8 +111,6 @@
137112 function toHTML() {
138113 global $wgLang, $wgIgnoreImageErrors, $wgGenerateThumbnailOnParse;
139114
140 - $sk = $this->getSkin();
141 -
142115 $s = '<table class="gallery" cellspacing="0" cellpadding="0">';
143116 if( $this->mCaption )
144117 $s .= '<td class="galleryheader" colspan="4"><big>' . htmlspecialchars( $this->mCaption ) . '</big></td>';
@@ -157,7 +130,7 @@
158131 else if( $this->mParsing && wfIsBadImage( $nt->getDBkey() ) ) {
159132 # The image is blacklisted, just show it as a text link.
160133 $thumbhtml = '<div style="height: 152px;">'
161 - . $sk->makeKnownLinkObj( $nt, htmlspecialchars( $nt->getText() ) ) . '</div>';
 134+ . Linker::makeKnownLinkObj( $nt, htmlspecialchars( $nt->getText() ) ) . '</div>';
162135 } else if( !( $thumb = $img->getThumbnail( 120, 120, $wgGenerateThumbnailOnParse ) ) ) {
163136 # Error generating thumbnail.
164137 $thumbhtml = '<div style="height: 152px;">'
@@ -166,11 +139,11 @@
167140 else {
168141 $vpad = floor( ( 150 - $thumb->height ) /2 ) - 2;
169142 $thumbhtml = '<div class="thumb" style="padding: ' . $vpad . 'px 0;">'
170 - . $sk->makeKnownLinkObj( $nt, $thumb->toHtml() ) . '</div>';
 143+ . Linker::makeKnownLinkObj( $nt, $thumb->toHtml() ) . '</div>';
171144 }
172145
173146 //TODO
174 - //$ul = $sk->makeLink( $wgContLang->getNsText( Namespace::getUser() ) . ":{$ut}", $ut );
 147+ //$ul = Linker::makeLink( $wgContLang->getNsText( Namespace::getUser() ) . ":{$ut}", $ut );
175148
176149 if( $this->mShowBytes ) {
177150 if( $img->exists() ) {
@@ -185,7 +158,7 @@
186159 }
187160
188161 $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" :
190163 '' ;
191164
192165 # ATTENTION: The newline after <div class="gallerytext"> is needed to accommodate htmltidy which
Index: trunk/phase3/includes/SpecialWantedpages.php
@@ -66,7 +66,7 @@
6767 }
6868
6969
70 - function formatResult( $skin, $result ) {
 70+ function formatResult( $result ) {
7171 global $wgLang;
7272
7373 $title = Title::makeTitleSafe( $result->namespace, $result->title );
@@ -75,19 +75,19 @@
7676 # Check existence; which is stored in the link cache
7777 if( !$title->exists() ) {
7878 # Make a redlink
79 - $pageLink = $skin->makeBrokenLinkObj( $title );
 79+ $pageLink = Linker::makeBrokenLinkObj( $title );
8080 } else {
8181 # Make a a struck-out normal link
82 - $pageLink = "<s>" . $skin->makeLinkObj( $title ) . "</s>";
 82+ $pageLink = "<s>" . Linker::makeLinkObj( $title ) . "</s>";
8383 }
8484 } else {
8585 # Not cached? Don't bother checking existence; it can't
86 - $pageLink = $skin->makeBrokenLinkObj( $title );
 86+ $pageLink = Linker::makeBrokenLinkObj( $title );
8787 }
8888
8989 # Make a link to "what links here" if it's required
9090 $wlhLink = $this->nlinks
91 - ? $this->makeWlhLink( $title, $skin,
 91+ ? $this->makeWlhLink( $title,
9292 wfMsgExt( 'nlinks', array( 'parsemag', 'escape'),
9393 $wgLang->formatNum( $result->value ) ) )
9494 : null;
@@ -98,13 +98,12 @@
9999 /**
100100 * Make a "what links here" link for a specified title
101101 * @param $title Title to make the link for
102 - * @param $skin Skin to use
103102 * @param $text Link text
104103 * @return string
105104 */
106 - function makeWlhLink( &$title, &$skin, $text ) {
 105+ function makeWlhLink( &$title, $text ) {
107106 $wlhTitle = SpecialPage::getTitleFor( 'Whatlinkshere' );
108 - return $skin->makeKnownLinkObj( $wlhTitle, $text, 'target=' . $title->getPrefixedUrl() );
 107+ return Linker::makeKnownLinkObj( $wlhTitle, $text, 'target=' . $title->getPrefixedUrl() );
109108 }
110109
111110 }
Index: trunk/phase3/includes/SpecialConfirmemail.php
@@ -38,8 +38,7 @@
3939 } else {
4040 $title = SpecialPage::getTitleFor( 'Userlogin' );
4141 $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() );
4443 $wgOut->addHtml( wfMsgWikiHtml( 'confirmemail_needlogin', $llink ) );
4544 }
4645 } else {
Index: trunk/phase3/includes/SpecialMostlinked.php
@@ -58,28 +58,26 @@
5959 * Make a link to "what links here" for the specified title
6060 *
6161 * @param $title Title being queried
62 - * @param $skin Skin to use
6362 * @return string
6463 */
65 - function makeWlhLink( &$title, $caption, &$skin ) {
 64+ function makeWlhLink( &$title, $caption ) {
6665 $wlh = SpecialPage::getTitleFor( 'Whatlinkshere', $title->getPrefixedDBkey() );
67 - return $skin->makeKnownLinkObj( $wlh, $caption );
 66+ return Linker::makeKnownLinkObj( $wlh, $caption );
6867 }
6968
7069 /**
7170 * Make links to the page corresponding to the item, and the "what links here" page for it
7271 *
73 - * @param $skin Skin to be used
7472 * @param $result Result row
7573 * @return string
7674 */
77 - function formatResult( $skin, $result ) {
 75+ function formatResult( $result ) {
7876 global $wgLang;
7977 $title = Title::makeTitleSafe( $result->namespace, $result->title );
80 - $link = $skin->makeLinkObj( $title );
 78+ $link = Linker::makeLinkObj( $title );
8179 $wlh = $this->makeWlhLink( $title,
8280 wfMsgExt( 'nlinks', array( 'parsemag', 'escape'),
83 - $wgLang->formatNum( $result->value ) ), $skin );
 81+ $wgLang->formatNum( $result->value ) ) );
8482 return wfSpecialList( $link, $wlh );
8583 }
8684 }
Index: trunk/phase3/includes/SpecialMIMEsearch.php
@@ -59,19 +59,19 @@
6060 ";
6161 }
6262
63 - function formatResult( $skin, $result ) {
 63+ function formatResult( $result ) {
6464 global $wgContLang, $wgLang;
6565
6666 $nt = Title::makeTitle( $result->namespace, $result->title );
6767 $text = $wgContLang->convert( $nt->getText() );
68 - $plink = $skin->makeLink( $nt->getPrefixedText(), $text );
 68+ $plink = Linker::makeLink( $nt->getPrefixedText(), $text );
6969
70 - $download = $skin->makeMediaLink( $nt->getText(), 'fuck me!', wfMsgHtml( 'download' ) );
 70+ $download = Linker::makeMediaLink( $nt->getText(), 'fuck me!', wfMsgHtml( 'download' ) );
7171 $bytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'),
7272 $wgLang->formatNum( $result->img_size ) );
7373 $dimensions = wfMsg( 'widthheight', $wgLang->formatNum( $result->img_width ),
7474 $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 );
7676 $time = $wgLang->timeanddate( $result->img_timestamp );
7777
7878 return "($download) $plink . . $dimensions . . $bytes . . $user . . $time";
Index: trunk/phase3/includes/SpecialMostlinkedcategories.php
@@ -53,13 +53,13 @@
5454 $db->dataSeek( $res, 0 );
5555 }
5656
57 - function formatResult( $skin, $result ) {
 57+ function formatResult( $result ) {
5858 global $wgLang, $wgContLang;
5959
6060 $nt = Title::makeTitle( $result->namespace, $result->title );
6161 $text = $wgContLang->convert( $nt->getText() );
6262
63 - $plink = $skin->makeLinkObj( $nt, htmlspecialchars( $text ) );
 63+ $plink = Linker::makeLinkObj( $nt, htmlspecialchars( $text ) );
6464
6565 $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
6666 $wgLang->formatNum( $result->value ) );
Index: trunk/phase3/includes/SpecialRecentchangeslinked.php
@@ -23,7 +23,6 @@
2424 $hideminor = $wgRequest->getBool( 'hideminor' ) ? 1 : 0;
2525
2626 $wgOut->setPagetitle( wfMsg( 'recentchangeslinked' ) );
27 - $sk = $wgUser->getSkin();
2827
2928 # Validate the title
3029 $nt = Title::newFromURL( $target );
@@ -55,11 +54,11 @@
5655
5756 $hideminor = ($hideminor ? 1 : 0);
5857 if ( $hideminor ) {
59 - $mlink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recentchangeslinked' ),
 58+ $mlink = Linker::makeKnownLink( $wgContLang->specialPage( 'Recentchangeslinked' ),
6059 wfMsg( 'show' ), 'target=' . htmlspecialchars( $nt->getPrefixedURL() ) .
6160 "&days={$days}&limit={$limit}&hideminor=0" );
6261 } else {
63 - $mlink = $sk->makeKnownLink( $wgContLang->specialPage( "Recentchangeslinked" ),
 62+ $mlink = Linker::makeKnownLink( $wgContLang->specialPage( "Recentchangeslinked" ),
6463 wfMsg( "hide" ), "target=" . htmlspecialchars( $nt->getPrefixedURL() ) .
6564 "&days={$days}&limit={$limit}&hideminor=1" );
6665 }
@@ -138,7 +137,7 @@
139138 }
140139 $res = $dbr->query( $sql, $fname );
141140
142 - $wgOut->addHTML("&lt; ".$sk->makeKnownLinkObj($nt, "", "redirect=no" )."<br />\n");
 141+ $wgOut->addHTML("&lt; ".Linker::makeKnownLinkObj($nt, "", "redirect=no" )."<br />\n");
143142 $note = wfMsg( "rcnote", $limit, $days, $wgLang->timeAndDate( wfTimestampNow(), true ) );
144143 $wgOut->addHTML( "<hr />\n{$note}\n<br />" );
145144
Index: trunk/phase3/includes/ChangesList.php
@@ -34,8 +34,7 @@
3535 #
3636
3737 /** @todo document */
38 - function ChangesList( &$skin ) {
39 - $this->skin =& $skin;
 38+ function ChangesList() {
4039 $this->preCacheMessages();
4140 }
4241
@@ -47,10 +46,9 @@
4847 * @return ChangesList derivative
4948 */
5049 function newFromUser( &$user ) {
51 - $sk =& $user->getSkin();
5250 $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();
5553 } else {
5654 return $list;
5755 }
@@ -112,13 +110,13 @@
113111 # Diff
114112 $s .= '(' . $this->message['diff'] . ') (';
115113 # Hist
116 - $s .= $this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), $this->message['hist'], 'action=history' ) .
 114+ $s .= Linker::makeKnownLinkObj( $rc->getMovedToTitle(), $this->message['hist'], 'action=history' ) .
117115 ') . . ';
118116
119117 # "[[x]] moved to [[y]]"
120118 $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(), '' ) );
123121 }
124122
125123 function insertDateHeader(&$s, $rc_timestamp) {
@@ -139,7 +137,7 @@
140138
141139 function insertLog(&$s, $title, $logtype) {
142140 $logname = LogPage::logName( $logtype );
143 - $s .= '(' . $this->skin->makeKnownLinkObj($title, $logname ) . ')';
 141+ $s .= '(' . Linker::makeKnownLinkObj($title, $logname ) . ')';
144142 }
145143
146144
@@ -151,7 +149,7 @@
152150 $rcidparam = $unpatrolled
153151 ? array( 'rcid' => $rc->mAttribs['rc_id'] )
154152 : array();
155 - $diffLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['diff'],
 153+ $diffLink = Linker::makeKnownLinkObj( $rc->getTitle(), $this->message['diff'],
156154 wfArrayToCGI( array(
157155 'curid' => $rc->mAttribs['rc_cur_id'],
158156 'diff' => $rc->mAttribs['rc_this_oldid'],
@@ -162,7 +160,7 @@
163161 $s .= '('.$diffLink.') (';
164162
165163 # History link
166 - $s .= $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['hist'],
 164+ $s .= Linker::makeKnownLinkObj( $rc->getTitle(), $this->message['hist'],
167165 wfArrayToCGI( array(
168166 'curid' => $rc->mAttribs['rc_cur_id'],
169167 'action' => 'history' ) ) );
@@ -176,7 +174,7 @@
177175 $params = ( $unpatrolled && $rc->mAttribs['rc_type'] == RC_NEW )
178176 ? 'rcid='.$rc->mAttribs['rc_id']
179177 : '';
180 - $articlelink = ' '. $this->skin->makeKnownLinkObj( $rc->getTitle(), '', $params );
 178+ $articlelink = ' '. Linker::makeKnownLinkObj( $rc->getTitle(), '', $params );
181179 if($watched) $articlelink = '<strong>'.$articlelink.'</strong>';
182180 global $wgContLang;
183181 $articlelink .= $wgContLang->getDirMark();
@@ -192,15 +190,15 @@
193191
194192 /** Insert links to user page, user talk page and eventually a blocking link */
195193 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'] );
198196 }
199197
200198 /** insert a formatted comment */
201199 function insertComment(&$s, &$rc) {
202200 # Add comment
203201 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() );
205203 }
206204 }
207205
@@ -324,23 +322,23 @@
325323 # Make article link
326324 if( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
327325 $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(), '' ) );
330328 } elseif( $rc_namespace == NS_SPECIAL ) {
331329 list( $specialName, $logtype ) = SpecialPage::resolveAliasWithSubpage( $rc_title );
332330 if ( $specialName == 'Log' ) {
333331 # Log updates, etc
334332 $logname = LogPage::logName( $logtype );
335 - $clink = '(' . $this->skin->makeKnownLinkObj( $rc->getTitle(), $logname ) . ')';
 333+ $clink = '(' . Linker::makeKnownLinkObj( $rc->getTitle(), $logname ) . ')';
336334 } else {
337335 wfDebug( "Unexpected special page in recentchanges\n" );
338336 $clink = '';
339337 }
340338 } elseif( $rc->unpatrolled && $rc_type == RC_NEW ) {
341339 # 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}" );
343341 } else {
344 - $clink = $this->skin->makeKnownLinkObj( $rc->getTitle(), '' );
 342+ $clink = Linker::makeKnownLinkObj( $rc->getTitle(), '' );
345343 }
346344
347345 $time = $wgContLang->time( $rc_timestamp, true, true );
@@ -358,31 +356,31 @@
359357 $querycur = $curIdEq."&diff=0&oldid=$rc_this_oldid";
360358 $querydiff = $curIdEq."&diff=$rc_this_oldid&oldid=$rc_last_oldid$rcIdQuery";
361359 $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 );
363361 if( $rc_type == RC_NEW || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
364362 if( $rc_type != RC_NEW ) {
365363 $curLink = $this->message['cur'];
366364 }
367365 $diffLink = $this->message['diff'];
368366 } else {
369 - $diffLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['diff'], $querydiff, '' ,'', $aprops );
 367+ $diffLink = Linker::makeKnownLinkObj( $rc->getTitle(), $this->message['diff'], $querydiff, '' ,'', $aprops );
370368 }
371369
372370 # Make "last" link
373371 if( $rc_last_oldid == 0 || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
374372 $lastLink = $this->message['last'];
375373 } else {
376 - $lastLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['last'],
 374+ $lastLink = Linker::makeKnownLinkObj( $rc->getTitle(), $this->message['last'],
377375 $curIdEq.'&diff='.$rc_this_oldid.'&oldid='.$rc_last_oldid . $rcIdQuery );
378376 }
379377
380 - $rc->userlink = $this->skin->userLink( $rc_user, $rc_user_text );
 378+ $rc->userlink = Linker::userLink( $rc_user, $rc_user_text );
381379
382380 $rc->lastlink = $lastLink;
383381 $rc->curlink = $curLink;
384382 $rc->difflink = $diffLink;
385383
386 - $rc->usertalklink = $this->skin->userToolLinks( $rc_user, $rc_user_text );
 384+ $rc->usertalklink = Linker::userToolLinks( $rc_user, $rc_user_text );
387385
388386 # Put accumulated information into the cache, for later display
389387 # Page moves go on their own line
@@ -472,13 +470,13 @@
473471 if( $isnew ) {
474472 $r .= $this->message['changes'];
475473 } else {
476 - $r .= $this->skin->makeKnownLinkObj( $block[0]->getTitle(),
 474+ $r .= Linker::makeKnownLinkObj( $block[0]->getTitle(),
477475 $this->message['changes'], $curIdEq."&diff=$currentRevision&oldid=$oldid" );
478476 }
479477 $r .= '; ';
480478
481479 # History
482 - $r .= $this->skin->makeKnownLinkObj( $block[0]->getTitle(),
 480+ $r .= Linker::makeKnownLinkObj( $block[0]->getTitle(),
483481 $this->message['history'], $curIdEq.'&action=history' );
484482 $r .= ')';
485483 }
@@ -509,7 +507,7 @@
510508 if( $rc_type == RC_LOG ) {
511509 $link = $rcObj->timestamp;
512510 } else {
513 - $link = $this->skin->makeKnownLinkObj( $rcObj->getTitle(), $rcObj->timestamp, $curIdEq.'&'.$o );
 511+ $link = Linker::makeKnownLinkObj( $rcObj->getTitle(), $rcObj->timestamp, $curIdEq.'&'.$o );
514512 }
515513 $link = '<tt>'.$link.'</tt>';
516514
@@ -520,7 +518,7 @@
521519 $r .= $rcObj->lastlink;
522520 $r .= ') . . '.$rcObj->userlink;
523521 $r .= $rcObj->usertalklink;
524 - $r .= $this->skin->commentBlock( $rc_comment, $rcObj->getTitle() );
 522+ $r .= Linker::commentBlock( $rc_comment, $rcObj->getTitle() );
525523 $r .= "<br />\n";
526524 }
527525 $r .= "</div>\n";
@@ -616,14 +614,14 @@
617615 $r .= ' ('. $rcObj->difflink .'; ';
618616
619617 # Hist
620 - $r .= $this->skin->makeKnownLinkObj( $rcObj->getTitle(), wfMsg( 'hist' ), $curIdEq.'&action=history' );
 618+ $r .= Linker::makeKnownLinkObj( $rcObj->getTitle(), wfMsg( 'hist' ), $curIdEq.'&action=history' );
621619
622620 # User/talk
623621 $r .= ') . . '.$rcObj->userlink . $rcObj->usertalklink;
624622
625623 # Comment
626624 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() );
628626 }
629627
630628 if( $rcObj->numberofWatchingusers > 0 ) {
Index: trunk/phase3/includes/SpecialUndelete.php
@@ -482,7 +482,7 @@
483483 }
484484
485485 /* private */ function showList() {
486 - global $wgLang, $wgContLang, $wgUser, $wgOut;
 486+ global $wgLang, $wgContLang, $wgOut;
487487
488488 # List undeletable articles
489489 $result = PageArchive::listAllPages();
@@ -494,12 +494,11 @@
495495 }
496496 $wgOut->addWikiText( wfMsg( "undeletepagetext" ) );
497497
498 - $sk = $wgUser->getSkin();
499498 $undelete =& SpecialPage::getTitleFor( 'Undelete' );
500499 $wgOut->addHTML( "<ul>\n" );
501500 while( $row = $result->fetchObject() ) {
502501 $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() );
504503 $revs = wfMsgHtml( 'undeleterevisions', $wgLang->formatNum( $row->count ) );
505504 $wgOut->addHtml( "<li>{$link} ({$revs})</li>\n" );
506505 }
@@ -582,7 +581,6 @@
583582 /* private */ function showHistory() {
584583 global $wgLang, $wgUser, $wgOut;
585584
586 - $sk = $wgUser->getSkin();
587585 if ( $this->mAllowed ) {
588586 $wgOut->setPagetitle( wfMsg( "undeletepage" ) );
589587 } else {
@@ -671,15 +669,15 @@
672670 $ts = wfTimestamp( TS_MW, $row->ar_timestamp );
673671 if ( $this->mAllowed ) {
674672 $checkBox = wfCheck( "ts$ts" );
675 - $pageLink = $sk->makeKnownLinkObj( $titleObj,
 673+ $pageLink = Linker::makeKnownLinkObj( $titleObj,
676674 $wgLang->timeanddate( $ts, true ),
677675 "target=$target&timestamp=$ts" );
678676 } else {
679677 $checkBox = '';
680678 $pageLink = $wgLang->timeanddate( $ts, true );
681679 }
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 );
684682 $wgOut->addHTML( "<li>$checkBox $pageLink . . $userLink $comment</li>\n" );
685683
686684 }
@@ -699,14 +697,14 @@
700698 $checkBox = wfCheck( "fileid" . $row->fa_id );
701699 $key = urlencode( $row->fa_storage_key );
702700 $target = urlencode( $this->mTarget );
703 - $pageLink = $sk->makeKnownLinkObj( $titleObj,
 701+ $pageLink = Linker::makeKnownLinkObj( $titleObj,
704702 $wgLang->timeanddate( $ts, true ),
705703 "target=$target&file=$key" );
706704 } else {
707705 $checkBox = '';
708706 $pageLink = $wgLang->timeanddate( $ts, true );
709707 }
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 );
711709 $data =
712710 wfMsgHtml( 'widthheight',
713711 $wgLang->formatNum( $row->fa_width ),
@@ -714,7 +712,7 @@
715713 ' (' .
716714 wfMsgHtml( 'nbytes', $wgLang->formatNum( $row->fa_size ) ) .
717715 ')';
718 - $comment = $sk->commentBlock( $row->fa_description );
 716+ $comment = Linker::commentBlock( $row->fa_description );
719717 $wgOut->addHTML( "<li>$checkBox $pageLink . . $userLink $data $comment</li>\n" );
720718 }
721719 $files->free();
@@ -732,7 +730,7 @@
733731 }
734732
735733 function undelete() {
736 - global $wgOut, $wgUser;
 734+ global $wgOut;
737735 if( !is_null( $this->mTargetObj ) ) {
738736 $archive = new PageArchive( $this->mTargetObj );
739737 $ok = true;
@@ -743,8 +741,7 @@
744742 $this->mFileVersions );
745743
746744 if( $ok ) {
747 - $skin =& $wgUser->getSkin();
748 - $link = $skin->makeKnownLinkObj( $this->mTargetObj );
 745+ $link = Linker::makeKnownLinkObj( $this->mTargetObj );
749746 $wgOut->addHtml( wfMsgWikiHtml( 'undeletedpage', $link ) );
750747 return true;
751748 }
Index: trunk/phase3/includes/CategoryPage.php
@@ -49,8 +49,7 @@
5050 var $title, $limit, $from, $until,
5151 $articles, $articles_start_char,
5252 $children, $children_start_char,
53 - $showGallery, $gallery,
54 - $skin;
 53+ $showGallery, $gallery;
5554
5655 function __construct( $title, $from = '', $until = '' ) {
5756 global $wgCategoryPagingLimit;
@@ -99,21 +98,13 @@
10099 }
101100 }
102101
103 - function getSkin() {
104 - if ( !$this->skin ) {
105 - global $wgUser;
106 - $this->skin = $wgUser->getSkin();
107 - }
108 - return $this->skin;
109 - }
110 -
111102 /**
112103 * Add a subcategory to the internal lists
113104 */
114105 function addSubcategory( $title, $sortkey, $pageLength ) {
115106 global $wgContLang;
116107 // Subcategory; strip the 'Category' namespace from the link text.
117 - $this->children[] = $this->getSkin()->makeKnownLinkObj(
 108+ $this->children[] = Linker::makeKnownLinkObj(
118109 $title, $wgContLang->convertHtml( $title->getText() ) );
119110
120111 $this->children_start_char[] = $this->getSubcategorySortChar( $title, $sortkey );
@@ -159,7 +150,7 @@
160151 */
161152 function addPage( $title, $sortkey, $pageLength ) {
162153 global $wgContLang;
163 - $this->articles[] = $this->getSkin()->makeSizeLinkObj(
 154+ $this->articles[] = Linker::makeSizeLinkObj(
164155 $pageLength, $title, $wgContLang->convert( $title->getPrefixedText() )
165156 );
166157 $this->articles_start_char[] = $wgContLang->convert( $wgContLang->firstChar( $sortkey ) );
@@ -388,17 +379,16 @@
389380 */
390381 function pagingLinks( $title, $first, $last, $limit, $query = array() ) {
391382 global $wgUser, $wgLang;
392 - $sk =& $this->getSkin();
393383 $limitText = $wgLang->formatNum( $limit );
394384
395385 $prevLink = htmlspecialchars( wfMsg( 'prevn', $limitText ) );
396386 if( $first != '' ) {
397 - $prevLink = $sk->makeLinkObj( $title, $prevLink,
 387+ $prevLink = Linker::makeLinkObj( $title, $prevLink,
398388 wfArrayToCGI( $query + array( 'until' => $first ) ) );
399389 }
400390 $nextLink = htmlspecialchars( wfMsg( 'nextn', $limitText ) );
401391 if( $last != '' ) {
402 - $nextLink = $sk->makeLinkObj( $title, $nextLink,
 392+ $nextLink = Linker::makeLinkObj( $title, $nextLink,
403393 wfArrayToCGI( $query + array( 'from' => $last ) ) );
404394 }
405395
Index: trunk/phase3/includes/SpecialNewpages.php
@@ -84,21 +84,20 @@
8585 /**
8686 * Format a row, providing the timestamp, links to the page/history, size, user links, and a comment
8787 *
88 - * @param $skin Skin to use
8988 * @param $result Result row
9089 * @return string
9190 */
92 - function formatResult( $skin, $result ) {
 91+ function formatResult( $result ) {
9392 global $wgLang, $wgContLang;
9493 $dm = $wgContLang->getDirMark();
9594
9695 $title = Title::makeTitleSafe( $result->namespace, $result->title );
9796 $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' );
10099 $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 );
103102
104103 return "{$time} {$dm}{$plink} ({$hist}) {$dm}[{$length}] {$dm}{$ulink} {$comment}";
105104 }
Index: trunk/phase3/includes/AjaxFunctions.php
@@ -71,8 +71,6 @@
7272 function wfSajaxSearch( $term ) {
7373 global $wgContLang, $wgOut;
7474 $limit = 16;
75 -
76 - $l = new Linker;
7775
7876 $term = str_replace( ' ', '_', $wgContLang->ucfirst(
7977 $wgContLang->checkTitleEncoding( $wgContLang->recodeInput( js_unescape( $term ) ) )
@@ -94,10 +92,10 @@
9593 $i=0;
9694 while ( ( $row = $db->fetchObject( $res ) ) && ( ++$i <= $limit ) ) {
9795 $nt = Title::newFromDBkey( $row->page_title );
98 - $r .= '<li>' . $l->makeKnownLinkObj( $nt ) . "</li>\n";
 96+ $r .= '<li>' . Linker::makeKnownLinkObj( $nt ) . "</li>\n";
9997 }
10098 if ( $i > $limit ) {
101 - $more = '<i>' . $l->makeKnownLink( $wgContLang->specialPage( "Allpages" ),
 99+ $more = '<i>' . Linker::makeKnownLink( $wgContLang->specialPage( "Allpages" ),
102100 wfMsg('moredotdotdot'),
103101 "namespace=0&from=" . wfUrlEncode ( $term ) ) .
104102 '</i>';
@@ -113,10 +111,10 @@
114112 . wfMsg( 'hideresults' ) . '</a></div>'
115113 . '<h1 class="firstHeading">'.wfMsg('search')
116114 . '</h1><div id="contentSub">'. $subtitle . '</div><ul><li>'
117 - . $l->makeKnownLink( $wgContLang->specialPage( 'Search' ),
 115+ . Linker::makeKnownLink( $wgContLang->specialPage( 'Search' ),
118116 wfMsg( 'searchcontaining', $term ),
119117 "search=$term&fulltext=Search" )
120 - . '</li><li>' . $l->makeKnownLink( $wgContLang->specialPage( 'Search' ),
 118+ . '</li><li>' . Linker::makeKnownLink( $wgContLang->specialPage( 'Search' ),
121119 wfMsg( 'searchnamed', $term ) ,
122120 "search=$term&go=Go" )
123121 . "</li></ul><h2>" . wfMsg( 'articletitles', $term ) . "</h2>"
Index: trunk/phase3/includes/User.php
@@ -2388,9 +2388,7 @@
23892389 }
23902390 $title = self::getGroupPage( $group );
23912391 if( $title ) {
2392 - global $wgUser;
2393 - $sk = $wgUser->getSkin();
2394 - return $sk->makeLinkObj( $title, $text );
 2392+ return Linker::makeLinkObj( $title, $text );
23952393 } else {
23962394 return $text;
23972395 }
Index: trunk/phase3/includes/SpecialDisambiguations.php
@@ -23,11 +23,8 @@
2424 return Title::makeTitleSafe( NS_MEDIAWIKI, 'disambiguationspage');
2525 }
2626
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";
3229 }
3330
3431 function getSQL() {
@@ -88,15 +85,15 @@
8986 return '';
9087 }
9188
92 - function formatResult( $skin, $result ) {
 89+ function formatResult( $result ) {
9390 global $wgContLang;
9491 $title = Title::newFromId( $result->value );
9592 $dp = Title::makeTitle( $result->namespace, $result->title );
9693
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');
9996 $arr = $wgContLang->getArrow();
100 - $to = $skin->makeKnownLinkObj( $dp,'');
 97+ $to = Linker::makeKnownLinkObj( $dp,'');
10198
10299 return "$from $edit $arr $to";
103100 }
Index: trunk/phase3/includes/SpecialMostrevisions.php
@@ -38,17 +38,17 @@
3939 ";
4040 }
4141
42 - function formatResult( $skin, $result ) {
 42+ function formatResult( $result ) {
4343 global $wgLang, $wgContLang;
4444
4545 $nt = Title::makeTitle( $result->namespace, $result->title );
4646 $text = $wgContLang->convert( $nt->getPrefixedText() );
4747
48 - $plink = $skin->makeKnownLinkObj( $nt, $text );
 48+ $plink = Linker::makeKnownLinkObj( $nt, $text );
4949
5050 $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape'),
5151 $wgLang->formatNum( $result->value ) );
52 - $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' );
 52+ $nlink = Linker::makeKnownLinkObj( $nt, $nl, 'action=history' );
5353
5454 return wfSpecialList($plink, $nlink);
5555 }
Index: trunk/phase3/includes/SpecialCategories.php
@@ -44,10 +44,10 @@
4545 return false;
4646 }
4747
48 - function formatResult( $skin, $result ) {
 48+ function formatResult( $result ) {
4949 global $wgLang;
5050 $title = Title::makeTitle( NS_CATEGORY, $result->title );
51 - $plink = $skin->makeLinkObj( $title, $title->getText() );
 51+ $plink = Linker::makeLinkObj( $title, $title->getText() );
5252 $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
5353 $wgLang->formatNum( $result->count ) );
5454 return wfSpecialList($plink, $nlinks);
Index: trunk/phase3/includes/SpecialStatistics.php
@@ -82,17 +82,16 @@
8383
8484 $wgOut->addWikiText( $text );
8585
86 - global $wgDisableCounters, $wgMiserMode, $wgUser, $wgLang, $wgContLang;
 86+ global $wgDisableCounters, $wgMiserMode, $wgLang, $wgContLang;
8787 if( !$wgDisableCounters && !$wgMiserMode ) {
8888 $sql = "SELECT page_namespace, page_title, page_counter FROM {$page} WHERE page_is_redirect = 0 AND page_counter > 0 ORDER BY page_counter DESC";
8989 $sql = $dbr->limitResult($sql, 10, 0);
9090 $res = $dbr->query( $sql, $fname );
9191 if( $res ) {
9292 $wgOut->addHtml( '<h2>' . wfMsgHtml( 'statistics-mostpopular' ) . '</h2>' );
93 - $skin =& $wgUser->getSkin();
9493 $wgOut->addHtml( '<ol>' );
9594 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 ) );
9796 $dirmark = $wgContLang->getDirMark();
9897 $wgOut->addHtml( '<li>' . $link . $dirmark . ' [' . $wgLang->formatNum( $row->page_counter ) . ']</li>' );
9998 }
Index: trunk/phase3/includes/SpecialSpecialpages.php
@@ -9,25 +9,23 @@
1010 *
1111 */
1212 function wfSpecialSpecialpages() {
13 - global $wgOut, $wgUser;
 13+ global $wgOut;
1414
1515 $wgOut->setRobotpolicy( 'index,nofollow' );
16 - $sk = $wgUser->getSkin();
1716
1817 /** Pages available to all */
19 - wfSpecialSpecialpages_gen( SpecialPage::getRegularPages(), 'spheading', $sk );
 18+ wfSpecialSpecialpages_gen( SpecialPage::getRegularPages(), 'spheading' );
2019
2120 /** Restricted special pages */
22 - wfSpecialSpecialpages_gen( SpecialPage::getRestrictedPages(), 'restrictedpheading', $sk );
 21+ wfSpecialSpecialpages_gen( SpecialPage::getRestrictedPages(), 'restrictedpheading' );
2322 }
2423
2524 /**
2625 * sub function generating the list of pages
2726 * @param $pages the list of pages
2827 * @param $heading header to be used
29 - * @param $sk skin object ???
3028 */
31 -function wfSpecialSpecialpages_gen($pages,$heading,$sk) {
 29+function wfSpecialSpecialpages_gen( $pages, $heading ) {
3230 global $wgOut, $wgSortSpecialPages;
3331
3432 if( count( $pages ) == 0 ) {
@@ -51,7 +49,7 @@
5250 /** Now output the HTML */
5351 $wgOut->addHTML( '<h2>' . wfMsgHtml( $heading ) . "</h2>\n<ul>" );
5452 foreach ( $sortedPages as $desc => $title ) {
55 - $link = $sk->makeKnownLinkObj( $title, $desc );
 53+ $link = Linker::makeKnownLinkObj( $title, $desc );
5654 $wgOut->addHTML( "<li>{$link}</li>\n" );
5755 }
5856 $wgOut->addHTML( "</ul>\n" );
Index: trunk/phase3/includes/SpecialUnwatchedpages.php
@@ -39,14 +39,14 @@
4040
4141 function sortDescending() { return false; }
4242
43 - function formatResult( $skin, $result ) {
 43+ function formatResult( $result ) {
4444 global $wgContLang;
4545
4646 $nt = Title::makeTitle( $result->namespace, $result->title );
4747 $text = $wgContLang->convert( $nt->getPrefixedText() );
4848
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' );
5151
5252 return wfSpecialList( $plink, $wlink );
5353 }
Index: trunk/phase3/includes/SpecialUserlogin.php
@@ -177,7 +177,6 @@
178178 } else {
179179 # Confirm that the account was created
180180 global $wgOut;
181 - $skin = $wgUser->getSkin();
182181 $self = SpecialPage::getTitleFor( 'Userlogin' );
183182 $wgOut->setPageTitle( wfMsgHtml( 'accountcreated' ) );
184183 $wgOut->setArticleRelated( false );
@@ -727,15 +726,13 @@
728727 * @param $lang Language code
729728 */
730729 function makeLanguageSelectorLink( $text, $lang ) {
731 - global $wgUser;
732730 $self = SpecialPage::getTitleFor( 'Userlogin' );
733731 $attr[] = 'uselang=' . $lang;
734732 if( $this->mType == 'signup' )
735733 $attr[] = 'type=signup';
736734 if( $this->mReturnTo )
737735 $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 ) );
740737 }
741738
742739 }
Index: trunk/phase3/includes/SpecialWhatlinkshere.php
@@ -18,12 +18,10 @@
1919 class WhatLinksHerePage {
2020 var $request, $par;
2121 var $limit, $from, $dir, $target;
22 - var $selfTitle, $skin;
 22+ var $selfTitle;
2323
2424 function WhatLinksHerePage( &$request, $par = null ) {
25 - global $wgUser;
2625 $this->request =& $request;
27 - $this->skin =& $wgUser->getSkin();
2826 $this->par = $par;
2927 }
3028
@@ -59,7 +57,7 @@
6058
6159 $isredir = ' (' . wfMsg( 'isredirect' ) . ")\n";
6260
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");
6462
6563 $this->showIndirectLinks( 0, $this->target, $this->limit, $this->from, $this->dir );
6664 }
@@ -207,7 +205,7 @@
208206 $extra = '';
209207 }
210208
211 - $link = $this->skin->makeKnownLinkObj( $nt, '', $extra );
 209+ $link = Linker::makeKnownLinkObj( $nt, '', $extra );
212210 $wgOut->addHTML( '<li>'.$link );
213211
214212 // Display properties (redirect or template)
@@ -238,7 +236,7 @@
239237 }
240238
241239 function makeSelfLink( $text, $query ) {
242 - return $this->skin->makeKnownLinkObj( $this->selfTitle, $text, $query );
 240+ return Linker::makeKnownLinkObj( $this->selfTitle, $text, $query );
243241 }
244242
245243 function getPrevNext( $limit, $prevId, $nextId ) {
Index: trunk/phase3/includes/SpecialRecentchanges.php
@@ -222,7 +222,6 @@
223223 }
224224
225225 // And now for the content
226 - $sk = $wgUser->getSkin();
227226 $wgOut->setSyndicated( true );
228227
229228 $list = ChangesList::newFromUser( $wgUser );
@@ -421,9 +420,8 @@
422421 *
423422 */
424423 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 ),
428426 ($lim ? $wgLang->formatNum( "{$lim}" ) : wfMsg( 'recentchangesall' ) ), "{$more}" .
429427 ($d ? "days={$d}&" : '') . 'limit='.$lim );
430428 return $s;
@@ -433,9 +431,8 @@
434432 *
435433 */
436434 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 ),
440437 ($d ? $wgLang->formatNum( "{$d}" ) : wfMsg( 'recentchangesall' ) ), $more.'days='.$d .
441438 ($lim ? '&limit='.$lim : '') );
442439 return $s;
@@ -478,9 +475,8 @@
479476 * @param $options
480477 */
481478 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' ),
485481 htmlspecialchars( $title ), wfArrayToCGI( $override, $options ) );
486482 }
487483
@@ -621,12 +617,11 @@
622618 }
623619
624620 function rcFormatDiffRow( $title, $oldid, $newid, $timestamp, $comment ) {
625 - global $wgFeedDiffCutoff, $wgContLang, $wgUser;
 621+ global $wgFeedDiffCutoff, $wgContLang;
626622 $fname = 'rcFormatDiff';
627623 wfProfileIn( $fname );
628624
629 - $skin = $wgUser->getSkin();
630 - $completeText = '<p>' . $skin->formatComment( $comment ) . "</p>\n";
 625+ $completeText = '<p>' . Linker::formatComment( $comment ) . "</p>\n";
631626
632627 if( $title->getNamespace() >= 0 ) {
633628 if( $oldid ) {
Index: trunk/phase3/includes/Linker.php
@@ -16,18 +16,20 @@
1717 * @package MediaWiki
1818 */
1919 class Linker {
20 -
2120 function Linker() {}
2221
2322 /**
2423 * @deprecated
2524 */
26 - function postParseLinkColour( $s = NULL ) {
 25+ private static function postParseLinkColour( $s = NULL ) {
2726 return NULL;
2827 }
2928
30 - /** @todo document */
31 - function getExternalLinkAttributes( $link, $text, $class='' ) {
 29+ /**
 30+ * @todo document
 31+ * @static
 32+ */
 33+ protected static function getExternalLinkAttributes( $link, $text, $class='' ) {
3234 $link = htmlspecialchars( $link );
3335
3436 $r = ($class != '') ? " class=\"$class\"" : " class=\"external\"";
@@ -36,7 +38,11 @@
3739 return $r;
3840 }
3941
40 - function getInterwikiLinkAttributes( $link, $text, $class='' ) {
 42+ /**
 43+ * @todo document
 44+ * @static
 45+ */
 46+ protected static function getInterwikiLinkAttributes( $link, $text, $class='' ) {
4147 global $wgContLang;
4248
4349 $same = ($link == $text);
@@ -51,8 +57,12 @@
5258 return $r;
5359 }
5460
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 ) {
5767 $link = urldecode( $link );
5868 $link = str_replace( '_', ' ', $link );
5969 $link = htmlspecialchars( $link );
@@ -70,11 +80,13 @@
7181 }
7282
7383 /**
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
7789 */
78 - function getInternalLinkAttributesObj( &$nt, $text, $broken = false ) {
 90+ protected static function getInternalLinkAttributesObj( &$nt, $text, $broken = false ) {
7991 if( $broken == 'stub' ) {
8092 $r = ' class="stub"';
8193 } else if ( $broken == 'yes' ) {
@@ -90,22 +102,24 @@
91103 /**
92104 * This function is a shortcut to makeLinkObj(Title::newFromText($title),...). Do not call
93105 * 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
99111 * be included in the link text. Other characters will be appended after
100112 * the end of the link.
 113+ *
 114+ * @static
101115 */
102 - function makeLink( $title, $text = '', $query = '', $trail = '' ) {
 116+ public static function makeLink( $title, $text = '', $query = '', $trail = '' ) {
103117 wfProfileIn( 'Linker::makeLink' );
104118 $nt = Title::newFromText( $title );
105119 if ($nt) {
106 - $result = $this->makeLinkObj( Title::newFromText( $title ), $text, $query, $trail );
 120+ $result = self::makeLinkObj( $nt, $text, $query, $trail );
107121 } 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;
110124 }
111125
112126 wfProfileOut( 'Linker::makeLink' );
@@ -116,19 +130,21 @@
117131 * This function is a shortcut to makeKnownLinkObj(Title::newFromText($title),...). Do not call
118132 * it if you already have a title object handy. See makeKnownLinkObj for further documentation.
119133 *
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
124138 * be included in the link text. Other characters will be appended after
125139 * the end of the link.
 140+ *
 141+ * @static
126142 */
127 - function makeKnownLink( $title, $text = '', $query = '', $trail = '', $prefix = '',$aprops = '') {
 143+ public static function makeKnownLink( $title, $text = '', $query = '', $trail = '', $prefix = '',$aprops = '') {
128144 $nt = Title::newFromText( $title );
129145 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 );
131147 } else {
132 - wfDebug( 'Invalid title passed to Linker::makeKnownLink(): "'.$title."\"\n" );
 148+ wfDebug( "Invalid title passed to Linker::makeKnownLink(): \"$title\"\n" );
133149 return $text == '' ? $title : $text;
134150 }
135151 }
@@ -137,19 +153,21 @@
138154 * This function is a shortcut to makeBrokenLinkObj(Title::newFromText($title),...). Do not call
139155 * it if you already have a title object handy. See makeBrokenLinkObj for further documentation.
140156 *
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
145161 * be included in the link text. Other characters will be appended after
146162 * the end of the link.
 163+ *
 164+ * @static
147165 */
148 - function makeBrokenLink( $title, $text = '', $query = '', $trail = '' ) {
 166+ public static function makeBrokenLink( $title, $text = '', $query = '', $trail = '' ) {
149167 $nt = Title::newFromText( $title );
150168 if ($nt) {
151 - return $this->makeBrokenLinkObj( Title::newFromText( $title ), $text, $query, $trail );
 169+ return self::makeBrokenLinkObj( Title::newFromText( $title ), $text, $query, $trail );
152170 } else {
153 - wfDebug( 'Invalid title passed to Linker::makeBrokenLink(): "'.$title."\"\n" );
 171+ wfDebug( "Invalid title passed to Linker::makeBrokenLink(): \"$title\"\n" );
154172 return $text == '' ? $title : $text;
155173 }
156174 }
@@ -158,19 +176,21 @@
159177 * This function is a shortcut to makeStubLinkObj(Title::newFromText($title),...). Do not call
160178 * it if you already have a title object handy. See makeStubLinkObj for further documentation.
161179 *
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
166184 * be included in the link text. Other characters will be appended after
167185 * the end of the link.
 186+ *
 187+ * @static
168188 */
169 - function makeStubLink( $title, $text = '', $query = '', $trail = '' ) {
 189+ public static function makeStubLink( $title, $text = '', $query = '', $trail = '' ) {
170190 $nt = Title::newFromText( $title );
171191 if ($nt) {
172 - return $this->makeStubLinkObj( Title::newFromText( $title ), $text, $query, $trail );
 192+ return self::makeStubLinkObj( Title::newFromText( $title ), $text, $query, $trail );
173193 } else {
174 - wfDebug( 'Invalid title passed to Linker::makeStubLink(): "'.$title."\"\n" );
 194+ wfDebug( "Invalid title passed to Linker::makeStubLink(): \"$title\"\n" );
175195 return $text == '' ? $title : $text;
176196 }
177197 }
@@ -180,22 +200,22 @@
181201 * call this lots of times, pre-fill the link cache with a LinkBatch, otherwise each
182202 * call to this will result in a DB query.
183203 *
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
192212 */
193 - function makeLinkObj( $nt, $text= '', $query = '', $trail = '', $prefix = '' ) {
 213+ public static function makeLinkObj( $nt, $text= '', $query = '', $trail = '', $prefix = '' ) {
194214 global $wgUser;
195215 $fname = 'Linker::makeLinkObj';
196216 wfProfileIn( $fname );
197217
198218 # Fail gracefully
199 - if ( ! is_object($nt) ) {
 219+ if ( !is_object($nt) ) {
200220 # throw new MWException();
201221 wfProfileOut( $fname );
202222 return "<!-- ERROR -->{$prefix}{$text}{$trail}";
@@ -207,7 +227,7 @@
208228 $u = $nt->getFullURL();
209229 $link = $nt->getPrefixedURL();
210230 if ( '' == $text ) { $text = $nt->getPrefixedText(); }
211 - $style = $this->getInterwikiLinkAttributes( $link, $text, 'extiw' );
 231+ $style = self::getInterwikiLinkAttributes( $link, $text, 'extiw' );
212232
213233 $inside = '';
214234 if ( '' != $trail ) {
@@ -218,7 +238,6 @@
219239 }
220240
221241 # Check for anchors, normalize the anchor
222 -
223242 $parts = explode( '#', $u, 2 );
224243 if ( count( $parts ) == 2 ) {
225244 $anchor = urlencode( Sanitizer::decodeCharReferences( str_replace(' ', '_', $parts[1] ) ) );
@@ -238,13 +257,13 @@
239258 return $t;
240259 } elseif ( $nt->isAlwaysKnown() ) {
241260 # 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 );
243262 } else {
244263 wfProfileIn( $fname.'-immediate' );
245264 # Work out link colour immediately
246265 $aid = $nt->getArticleID() ;
247266 if ( 0 == $aid ) {
248 - $retVal = $this->makeBrokenLinkObj( $nt, $text, $query, $trail, $prefix );
 267+ $retVal = self::makeBrokenLinkObj( $nt, $text, $query, $trail, $prefix );
249268 } else {
250269 $threshold = $wgUser->getOption('stubthreshold') ;
251270 if ( $threshold > 0 ) {
@@ -267,9 +286,9 @@
268287 $size = 1 ;
269288 }
270289 if ( $size < $threshold ) {
271 - $retVal = $this->makeStubLinkObj( $nt, $text, $query, $trail, $prefix );
 290+ $retVal = self::makeStubLinkObj( $nt, $text, $query, $trail, $prefix );
272291 } else {
273 - $retVal = $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
 292+ $retVal = self::makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
274293 }
275294 }
276295 wfProfileOut( $fname.'-immediate' );
@@ -282,18 +301,19 @@
283302 * Make a link for a title which definitely exists. This is faster than makeLinkObj because
284303 * it doesn't have to do a database query. It's also valid for interwiki titles and special
285304 * 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
295316 */
296 - function makeKnownLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '', $style = '' ) {
297 -
 317+ public static function makeKnownLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '', $style = '' ) {
298318 $fname = 'Linker::makeKnownLinkObj';
299319 wfProfileIn( $fname );
300320
@@ -321,12 +341,12 @@
322342 $text = htmlspecialchars( $nt->getPrefixedText() );
323343 }
324344 if ( $style == '' ) {
325 - $style = $this->getInternalLinkAttributesObj( $nt, $text );
 345+ $style = self::getInternalLinkAttributesObj( $nt, $text );
326346 }
327347
328348 if ( $aprops !== '' ) $aprops = ' ' . $aprops;
329349
330 - list( $inside, $trail ) = Linker::splitTrail( $trail );
 350+ list( $inside, $trail ) = self::splitTrail( $trail );
331351 $r = "<a href=\"{$u}\"{$style}{$aprops}>{$prefix}{$text}{$inside}</a>{$trail}";
332352 wfProfileOut( $fname );
333353 return $r;
@@ -335,16 +355,18 @@
336356 /**
337357 * Make a red link to the edit page of a given title.
338358 *
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
343363 * be included in the link text. Other characters will be appended after
344364 * the end of the link.
 365+ *
 366+ * @static
345367 */
346 - function makeBrokenLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
 368+ public static function makeBrokenLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
347369 # Fail gracefully
348 - if ( ! isset($nt) ) {
 370+ if ( !isset($nt) ) {
349371 # throw new MWException();
350372 return "<!-- ERROR -->{$prefix}{$text}{$trail}";
351373 }
@@ -362,9 +384,9 @@
363385 if ( '' == $text ) {
364386 $text = htmlspecialchars( $nt->getPrefixedText() );
365387 }
366 - $style = $this->getInternalLinkAttributesObj( $nt, $text, "yes" );
 388+ $style = self::getInternalLinkAttributesObj( $nt, $text, 'yes' );
367389
368 - list( $inside, $trail ) = Linker::splitTrail( $trail );
 390+ list( $inside, $trail ) = self::splitTrail( $trail );
369391 $s = "<a href=\"{$u}\"{$style}>{$prefix}{$text}{$inside}</a>{$trail}";
370392
371393 wfProfileOut( $fname );
@@ -374,14 +396,16 @@
375397 /**
376398 * Make a brown link to a short article.
377399 *
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
382404 * be included in the link text. Other characters will be appended after
383405 * the end of the link.
 406+ *
 407+ * @static
384408 */
385 - function makeStubLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
 409+ public static function makeStubLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
386410 $link = $nt->getPrefixedURL();
387411
388412 $u = $nt->escapeLocalURL( $query );
@@ -389,9 +413,9 @@
390414 if ( '' == $text ) {
391415 $text = htmlspecialchars( $nt->getPrefixedText() );
392416 }
393 - $style = $this->getInternalLinkAttributesObj( $nt, $text, 'stub' );
 417+ $style = self::getInternalLinkAttributesObj( $nt, $text, 'stub' );
394418
395 - list( $inside, $trail ) = Linker::splitTrail( $trail );
 419+ list( $inside, $trail ) = self::splitTrail( $trail );
396420 $s = "<a href=\"{$u}\"{$style}>{$prefix}{$text}{$inside}</a>{$trail}";
397421 return $s;
398422 }
@@ -399,40 +423,47 @@
400424 /**
401425 * Generate either a normal exists-style link or a stub link, depending
402426 * on the given page size.
403 - *
 427+ *
404428 * @param $size Integer
405 - * @param $nt Title object.
 429+ * @param $nt Title object
406430 * @param $text String
407431 * @param $query String
408432 * @param $trail String
409433 * @param $prefix String
410 - * @return string HTML of link
 434+ * @return String HTML of link
 435+ *
 436+ * @static
411437 */
412 - function makeSizeLinkObj( $size, $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
 438+ public static function makeSizeLinkObj( $size, $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
413439 global $wgUser;
414440 $threshold = intval( $wgUser->getOption( 'stubthreshold' ) );
415441 if( $size < $threshold ) {
416 - return $this->makeStubLinkObj( $nt, $text, $query, $trail, $prefix );
 442+ return self::makeStubLinkObj( $nt, $text, $query, $trail, $prefix );
417443 } else {
418 - return $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
 444+ return self::makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
419445 }
420446 }
421447
422 - /**
 448+ /**
423449 * Make appropriate markup for a link to the current article. This is currently rendered
424450 * as the bold link text. The calling sequence is the same as the other make*LinkObj functions,
425451 * despite $query not being used.
 452+ *
 453+ * @static
426454 */
427 - function makeSelfLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
 455+ public static function makeSelfLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
428456 if ( '' == $text ) {
429457 $text = htmlspecialchars( $nt->getPrefixedText() );
430458 }
431 - list( $inside, $trail ) = Linker::splitTrail( $trail );
 459+ list( $inside, $trail ) = self::splitTrail( $trail );
432460 return "<strong class=\"selflink\">{$prefix}{$text}{$inside}</strong>{$trail}";
433461 }
434462
435 - /** @todo document */
436 - function fnamePart( $url ) {
 463+ /**
 464+ * @todo document
 465+ * @static
 466+ */
 467+ public static function fnamePart( $url ) {
437468 $basename = strrchr( $url, '/' );
438469 if ( false === $basename ) {
439470 $basename = $url;
@@ -442,62 +473,66 @@
443474 return htmlspecialchars( $basename );
444475 }
445476
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 );
449482 }
450483
451 - /** @todo document */
452 - function makeExternalImage( $url, $alt = '' ) {
 484+ /**
 485+ * @todo document
 486+ * @static
 487+ */
 488+ public static function makeExternalImage( $url, $alt = '' ) {
453489 if ( '' == $alt ) {
454 - $alt = $this->fnamePart( $url );
 490+ $alt = self::fnamePart( $url );
455491 }
456492 $s = '<img src="'.$url.'" alt="'.$alt.'" />';
457493 return $s;
458494 }
459495
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 ) {
464502 global $wgContLang, $wgUser, $wgThumbLimits, $wgGenerateThumbnailOnParse;
465503
466 - $img = new Image( $nt );
 504+ $img = new Image( $nt );
467505
468 - if ( ! is_null( $page ) ) {
 506+ if ( !is_null( $page ) ) {
469507 $img->selectPage( $page );
470508 }
471509
472510 if ( !$img->allowInlineDisplay() && $img->exists() ) {
473 - return $this->makeKnownLinkObj( $nt );
 511+ return self::makeKnownLinkObj( $nt );
474512 }
475513
476 - $url = $img->getViewURL();
 514+ $url = $img->getViewURL();
477515 $error = $prefix = $postfix = '';
478516
479517 wfDebug( "makeImageLinkObj: '$width'x'$height', \"$label\"\n" );
480518
481 - if ( 'center' == $align )
482 - {
 519+ if ( 'center' == $align ) {
483520 $prefix = '<div class="center">';
484521 $postfix = '</div>';
485522 $align = 'none';
486523 }
487524
488525 if ( $thumb || $framed ) {
489 -
490526 # 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-
492528 # languages ("Western languages"), left-aligned
493529 # for right-to-left-languages ("Semitic languages")
494530 #
495 - # If thumbnail width has not been provided, it is set
 531+ # If thumbnail width has not been provided, it is set
496532 # to the default user option as specified in Language*.php
497533 if ( $align == '' ) {
498534 $align = $wgContLang->isRTL() ? 'left' : 'right';
499535 }
500536
501 -
502537 if ( $width === false ) {
503538 $wopt = $wgUser->getOption( 'thumbsize' );
504539
@@ -508,14 +543,12 @@
509544 $width = min( $img->getWidth(), $wgThumbLimits[$wopt] );
510545 }
511546
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;
513548 }
514549
515550 if ( $width && $img->exists() ) {
516 -
517551 # Create a resized image, without the additional thumbnail
518552 # features
519 -
520553 if ( $height == false )
521554 $height = -1;
522555 if ( $manual_thumb == '') {
@@ -549,7 +582,7 @@
550583 if ( $error ) {
551584 $s = $error;
552585 } elseif ( $url == '' ) {
553 - $s = $this->makeBrokenImageLinkObj( $img->getTitle() );
 586+ $s = self::makeBrokenImageLinkObj( $img->getTitle() );
554587 //$s .= "<br />{$alt}<br />{$url}<br />\n";
555588 } else {
556589 $s = '<a href="'.$u.'" class="image" title="'.$alt.'">' .
@@ -568,8 +601,10 @@
569602 /**
570603 * Make HTML for a thumbnail including image, border and caption
571604 * $img is an Image object
 605+ *
 606+ * @static
572607 */
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 = "" ) {
574609 global $wgStylePath, $wgContLang, $wgGenerateThumbnailOnParse;
575610 $thumbUrl = '';
576611 $error = '';
@@ -606,19 +641,17 @@
607642 }
608643 $oboxwidth = $boxwidth + 2;
609644
610 - if ( $manual_thumb != '' ) # Use manually specified thumbnail
611 - {
 645+ if ( $manual_thumb != '' ) { # Use manually specified thumbnail
612646 $manual_title = Title::makeTitleSafe( NS_IMAGE, $manual_thumb ); #new Title ( $manual_thumb ) ;
613647 if( $manual_title ) {
614648 $manual_img = new Image( $manual_title );
615649 $thumbUrl = $manual_img->getViewURL();
616 - if ( $manual_img->exists() )
617 - {
 650+ if ( $manual_img->exists() ) {
618651 $width = $manual_img->getWidth();
619652 $height = $manual_img->getHeight();
620 - $boxwidth = $width ;
621 - $boxheight = $height ;
622 - $oboxwidth = $boxwidth + 2 ;
 653+ $boxwidth = $width;
 654+ $boxheight = $height;
 655+ $oboxwidth = $boxwidth + 2;
623656 }
624657 }
625658 }
@@ -638,7 +671,7 @@
639672 $s .= htmlspecialchars( $error );
640673 $zoomicon = '';
641674 } elseif( !$img->exists() ) {
642 - $s .= $this->makeBrokenImageLinkObj( $img->getTitle() );
 675+ $s .= self::makeBrokenImageLinkObj( $img->getTitle() );
643676 $zoomicon = '';
644677 } else {
645678 $s .= '<a href="'.$u.'" class="internal" title="'.$alt.'">'.
@@ -660,10 +693,12 @@
661694
662695 /**
663696 * Pass a title object, not a title string
 697+ *
 698+ * @static
664699 */
665 - function makeBrokenImageLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
 700+ public static function makeBrokenImageLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
666701 # Fail gracefully
667 - if ( ! isset($nt) ) {
 702+ if ( !isset($nt) ) {
668703 # throw new MWException();
669704 return "<!-- ERROR -->{$prefix}{$text}{$trail}";
670705 }
@@ -681,33 +716,34 @@
682717 if ( '' == $text ) {
683718 $text = htmlspecialchars( $nt->getPrefixedText() );
684719 }
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 );
687722 $s = "<a href=\"{$url}\"{$style}>{$prefix}{$text}{$inside}</a>{$trail}";
688723
689724 wfProfileOut( $fname );
690725 return $s;
691726 }
692727
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 = '' ) {
695733 $nt = Title::makeTitleSafe( NS_IMAGE, $name );
696 - return $this->makeMediaLinkObj( $nt, $alt );
 734+ return self::makeMediaLinkObj( $nt, $alt );
697735 }
698736
699737 /**
700738 * 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
709745 * @todo Handle invalid or missing images better.
710746 */
711 - function makeMediaLinkObj( $title, $text = '' ) {
 747+ public static function makeMediaLinkObj( $title, $text = '' ) {
712748 if( is_null( $title ) ) {
713749 ### HOTFIX. Instead of breaking, return empty string.
714750 return $text;
@@ -731,19 +767,24 @@
732768 }
733769 }
734770
735 - /** @todo document */
736 - function specialLink( $name, $key = '' ) {
 771+ /**
 772+ * @todo document
 773+ * @static
 774+ */
 775+ public static function specialLink( $name, $key = '' ) {
737776 global $wgContLang;
738777
739778 if ( '' == $key ) { $key = strtolower( $name ); }
740779 $pn = $wgContLang->ucfirst( $name );
741 - return $this->makeKnownLink( $wgContLang->specialPage( $pn ),
742 - wfMsg( $key ) );
 780+ return self::makeKnownLink( $wgContLang->specialPage( $pn ), wfMsg( $key ) );
743781 }
744782
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 );
748789 global $wgNoFollowLinks, $wgNoFollowNsExceptions;
749790 if( $wgNoFollowLinks && !(isset($ns) && in_array($ns, $wgNoFollowNsExceptions)) ) {
750791 $style .= ' rel="nofollow"';
@@ -757,45 +798,47 @@
758799
759800 /**
760801 * 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
765807 */
766 - function userLink( $userId, $userText ) {
 808+ public static function userLink( $userId, $userText ) {
767809 $encName = htmlspecialchars( $userText );
768810 if( $userId == 0 ) {
769811 $contribsPage = SpecialPage::getTitleFor( 'Contributions' );
770 - return $this->makeKnownLinkObj( $contribsPage,
 812+ return self::makeKnownLinkObj( $contribsPage,
771813 $encName, 'target=' . urlencode( $userText ) );
772814 } else {
773815 $userPage = Title::makeTitle( NS_USER, $userText );
774 - return $this->makeLinkObj( $userPage, $encName );
 816+ return self::makeLinkObj( $userPage, $encName );
775817 }
776818 }
777819
778820 /**
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
783826 */
784 - function userToolLinks( $userId, $userText ) {
 827+ public static function userToolLinks( $userId, $userText ) {
785828 global $wgUser, $wgDisableAnonTalk, $wgSysopUserBans;
786829 $talkable = !( $wgDisableAnonTalk && 0 == $userId );
787830 $blockable = ( $wgSysopUserBans || 0 == $userId );
788831
789832 $items = array();
790833 if( $talkable ) {
791 - $items[] = $this->userTalkLink( $userId, $userText );
 834+ $items[] = self::userTalkLink( $userId, $userText );
792835 }
793836 if( $userId ) {
794837 $contribsPage = SpecialPage::getTitleFor( 'Contributions' );
795 - $items[] = $this->makeKnownLinkObj( $contribsPage,
 838+ $items[] = self::makeKnownLinkObj( $contribsPage,
796839 wfMsgHtml( 'contribslink' ), 'target=' . urlencode( $userText ) );
797840 }
798841 if( $blockable && $wgUser->isAllowed( 'block' ) ) {
799 - $items[] = $this->blockLink( $userId, $userText );
 842+ $items[] = self::blockLink( $userId, $userText );
800843 }
801844
802845 if( $items ) {
@@ -806,41 +849,45 @@
807850 }
808851
809852 /**
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
814858 */
815 - function userTalkLink( $userId, $userText ) {
 859+ public static function userTalkLink( $userId, $userText ) {
816860 global $wgLang;
817861 $talkname = $wgLang->getNsText( NS_TALK ); # use the shorter name
818862
819863 $userTalkPage = Title::makeTitle( NS_USER_TALK, $userText );
820 - $userTalkLink = $this->makeLinkObj( $userTalkPage, $talkname );
 864+ $userTalkLink = self::makeLinkObj( $userTalkPage, $talkname );
821865 return $userTalkLink;
822866 }
823867
824868 /**
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
827871 * @return string HTML fragment with block link
828 - * @private
 872+ *
 873+ * @static
829874 */
830 - function blockLink( $userId, $userText ) {
 875+ public static function blockLink( $userId, $userText ) {
831876 $blockPage = SpecialPage::getTitleFor( 'Blockip' );
832 - $blockLink = $this->makeKnownLinkObj( $blockPage,
 877+ $blockLink = self::makeKnownLinkObj( $blockPage,
833878 wfMsgHtml( 'blocklink' ), 'ip=' . urlencode( $userText ) );
834879 return $blockLink;
835880 }
836 -
 881+
837882 /**
838883 * Generate a user link if the current user is allowed to view it
839 - * @param $rev Revision object.
 884+ * @param $rev Revision object
840885 * @return string HTML
 886+ *
 887+ * @static
841888 */
842 - function revUserLink( $rev ) {
 889+ public static function revUserLink( $rev ) {
843890 if( $rev->userCan( Revision::DELETED_USER ) ) {
844 - $link = $this->userLink( $rev->getRawUser(), $rev->getRawUserText() );
 891+ $link = self::userLink( $rev->getRawUser(), $rev->getRawUserText() );
845892 } else {
846893 $link = wfMsgHtml( 'rev-deleted-user' );
847894 }
@@ -852,14 +899,16 @@
853900
854901 /**
855902 * 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
857904 * @return string HTML
 905+ *
 906+ * @static
858907 */
859 - function revUserTools( $rev ) {
 908+ public static function revUserTools( $rev ) {
860909 if( $rev->userCan( Revision::DELETED_USER ) ) {
861 - $link = $this->userLink( $rev->getRawUser(), $rev->getRawUserText() ) .
 910+ $link = self::userLink( $rev->getRawUser(), $rev->getRawUserText() ) .
862911 ' ' .
863 - $this->userToolLinks( $rev->getRawUser(), $rev->getRawUserText() );
 912+ self::userToolLinks( $rev->getRawUser(), $rev->getRawUserText() );
864913 } else {
865914 $link = wfMsgHtml( 'rev-deleted-user' );
866915 }
@@ -868,22 +917,24 @@
869918 }
870919 return $link;
871920 }
872 -
 921+
873922 /**
874923 * This function is called by all recent changes variants, by the page history,
875924 * and by the user contributions list. It is responsible for formatting edit
876925 * comments. It escapes any HTML in the comment, but adds some CSS to format
877926 * auto-generated comments (from section editing) and formats [[wikilinks]].
878 - *
 927+ *
879928 * The $title parameter must be a title OBJECT. It is used to generate a
880929 * direct link to the section in the autocomment.
881930 * @author Erik Moeller <moeller@scireview.de>
882 - *
 931+ *
883932 * Note: there's not always a title to pass to this function.
884933 * Since you can't set a default parameter for a reference, I've turned it
885934 * temporarily to a value pass. Should be adjusted further. --brion
 935+ *
 936+ * @static
886937 */
887 - function formatComment($comment, $title = NULL) {
 938+ public static function formatComment( $comment, $title = NULL ) {
888939 $fname = 'Linker::formatComment';
889940 wfProfileIn( $fname );
890941
@@ -913,7 +964,7 @@
914965 $section = str_replace( ']]', '', $section );
915966 $sectionTitle = wfClone( $title );
916967 $sectionTitle->mFragment = $section;
917 - $link = $this->makeKnownLinkObj( $sectionTitle, wfMsg( 'sectionlink' ) );
 968+ $link = self::makeKnownLinkObj( $sectionTitle, wfMsg( 'sectionlink' ) );
918969 }
919970 $sep='-';
920971 $auto=$link.$auto;
@@ -936,7 +987,7 @@
937988 if( preg_match( '/^' . $medians . '(.*)$/i', $match[1], $submatch ) ) {
938989 # Media link; trail not supported.
939990 $linkRegexp = '/\[\[(.*?)\]\]/';
940 - $thelink = $this->makeMediaLink( $submatch[1], "", $text );
 991+ $thelink = self::makeMediaLink( $submatch[1], "", $text );
941992 } else {
942993 # Other kind of link
943994 if( preg_match( $wgContLang->linkTrail(), $match[4], $submatch ) ) {
@@ -947,7 +998,7 @@
948999 $linkRegexp = '/\[\[(.*?)\]\]' . preg_quote( $trail, '/' ) . '/';
9491000 if ($match[1][0] == ':')
9501001 $match[1] = substr($match[1], 1);
951 - $thelink = $this->makeLink( $match[1], $text, "", $trail );
 1002+ $thelink = self::makeLink( $match[1], $text, "", $trail );
9521003 }
9531004 $comment = preg_replace( $linkRegexp, wfRegexReplacement( $thelink ), $comment, 1 );
9541005 }
@@ -958,33 +1009,36 @@
9591010 /**
9601011 * Wrap a comment in standard punctuation and formatting if
9611012 * 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
9671019 */
968 - function commentBlock( $comment, $title = NULL ) {
 1020+ public static function commentBlock( $comment, $title = NULL ) {
9691021 // '*' used to be the comment inserted by the software way back
9701022 // in antiquity in case none was provided, here for backwards
9711023 // compatability, acc. to brion -ævar
9721024 if( $comment == '' || $comment == '*' ) {
9731025 return '';
9741026 } else {
975 - $formatted = $this->formatComment( $comment, $title );
 1027+ $formatted = self::formatComment( $comment, $title );
9761028 return " <span class=\"comment\">($formatted)</span>";
9771029 }
9781030 }
979 -
 1031+
9801032 /**
9811033 * Wrap and format the given revision's comment block, if the current
9821034 * 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
9851039 */
986 - function revComment( $rev ) {
 1040+ public static function revComment( $rev ) {
9871041 if( $rev->userCan( Revision::DELETED_COMMENT ) ) {
988 - $block = $this->commentBlock( $rev->getRawComment(), $rev->getTitle() );
 1042+ $block = self::commentBlock( $rev->getRawComment(), $rev->getTitle() );
9891043 } else {
9901044 $block = " <span class=\"comment\">" .
9911045 wfMsgHtml( 'rev-deleted-comment' ) . "</span>";
@@ -995,35 +1049,49 @@
9961050 return $block;
9971051 }
9981052
999 - /** @todo document */
1000 - function tocIndent() {
 1053+ /**
 1054+ * @todo document
 1055+ * @static
 1056+ */
 1057+ public static function tocIndent() {
10011058 return "\n<ul>";
10021059 }
10031060
1004 - /** @todo document */
1005 - function tocUnindent($level) {
 1061+ /**
 1062+ * @todo document
 1063+ * @static
 1064+ */
 1065+ public static function tocUnindent($level) {
10061066 return "</li>\n" . str_repeat( "</ul>\n</li>\n", $level>0 ? $level : 0 );
10071067 }
10081068
10091069 /**
10101070 * parameter level defines if we are on an indentation level
 1071+ *
 1072+ * @static
10111073 */
1012 - function tocLine( $anchor, $tocline, $tocnumber, $level ) {
 1074+ public static function tocLine( $anchor, $tocline, $tocnumber, $level ) {
10131075 return "\n<li class=\"toclevel-$level\"><a href=\"#" .
10141076 $anchor . '"><span class="tocnumber">' .
10151077 $tocnumber . '</span> <span class="toctext">' .
10161078 $tocline . '</span></a>';
10171079 }
10181080
1019 - /** @todo document */
1020 - function tocLineEnd() {
 1081+ /**
 1082+ * @todo document
 1083+ * @static
 1084+ */
 1085+ static function tocLineEnd() {
10211086 return "</li>\n";
10221087 }
10231088
1024 - /** @todo document */
1025 - function tocList($toc) {
 1089+ /**
 1090+ * @todo document
 1091+ * @static
 1092+ */
 1093+ static function tocList($toc) {
10261094 global $wgJsMimeType;
1027 - $title = wfMsgForContent('toc') ;
 1095+ $title = wfMsgForContent('toc') ;
10281096 return
10291097 '<table id="toc" class="toc" summary="' . $title .'"><tr><td>'
10301098 . '<div id="toctitle"><h2>' . $title . "</h2></div>\n"
@@ -1040,29 +1108,33 @@
10411109 . "</script>\n";
10421110 }
10431111
1044 - /** @todo document */
1045 - function editSectionLinkForOther( $title, $section ) {
 1112+ /**
 1113+ * @todo document
 1114+ * @static
 1115+ */
 1116+ public static function editSectionLinkForOther( $title, $section ) {
10461117 global $wgContLang;
10471118
10481119 $title = Title::newFromText( $title );
10491120 $editurl = '&section='.$section;
1050 - $url = $this->makeKnownLinkObj( $title, wfMsg('editsection'), 'action=edit'.$editurl );
 1121+ $url = self::makeKnownLinkObj( $title, wfMsg('editsection'), 'action=edit'.$editurl );
10511122
10521123 return "<span class=\"editsection\">[".$url."]</span>";
1053 -
10541124 }
10551125
10561126 /**
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
10601132 */
1061 - function editSectionLink( $nt, $section, $hint='' ) {
 1133+ public static function editSectionLink( $nt, $section, $hint='' ) {
10621134 global $wgContLang;
10631135
10641136 $editurl = '&section='.$section;
10651137 $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 );
10671139
10681140 return "<span class=\"editsection\">[".$url."]</span>";
10691141 }
@@ -1070,10 +1142,10 @@
10711143 /**
10721144 * Split a link trail, return the "inside" portion and the remainder of the trail
10731145 * as a two-element array
1074 - *
 1146+ *
10751147 * @static
10761148 */
1077 - static function splitTrail( $trail ) {
 1149+ public static function splitTrail( $trail ) {
10781150 static $regex = false;
10791151 if ( $regex === false ) {
10801152 global $wgContLang;
@@ -1088,6 +1160,5 @@
10891161 }
10901162 return array( $inside, $trail );
10911163 }
1092 -
10931164 }
10941165 ?>
Index: trunk/phase3/includes/Parser.php
@@ -1037,10 +1037,8 @@
10381038 substr($m[0], 0, 20 ) . '"' );
10391039 }
10401040
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" );
10451043 }
10461044 return $text;
10471045 }
@@ -1258,8 +1256,6 @@
12591257 $fname = 'Parser::replaceExternalLinks';
12601258 wfProfileIn( $fname );
12611259
1262 - $sk =& $this->mOptions->getSkin();
1263 -
12641260 $bits = preg_split( EXT_LINK_BRACKETED, $text, -1, PREG_SPLIT_DELIM_CAPTURE );
12651261
12661262 $s = $this->replaceFreeExternalLinks( array_shift( $bits ) );
@@ -1321,7 +1317,7 @@
13221318 # This means that users can paste URLs directly into the text
13231319 # Funny characters like &ouml; aren't valid in URLs anyway
13241320 # 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;
13261322
13271323 # Register link in the output object.
13281324 # Replace unnecessary URL escape codes with the referenced character
@@ -1347,8 +1343,6 @@
13481344 $s = array_shift( $bits );
13491345 $i = 0;
13501346
1351 - $sk =& $this->mOptions->getSkin();
1352 -
13531347 while ( $i < count( $bits ) ){
13541348 $protocol = $bits[$i++];
13551349 $remainder = $bits[$i++];
@@ -1400,7 +1394,7 @@
14011395 $text = $this->maybeMakeExternalImage( $url );
14021396 if ( $text === false ) {
14031397 # 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() );
14051399 # Register it in the output object...
14061400 # Replace unnecessary URL escape codes with their equivalent characters
14071401 $pasteurized = Parser::replaceUnusualEscapes( $url );
@@ -1455,7 +1449,6 @@
14561450 * @private
14571451 */
14581452 function maybeMakeExternalImage( $url ) {
1459 - $sk =& $this->mOptions->getSkin();
14601453 $imagesfrom = $this->mOptions->getAllowExternalImagesFrom();
14611454 $imagesexception = !empty($imagesfrom);
14621455 $text = false;
@@ -1463,7 +1456,7 @@
14641457 || ( $imagesexception && strpos( $url, $imagesfrom ) === 0 ) ) {
14651458 if ( preg_match( EXT_IMAGE_REGEX, $url ) ) {
14661459 # Image found
1467 - $text = $sk->makeExternalImage( htmlspecialchars( $url ) );
 1460+ $text = Linker::makeExternalImage( htmlspecialchars( $url ) );
14681461 }
14691462 }
14701463 return $text;
@@ -1485,8 +1478,6 @@
14861479 # the % is needed to support urlencoded titles as well
14871480 if ( !$tc ) { $tc = Title::legalChars() . '#%'; }
14881481
1489 - $sk =& $this->mOptions->getSkin();
1490 -
14911482 #split the entire text string on occurences of [[
14921483 $a = explode( '[[', ' ' . $s );
14931484 #get the first element (all text up to first [[), and remove the space we added
@@ -1734,13 +1725,13 @@
17351726 if( ( $nt->getPrefixedText() === $selflink ) &&
17361727 ( $nt->getFragment() === '' ) ) {
17371728 # 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 );
17391730 continue;
17401731 }
17411732
17421733 # Special and Media are pseudo-namespaces; no pages actually exist in them
17431734 if( $ns == NS_MEDIA ) {
1744 - $link = $sk->makeMediaLinkObj( $nt, $text );
 1735+ $link = Linker::makeMediaLinkObj( $nt, $text );
17451736 # Cloak with NOPARSE to avoid replacement in replaceExternalLinks
17461737 $s .= $prefix . $this->armorLinks( $link ) . $trail;
17471738 $this->mOutput->addImage( $nt->getDBkey() );
@@ -1815,8 +1806,7 @@
18161807 */
18171808 function makeKnownLinkHolder( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
18181809 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 );
18211811 return $this->armorLinks( $link ) . $trail;
18221812 }
18231813
@@ -3381,9 +3371,6 @@
33823372 $enoughToc = false;
33833373 }
33843374
3385 - # We need this to perform operations on the HTML
3386 - $sk =& $this->mOptions->getSkin();
3387 -
33883375 # headline counter
33893376 $headlineCount = 0;
33903377 $sectionCount = 0; # headlineCount excluding template sections
@@ -3427,7 +3414,7 @@
34283415 $toclevel++;
34293416 $sublevelCount[$toclevel] = 0;
34303417 if( $toclevel<$wgMaxTocLevel ) {
3431 - $toc .= $sk->tocIndent();
 3418+ $toc .= Linker::tocIndent();
34323419 }
34333420 }
34343421 elseif ( $level < $prevlevel && $toclevel > 1 ) {
@@ -3451,13 +3438,13 @@
34523439 }
34533440 }
34543441 if( $toclevel<$wgMaxTocLevel ) {
3455 - $toc .= $sk->tocUnindent( $prevtoclevel - $toclevel );
 3442+ $toc .= Linker::tocUnindent( $prevtoclevel - $toclevel );
34563443 }
34573444 }
34583445 else {
34593446 # No change in level, end TOC line
34603447 if( $toclevel<$wgMaxTocLevel ) {
3461 - $toc .= $sk->tocLineEnd();
 3448+ $toc .= Linker::tocLineEnd();
34623449 }
34633450 }
34643451
@@ -3517,7 +3504,7 @@
35183505 $anchor .= '_' . $refcount[$headlineCount];
35193506 }
35203507 if( $enoughToc && ( !isset($wgMaxTocLevel) || $toclevel<$wgMaxTocLevel ) ) {
3521 - $toc .= $sk->tocLine($anchor, $tocline, $numbering, $toclevel);
 3508+ $toc .= Linker::tocLine($anchor, $tocline, $numbering, $toclevel);
35223509 }
35233510 # give headline the correct <h#> tag
35243511 @$head[$headlineCount] .= "<a name=\"$anchor\"></a><h".$level.$matches[2][$headlineCount];
@@ -3527,9 +3514,9 @@
35283515 $head[$headlineCount] = '';
35293516 }
35303517 if( $istemplate )
3531 - $head[$headlineCount] .= $sk->editSectionLinkForOther($templatetitle, $templatesection);
 3518+ $head[$headlineCount] .= Linker::editSectionLinkForOther($templatetitle, $templatesection);
35323519 else
3533 - $head[$headlineCount] .= $sk->editSectionLink($this->mTitle, $sectionCount+1, $headline_hint);
 3520+ $head[$headlineCount] .= Linker::editSectionLink($this->mTitle, $sectionCount+1, $headline_hint);
35343521 }
35353522 // Yes, the headline logically goes before the edit section. Why isn't it there
35363523 // in source? Ask the CSS people. The float gets screwed up if you do that.
@@ -3544,9 +3531,9 @@
35453532
35463533 if( $enoughToc ) {
35473534 if( $toclevel<$wgMaxTocLevel ) {
3548 - $toc .= $sk->tocUnindent( $toclevel - 1 );
 3535+ $toc .= Linker::tocUnindent( $toclevel - 1 );
35493536 }
3550 - $toc = $sk->tocList( $toc );
 3537+ $toc = Linker::tocList( $toc );
35513538 }
35523539
35533540 # split up and insert constructed headlines
@@ -3561,7 +3548,7 @@
35623549
35633550 # Disabled because it broke block formatting
35643551 # For example, a bullet point in the top line
3565 - # $full .= $sk->editSectionLink(0);
 3552+ # $full .= Linker::editSectionLink(0);
35663553 }
35673554 $full .= $block;
35683555 if( $enoughToc && !$i && $isMain && !$this->mForceTocPosition ) {
@@ -3904,7 +3891,7 @@
39053892
39063893 /**
39073894 * Replace <!--LINK--> link placeholders with actual links, in the buffer
3908 - * Placeholders created in Skin::makeLinkObj()
 3895+ * Placeholders created in Linker::makeLinkObj()
39093896 * Returns an array of links found, indexed by PDBK:
39103897 * 0 - broken
39113898 * 1 - normal link
@@ -3921,7 +3908,6 @@
39223909
39233910 $pdbks = array();
39243911 $colours = array();
3925 - $sk =& $this->mOptions->getSkin();
39263912 $linkCache =& LinkCache::singleton();
39273913
39283914 if ( !empty( $this->mLinkHolders['namespaces'] ) ) {
@@ -4102,15 +4088,15 @@
41034089 $linkCache->addBadLinkObj( $title );
41044090 $colours[$pdbk] = 0;
41054091 $this->mOutput->addLink( $title, 0 );
4106 - $wgOutputReplace[$searchkey] = $sk->makeBrokenLinkObj( $title,
 4092+ $wgOutputReplace[$searchkey] = Linker::makeBrokenLinkObj( $title,
41074093 $this->mLinkHolders['texts'][$key],
41084094 $this->mLinkHolders['queries'][$key] );
41094095 } elseif ( $colours[$pdbk] == 1 ) {
4110 - $wgOutputReplace[$searchkey] = $sk->makeKnownLinkObj( $title,
 4096+ $wgOutputReplace[$searchkey] = Linker::makeKnownLinkObj( $title,
41114097 $this->mLinkHolders['texts'][$key],
41124098 $this->mLinkHolders['queries'][$key] );
41134099 } elseif ( $colours[$pdbk] == 2 ) {
4114 - $wgOutputReplace[$searchkey] = $sk->makeStubLinkObj( $title,
 4100+ $wgOutputReplace[$searchkey] = Linker::makeStubLinkObj( $title,
41154101 $this->mLinkHolders['texts'][$key],
41164102 $this->mLinkHolders['queries'][$key] );
41174103 }
@@ -4136,7 +4122,7 @@
41374123 $wgOutputReplace = array();
41384124 foreach( $this->mInterwikiLinkHolders['texts'] as $key => $link ) {
41394125 $title = $this->mInterwikiLinkHolders['titles'][$key];
4140 - $wgOutputReplace[$key] = $sk->makeLinkObj( $title, $link );
 4126+ $wgOutputReplace[$key] = Linker::makeLinkObj( $title, $link );
41414127 }
41424128
41434129 $text = preg_replace_callback(
@@ -4216,7 +4202,6 @@
42174203 $ig->setShowBytes( false );
42184204 $ig->setShowFilename( false );
42194205 $ig->setParsing();
4220 - $ig->useSkin( $this->mOptions->getSkin() );
42214206
42224207 if( isset( $params['caption'] ) )
42234208 $ig->setCaption( $params['caption'] );
@@ -4345,8 +4330,7 @@
43464331 $alt = Sanitizer::stripAllTags( $alt );
43474332
43484333 # 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 );
43514335 }
43524336
43534337 /**
@@ -4682,7 +4666,6 @@
46834667 var $mInterwikiMagic; # Interlanguage links are removed and returned in an array
46844668 var $mAllowExternalImages; # Allow external images inline
46854669 var $mAllowExternalImagesFrom; # If not, any exception?
4686 - var $mSkin; # Reference to the preferred skin
46874670 var $mDateFormat; # Date format index
46884671 var $mEditSection; # Create "edit section" links
46894672 var $mNumberHeadings; # Automatically number headings
@@ -4692,7 +4675,7 @@
46934676 var $mMaxIncludeSize; # Maximum size of template expansions, in bytes
46944677 var $mRemoveComments; # Remove HTML comments. ONLY APPLIES TO PREPROCESS OPERATIONS
46954678
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
46974680
46984681 function getUseTeX() { return $this->mUseTeX; }
46994682 function getUseDynamicDates() { return $this->mUseDynamicDates; }
@@ -4707,13 +4690,6 @@
47084691 function getMaxIncludeSize() { return $this->mMaxIncludeSize; }
47094692 function getRemoveComments() { return $this->mRemoveComments; }
47104693
4711 - function &getSkin() {
4712 - if ( !isset( $this->mSkin ) ) {
4713 - $this->mSkin = $this->mUser->getSkin();
4714 - }
4715 - return $this->mSkin;
4716 - }
4717 -
47184694 function getDateFormat() {
47194695 if ( !isset( $this->mDateFormat ) ) {
47204696 $this->mDateFormat = $this->mUser->getDatePreference();
@@ -4731,7 +4707,6 @@
47324708 function setNumberHeadings( $x ) { return wfSetVar( $this->mNumberHeadings, $x ); }
47334709 function setAllowSpecialInclusion( $x ) { return wfSetVar( $this->mAllowSpecialInclusion, $x ); }
47344710 function setTidy( $x ) { return wfSetVar( $this->mTidy, $x); }
4735 - function setSkin( $x ) { $this->mSkin = $x; }
47364711 function setInterfaceMessage( $x ) { return wfSetVar( $this->mInterfaceMessage, $x); }
47374712 function setMaxIncludeSize( $x ) { return wfSetVar( $this->mMaxIncludeSize, $x ); }
47384713 function setRemoveComments( $x ) { return wfSetVar( $this->mRemoveComments, $x ); }
@@ -4772,7 +4747,6 @@
47734748 $this->mInterwikiMagic = $wgInterwikiMagic;
47744749 $this->mAllowExternalImages = $wgAllowExternalImages;
47754750 $this->mAllowExternalImagesFrom = $wgAllowExternalImagesFrom;
4776 - $this->mSkin = null; # Deferred
47774751 $this->mDateFormat = null; # Deferred
47784752 $this->mEditSection = true;
47794753 $this->mNumberHeadings = $user->getOption( 'numberheadings' );
Index: trunk/phase3/includes/Credits.php
@@ -171,9 +171,8 @@
172172 *
173173 */
174174 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,
178177 htmlspecialchars( (empty($link_text)) ? $user_name : $link_text ));
179178 }
180179
@@ -181,9 +180,7 @@
182181 *
183182 */
184183 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');
188185 }
189186
190187 ?>
Index: trunk/phase3/includes/PageHistory.php
@@ -21,7 +21,7 @@
2222 const DIR_PREV = 0;
2323 const DIR_NEXT = 1;
2424
25 - var $mArticle, $mTitle, $mSkin;
 25+ var $mArticle, $mTitle;
2626 var $lastdate;
2727 var $linesonpage;
2828 var $mNotificationTimestamp;
@@ -34,12 +34,9 @@
3535 * @returns nothing
3636 */
3737 function PageHistory($article) {
38 - global $wgUser;
39 -
4038 $this->mArticle =& $article;
4139 $this->mTitle =& $article->mTitle;
4240 $this->mNotificationTimestamp = NULL;
43 - $this->mSkin = $wgUser->getSkin();
4441 }
4542
4643 /**
@@ -71,7 +68,7 @@
7269 $wgOut->setSyndicated( true );
7370
7471 $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() );
7673
7774 $subtitle = wfMsgHtml( 'revhistory' ) . '<br />' . $logLink;
7875 $wgOut->setSubtitle( $subtitle );
@@ -178,8 +175,8 @@
179176 $arbitrary = $this->diffButtons( $rev, $firstInList, $counter );
180177 $link = $this->revLink( $rev );
181178
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() );
184181
185182 $s .= "($curlink) ($lastlink) $arbitrary";
186183
@@ -189,7 +186,7 @@
190187 // We don't currently handle well changing the top revision's settings
191188 $del = wfMsgHtml( 'rev-delundel' );
192189 } else {
193 - $del = $this->mSkin->makeKnownLinkObj( $revdel,
 190+ $del = Linker::makeKnownLinkObj( $revdel,
194191 wfMsg( 'rev-delundel' ),
195192 'target=' . urlencode( $this->mTitle->getPrefixedDbkey() ) .
196193 '&oldid=' . urlencode( $rev->getId() ) );
@@ -203,7 +200,7 @@
204201 $s .= ' ' . wfElement( 'span', array( 'class' => 'minor' ), wfMsg( 'minoreditletter') );
205202 }
206203
207 - $s .= $this->mSkin->revComment( $rev );
 204+ $s .= Linker::revComment( $rev );
208205 if ($notificationtimestamp && ($row->rev_timestamp >= $notificationtimestamp)) {
209206 $s .= ' <span class="updatedmarker">' . wfMsgHtml( 'updatedmarker' ) . '</span>';
210207 }
@@ -220,7 +217,7 @@
221218 global $wgLang;
222219 $date = $wgLang->timeanddate( wfTimestamp(TS_MW, $rev->getTimestamp()), true );
223220 if( $rev->userCan( Revision::DELETED_TEXT ) ) {
224 - $link = $this->mSkin->makeKnownLinkObj(
 221+ $link = Linker::makeKnownLinkObj(
225222 $this->mTitle, $date, "oldid=" . $rev->getId() );
226223 } else {
227224 $link = $date;
@@ -237,7 +234,7 @@
238235 if( $latest || !$rev->userCan( Revision::DELETED_TEXT ) ) {
239236 return $cur;
240237 } else {
241 - return $this->mSkin->makeKnownLinkObj(
 238+ return Linker::makeKnownLinkObj(
242239 $this->mTitle, $cur,
243240 'diff=' . $this->getLatestID() .
244241 "&oldid=" . $rev->getId() );
@@ -252,14 +249,14 @@
253250 return $last;
254251 } elseif ( $next === 'unknown' ) {
255252 # Next row probably exists but is unknown, use an oldid=prev link
256 - return $this->mSkin->makeKnownLinkObj(
 253+ return Linker::makeKnownLinkObj(
257254 $this->mTitle,
258255 $last,
259256 "diff=" . $rev->getId() . "&oldid=prev" );
260257 } elseif( !$rev->userCan( Revision::DELETED_TEXT ) ) {
261258 return $last;
262259 } else {
263 - return $this->mSkin->makeKnownLinkObj(
 260+ return Linker::makeKnownLinkObj(
264261 $this->mTitle,
265262 $last,
266263 "diff=" . $rev->getId() . "&oldid={$next->rev_id}"
Index: trunk/phase3/includes/QueryPage.php
@@ -156,12 +156,11 @@
157157 }
158158
159159 /**
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.
163162 * If the function return "false", the line output will be skipped.
164163 */
165 - function formatResult( $skin, $result ) {
 164+ function formatResult( $result ) {
166165 return '';
167166 }
168167
@@ -275,7 +274,7 @@
276275 * @param $shownavigation show navigation like "next 200"?
277276 */
278277 function doQuery( $offset, $limit, $shownavigation=true ) {
279 - global $wgUser, $wgOut, $wgLang, $wgContLang;
 278+ global $wgOut, $wgLang, $wgContLang;
280279
281280 $this->offset = $offset;
282281 $this->limit = $limit;
@@ -321,8 +320,6 @@
322321
323322 $this->preprocessResults( $dbr, $res );
324323
325 - $sk = $wgUser->getSkin( );
326 -
327324 if($shownavigation) {
328325 $wgOut->addHTML( $this->getPageHeader() );
329326 $top = wfShowingResults( $offset, $num);
@@ -343,7 +340,7 @@
344341
345342 # Only read at most $num rows, because $res may contain the whole 1000
346343 for ( $i = 0; $i < $num && $obj = $dbr->fetchObject( $res ); $i++ ) {
347 - $format = $this->formatResult( $sk, $obj );
 344+ $format = $this->formatResult( $obj );
348345 if ( $format ) {
349346 $attr = ( isset ( $obj->usepatrol ) && $obj->usepatrol &&
350347 $obj->patrolled == 0 ) ? ' class="not-patrolled"' : '';
@@ -354,7 +351,7 @@
355352 if($this->tryLastResult()) {
356353 // flush the very last result
357354 $obj = null;
358 - $format = $this->formatResult( $sk, $obj );
 355+ $format = $this->formatResult( $obj );
359356 if( $format ) {
360357 $attr = ( isset ( $obj->usepatrol ) && $obj->usepatrol &&
361358 $obj->patrolled == 0 ) ? ' class="not-patrolled"' : '';
@@ -473,10 +470,10 @@
474471 */
475472 class PageQueryPage extends QueryPage {
476473
477 - function formatResult( $skin, $result ) {
 474+ function formatResult( $result ) {
478475 global $wgContLang;
479476 $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() ) ) );
481478 }
482479 }
483480
Index: trunk/phase3/includes/SpecialContributions.php
@@ -291,9 +291,8 @@
292292
293293 $wgOut->addHTML( "<ul>\n" );
294294
295 - $sk = $wgUser->getSkin();
296295 foreach ( $contribs as $contrib )
297 - $wgOut->addHTML( ucListEdit( $sk, $contrib ) );
 296+ $wgOut->addHTML( ucListEdit( $contrib ) );
298297
299298 $wgOut->addHTML( "</ul>\n" );
300299 $wgOut->addHTML( "<p>{$prevnextbits}</p>\n" );
@@ -306,27 +305,26 @@
307306 function contributionsSub( $nt ) {
308307 global $wgSysopUserBans, $wgLang, $wgUser;
309308
310 - $sk = $wgUser->getSkin();
311309 $id = User::idFromName( $nt->getText() );
312310
313311 if ( 0 == $id ) {
314312 $ul = $nt->getText();
315313 } else {
316 - $ul = $sk->makeLinkObj( $nt, htmlspecialchars( $nt->getText() ) );
 314+ $ul = Linker::makeLinkObj( $nt, htmlspecialchars( $nt->getText() ) );
317315 }
318316 $talk = $nt->getTalkPage();
319317 if( $talk ) {
320318 # Talk page link
321 - $tools[] = $sk->makeLinkObj( $talk, $wgLang->getNsText( NS_TALK ) );
 319+ $tools[] = Linker::makeLinkObj( $talk, $wgLang->getNsText( NS_TALK ) );
322320 if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && User::isIP( $nt->getText() ) ) ) {
323321 # Block link
324322 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' ) );
326324 # 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() );
328326 }
329327 # 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() );
331329 $ul .= ' (' . implode( ' | ', $tools ) . ')';
332330 }
333331 return $ul;
@@ -377,7 +375,7 @@
378376 *
379377 * @todo This would probably look a lot nicer in a table.
380378 */
381 -function ucListEdit( $sk, $row ) {
 379+function ucListEdit( $row ) {
382380 $fname = 'ucListEdit';
383381 wfProfileIn( $fname );
384382
@@ -392,12 +390,12 @@
393391 $rev = new Revision( $row );
394392
395393 $page = Title::makeTitle( $row->page_namespace, $row->page_title );
396 - $link = $sk->makeKnownLinkObj( $page );
 394+ $link = Linker::makeKnownLinkObj( $page );
397395 $difftext = $topmarktext = '';
398396 if( $row->rev_id == $row->page_latest ) {
399397 $topmarktext .= '<strong>' . $messages['uctop'] . '</strong>';
400398 if( !$row->page_is_new ) {
401 - $difftext .= '(' . $sk->makeKnownLinkObj( $page, $messages['diff'], 'diff=0' ) . ')';
 399+ $difftext .= '(' . Linker::makeKnownLinkObj( $page, $messages['diff'], 'diff=0' ) . ')';
402400 } else {
403401 $difftext .= $messages['newarticle'];
404402 }
@@ -406,20 +404,20 @@
407405 $extraRollback = $wgRequest->getBool( 'bot' ) ? '&bot=1' : '';
408406 $extraRollback .= '&token=' . urlencode(
409407 $wgUser->editToken( array( $page->getPrefixedText(), $row->rev_user_text ) ) );
410 - $topmarktext .= ' ['. $sk->makeKnownLinkObj( $page,
 408+ $topmarktext .= ' ['. Linker::makeKnownLinkObj( $page,
411409 $messages['rollbacklink'],
412410 'action=rollback&from=' . urlencode( $row->rev_user_text ) . $extraRollback ) .']';
413411 }
414412
415413 }
416414 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 ) . ')';
418416 } else {
419417 $difftext = '(' . $messages['diff'] . ')';
420418 }
421 - $histlink='('.$sk->makeKnownLinkObj( $page, $messages['hist'], 'action=history' ) . ')';
 419+ $histlink = '(' . Linker::makeKnownLinkObj( $page, $messages['hist'], 'action=history' ) . ')';
422420
423 - $comment = $sk->revComment( $rev );
 421+ $comment = Linker::revComment( $rev );
424422 $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true );
425423
426424 if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
Index: trunk/phase3/includes/LogPage.php
@@ -130,7 +130,7 @@
131131 /**
132132 * @static
133133 */
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 ) {
135135 global $wgLang, $wgContLang, $wgLogActions;
136136
137137 $key = "$type/$action";
@@ -138,37 +138,35 @@
139139 if( is_null( $title ) ) {
140140 $rv=wfMsg( $wgLogActions[$key] );
141141 } else {
142 - if( $skin ) {
143 -
 142+ if( $forContent ) {
 143+ $titleLink = $title->getPrefixedText();
 144+ } else {
144145 switch( $type ) {
145146 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] );
148149 break;
149150 case 'block':
150151 if( substr( $title->getText(), 0, 1 ) == '#' ) {
151152 $titleLink = $title->getText();
152153 } 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' ) ) . ')';
155156 }
156157 break;
157158 case 'rights':
158159 $text = $wgContLang->ucfirst( $title->getText() );
159 - $titleLink = $skin->makeLinkObj( Title::makeTitle( NS_USER, $text ) );
 160+ $titleLink = Linker::makeLinkObj( Title::makeTitle( NS_USER, $text ) );
160161 break;
161162 default:
162 - $titleLink = $skin->makeLinkObj( $title );
 163+ $titleLink = Linker::makeLinkObj( $title );
163164 }
164 -
165 - } else {
166 - $titleLink = $title->getPrefixedText();
167165 }
168166 if( $key == 'rights/rights' ) {
169 - if ($skin) {
170 - $rightsnone = wfMsg( 'rightsnone' );
171 - } else {
 167+ if( $forContent ) {
172168 $rightsnone = wfMsgForContent( 'rightsnone' );
 169+ } else {
 170+ $rightsnone = wfMsg( 'rightsnone' );
173171 }
174172 if( !isset( $params[0] ) || trim( $params[0] ) == '' )
175173 $params[0] = $rightsnone;
@@ -176,17 +174,17 @@
177175 $params[1] = $rightsnone;
178176 }
179177 if( count( $params ) == 0 ) {
180 - if ( $skin ) {
181 - $rv = wfMsg( $wgLogActions[$key], $titleLink );
182 - } else {
 178+ if ( $forContent ) {
183179 $rv = wfMsgForContent( $wgLogActions[$key], $titleLink );
 180+ } else {
 181+ $rv = wfMsg( $wgLogActions[$key], $titleLink );
184182 }
185183 } else {
186184 array_unshift( $params, $titleLink );
187185 if ( $translate && $key == 'block/block' ) {
188186 $params[1] = $wgLang->translateBlockExpiry($params[1]);
189187 }
190 - $rv = wfMsgReal( $wgLogActions[$key], $params, true, !$skin );
 188+ $rv = wfMsgReal( $wgLogActions[$key], $params, true, $forContent );
191189 }
192190 }
193191 } else {
@@ -194,8 +192,8 @@
195193 $rv = "$action";
196194 }
197195 if( $filterWikilinks ) {
198 - $rv = str_replace( "[[", "", $rv );
199 - $rv = str_replace( "]]", "", $rv );
 196+ $rv = str_replace( '[[', '', $rv );
 197+ $rv = str_replace( ']]', '', $rv );
200198 }
201199 return $rv;
202200 }
@@ -215,9 +213,9 @@
216214 $this->action = $action;
217215 $this->target = $target;
218216 $this->comment = $comment;
219 - $this->params = LogPage::makeParamBlob( $params );
 217+ $this->params = self::makeParamBlob( $params );
220218
221 - $this->actionText = LogPage::actionText( $this->type, $action, $target, NULL, $params );
 219+ $this->actionText = self::actionText( $this->type, $action, $target, true, $params );
222220
223221 return $this->saveContent();
224222 }
@@ -226,7 +224,7 @@
227225 * Create a blob from a parameter array
228226 * @static
229227 */
230 - function makeParamBlob( $params ) {
 228+ static function makeParamBlob( $params ) {
231229 return implode( "\n", $params );
232230 }
233231
@@ -234,7 +232,7 @@
235233 * Extract a parameter array from a blob
236234 * @static
237235 */
238 - function extractParams( $blob ) {
 236+ static function extractParams( $blob ) {
239237 if ( $blob === '' ) {
240238 return array();
241239 } else {
Index: trunk/phase3/includes/SpecialShortpages.php
@@ -60,7 +60,7 @@
6161 return false;
6262 }
6363
64 - function formatResult( $skin, $result ) {
 64+ function formatResult( $result ) {
6565 global $wgLang, $wgContLang;
6666 $dm = $wgContLang->getDirMark();
6767
@@ -68,10 +68,10 @@
6969 if ( !$title ) {
7070 return '<!-- Invalid title ' . htmlspecialchars( "{$result->namespace}:{$result->title}" ). '-->';
7171 }
72 - $hlink = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' );
 72+ $hlink = Linker::makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' );
7373 $plink = $this->isCached()
74 - ? $skin->makeLinkObj( $title )
75 - : $skin->makeKnownLinkObj( $title );
 74+ ? Linker::makeLinkObj( $title )
 75+ : Linker::makeKnownLinkObj( $title );
7676 $size = wfMsgHtml( 'nbytes', $wgLang->formatNum( htmlspecialchars( $result->value ) ) );
7777
7878 return $title->exists()
Index: trunk/phase3/includes/EditPage.php
@@ -820,8 +820,6 @@
821821 $fname = 'EditPage::showEditForm';
822822 wfProfileIn( $fname );
823823
824 - $sk =& $wgUser->getSkin();
825 -
826824 wfRunHooks( 'EditPage::showEditForm:initial', array( &$this ) ) ;
827825
828826 $wgOut->setRobotpolicy( 'noindex,nofollow' );
@@ -943,7 +941,7 @@
944942 $minor = wfMsgExt('minoredit', array('parseinline'));
945943 $watchthis = wfMsgExt('watchthis', array('parseinline'));
946944
947 - $cancel = $sk->makeKnownLink( $this->mTitle->getPrefixedText(),
 945+ $cancel = Linker::makeKnownLink( $this->mTitle->getPrefixedText(),
948946 wfMsgExt('cancel', array('parseinline')) );
949947 $edithelpurl = Skin::makeInternalOrExternalUrl( wfMsgForContent( 'edithelppage' ));
950948 $edithelp = '<a target="helpwindow" href="'.$edithelpurl.'">'.
@@ -1254,13 +1252,9 @@
12551253 * Prepare a list of templates used by this page. Returns HTML.
12561254 */
12571255 function formatTemplates() {
1258 - global $wgUser;
1259 -
12601256 $fname = 'EditPage::formatTemplates';
12611257 wfProfileIn( $fname );
12621258
1263 - $sk =& $wgUser->getSkin();
1264 -
12651259 $outText = '';
12661260 $templates = $this->mArticle->getUsedTemplates();
12671261 if ( count( $templates ) > 0 ) {
@@ -1276,7 +1270,7 @@
12771271 wfMsgExt( 'templatesused', array( 'parse' ) ) .
12781272 '</div><ul>';
12791273 foreach ( $templates as $titleObj ) {
1280 - $outText .= '<li>' . $sk->makeLinkObj( $titleObj ) . '</li>';
 1274+ $outText .= '<li>' . Linker::makeLinkObj( $titleObj ) . '</li>';
12811275 }
12821276 $outText .= '</ul>';
12831277 }
@@ -1436,11 +1430,10 @@
14371431 * Produce the stock "please login to edit pages" page
14381432 */
14391433 function userNotLoggedInPage() {
1440 - global $wgUser, $wgOut;
1441 - $skin = $wgUser->getSkin();
 1434+ global $wgOut;
14421435
14431436 $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() );
14451438
14461439 $wgOut->setPageTitle( wfMsg( 'whitelistedittitle' ) );
14471440 $wgOut->setRobotPolicy( 'noindex,nofollow' );
Index: trunk/phase3/includes/SpecialWantedcategories.php
@@ -55,15 +55,15 @@
5656 $db->dataSeek( $res, 0 );
5757 }
5858
59 - function formatResult( $skin, $result ) {
 59+ function formatResult( $result ) {
6060 global $wgLang, $wgContLang;
6161
6262 $nt = Title::makeTitle( $result->namespace, $result->title );
6363 $text = $wgContLang->convert( $nt->getText() );
6464
6565 $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 ) );
6868
6969 $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
7070 $wgLang->formatNum( $result->value ) );
Index: trunk/phase3/includes/SpecialUncategorizedimages.php
@@ -37,11 +37,11 @@
3838 WHERE cl_from IS NULL AND page_namespace = {$ns} AND page_is_redirect = 0";
3939 }
4040
41 - function formatResult( &$skin, $row ) {
 41+ function formatResult( $row ) {
4242 global $wgContLang;
4343 $title = Title::makeTitleSafe( NS_IMAGE, $row->title );
4444 $label = htmlspecialchars( $wgContLang->convert( $title->getText() ) );
45 - return $skin->makeKnownLinkObj( $title, $label );
 45+ return Linker::makeKnownLinkObj( $title, $label );
4646 }
4747
4848 }
Index: trunk/phase3/includes/SpecialUnusedimages.php
@@ -40,7 +40,7 @@
4141 }
4242 }
4343
44 - function formatResult( $skin, $result ) {
 44+ function formatResult( $result ) {
4545 global $wgLang, $wgContLang;
4646 $title = Title::makeTitle( NS_IMAGE, $result->title );
4747
@@ -49,7 +49,7 @@
5050
5151 $return =
5252 # The 'desc' linking to the image page
53 - '('.$skin->makeKnownLinkObj( $title, wfMsg('imgdesc') ).') ' . $dirmark .
 53+ '('.Linker::makeKnownLinkObj( $title, wfMsg('imgdesc') ).') ' . $dirmark .
5454
5555 # Link to the image itself
5656 '<a href="' . $imageUrl . '">' . htmlspecialchars( $title->getText() ) .
@@ -59,11 +59,11 @@
6060 $wgLang->timeanddate($result->value) . ' . . ' . $dirmark .
6161
6262 # 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 ),
6464 $result->img_user_text) . $dirmark .
6565
6666 # If there is a description, show it
67 - $skin->commentBlock( $wgContLang->convert( $result->img_description ) );
 67+ Linker::commentBlock( $wgContLang->convert( $result->img_description ) );
6868
6969 return $return;
7070 }
Index: trunk/phase3/includes/OutputPage.php
@@ -231,7 +231,7 @@
232232 * Add an array of categories, with names in the keys
233233 */
234234 public function addCategoryLinks($categories) {
235 - global $wgUser, $wgContLang;
 235+ global $wgContLang;
236236
237237 if ( !is_array( $categories ) ) {
238238 return;
@@ -242,11 +242,10 @@
243243 $lb->setArray( $arr );
244244 $lb->execute();
245245
246 - $sk =& $wgUser->getSkin();
247246 foreach ( $categories as $category => $arbitrary ) {
248247 $title = Title::makeTitleSafe( NS_CATEGORY, $category );
249248 $text = $wgContLang->convertHtml( $title->getText() );
250 - $this->mCategoryLinks[] = $sk->makeLinkObj( $title, $text );
 249+ $this->mCategoryLinks[] = Linker::makeLinkObj( $title, $text );
251250 }
252251 }
253252
@@ -615,9 +614,6 @@
616615 # Buffer output; final headers may depend on later processing
617616 ob_start();
618617
619 - # Disable temporary placeholders, so that the skin produces HTML
620 - $sk->postParseLinkColour( false );
621 -
622618 $wgRequest->response()->header( "Content-type: $wgMimeType; charset={$wgOutputEncoding}" );
623619 $wgRequest->response()->header( 'Content-language: '.$wgContLanguageCode );
624620
@@ -760,7 +756,7 @@
761757 * @param string $permission key required
762758 */
763759 public function permissionRequired( $permission ) {
764 - global $wgGroupPermissions, $wgUser;
 760+ global $wgGroupPermissions;
765761
766762 $this->setPageTitle( wfMsg( 'badaccess' ) );
767763 $this->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
@@ -774,8 +770,7 @@
775771 $groupName = User::getGroupName( $key );
776772 $groupPage = User::getGroupPage( $key );
777773 if( $groupPage ) {
778 - $skin =& $wgUser->getSkin();
779 - $groups[] = '"'.$skin->makeLinkObj( $groupPage, $groupName ).'"';
 774+ $groups[] = '"'.Linker::makeLinkObj( $groupPage, $groupName ).'"';
780775 } else {
781776 $groups[] = '"'.$groupName.'"';
782777 }
@@ -823,15 +818,13 @@
824819 return;
825820 }
826821
827 - $skin = $wgUser->getSkin();
828 -
829822 $this->setPageTitle( wfMsg( 'loginreqtitle' ) );
830823 $this->setHtmlTitle( wfMsg( 'errorpagetitle' ) );
831824 $this->setRobotPolicy( 'noindex,nofollow' );
832825 $this->setArticleFlag( false );
833826
834827 $loginTitle = SpecialPage::getTitleFor( 'Userlogin' );
835 - $loginLink = $skin->makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $wgTitle->getPrefixedUrl() );
 828+ $loginLink = Linker::makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $wgTitle->getPrefixedUrl() );
836829 $this->addHtml( wfMsgWikiHtml( 'loginreqpagetext', $loginLink ) );
837830 $this->addHtml( "\n<!--" . $wgTitle->getPrefixedUrl() . "-->" );
838831
@@ -859,9 +852,8 @@
860853 $this->setArticleRelated( false );
861854
862855 if( $protected ) {
863 - $skin = $wgUser->getSkin();
864856 $this->setPageTitle( wfMsg( 'viewsource' ) );
865 - $this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) );
 857+ $this->setSubtitle( wfMsg( 'viewsourcefor', Linker::makeKnownLinkObj( $wgTitle ) ) );
866858
867859 # Determine if protection is due to the page being a system message
868860 # and show an appropriate explanation
@@ -965,7 +957,7 @@
966958 * @param $returnto page title to return to. Default is Main Page.
967959 */
968960 public function returnToMain( $auto = true, $returnto = NULL ) {
969 - global $wgUser, $wgOut, $wgRequest;
 961+ global $wgOut, $wgRequest;
970962
971963 if ( $returnto == NULL ) {
972964 $returnto = $wgRequest->getText( 'returnto' );
@@ -984,8 +976,7 @@
985977 $titleObj = Title::newMainPage();
986978 }
987979
988 - $sk = $wgUser->getSkin();
989 - $link = $sk->makeLinkObj( $titleObj, '' );
 980+ $link = Linker::makeLinkObj( $titleObj, '' );
990981
991982 $r = wfMsg( 'returnto', $link );
992983 if ( $auto ) {
Index: trunk/phase3/includes/Pager.php
@@ -225,7 +225,7 @@
226226 if ( $query === null ) {
227227 return $text;
228228 } else {
229 - return $this->getSkin()->makeKnownLinkObj( $this->getTitle(), $text,
 229+ return Linker::makeKnownLinkObj( $this->getTitle(), $text,
230230 wfArrayToCGI( $query, $this->getDefaultQuery() ) );
231231 }
232232 }
@@ -262,17 +262,6 @@
263263 }
264264
265265 /**
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 - /**
277266 * Get an array of query parameters that should be put into self-links.
278267 * By default, all parameters passed in the URL are used, except for a
279268 * short blacklist.
Index: trunk/phase3/includes/SpecialAncientpages.php
@@ -44,12 +44,12 @@
4545 return false;
4646 }
4747
48 - function formatResult( $skin, $result ) {
 48+ function formatResult( $result ) {
4949 global $wgLang, $wgContLang;
5050
5151 $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true );
5252 $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() ) ) );
5454 return wfSpecialList($link, $d);
5555 }
5656 }
Index: trunk/phase3/includes/SpecialWatchlist.php
@@ -22,14 +22,13 @@
2323 global $wgEnotifWatchlist;
2424 $fname = 'wfSpecialWatchlist';
2525
26 - $skin =& $wgUser->getSkin();
2726 $specialTitle = SpecialPage::getTitleFor( 'Watchlist' );
2827 $wgOut->setRobotPolicy( 'noindex,nofollow' );
2928
3029 # Anons don't get a watchlist
3130 if( $wgUser->isAnon() ) {
3231 $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() );
3433 $wgOut->addHtml( wfMsgWikiHtml( 'watchlistanontext', $llink ) );
3534 return;
3635 } else {
@@ -190,8 +189,6 @@
191190 $linkBatch->execute();
192191 if( $dbr->numRows( $res ) > 0 )
193192 $dbr->dataSeek( $res, 0 ); # Let's do the time warp again!
194 -
195 - $sk = $wgUser->getSkin();
196193
197194 $list = array();
198195 while( $s = $dbr->fetchObject( $res ) ) {
@@ -216,10 +213,10 @@
217214 global $wgContLang;
218215 $toolLinks = array();
219216 $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 ) );
222219 if( $titleObj->exists() )
223 - $toolLinks[] = $sk->makeKnownLinkObj( $titleObj, wfMsgHtml( 'history_short' ), 'action=history' );
 220+ $toolLinks[] = Linker::makeKnownLinkObj( $titleObj, wfMsgHtml( 'history_short' ), 'action=history' );
224221 $toolLinks = '(' . implode( ' | ', $toolLinks ) . ')';
225222 $checkbox = '<input type="checkbox" name="id[]" value="' . htmlspecialchars( $titleObj->getPrefixedText() ) . '" /> ' . ( $wgContLang->isRTL() ? '&rlm;' : '&lrm;' );
226223 if( $redir ) {
@@ -326,18 +323,17 @@
327324
328325 # Spit out some control panel links
329326 $thisTitle = SpecialPage::getTitleFor( 'Watchlist' );
330 - $skin = $wgUser->getSkin();
331327 $linkElements = array( 'hideOwn' => 'wlhideshowown', 'hideBots' => 'wlhideshowbots' );
332328
333329 # Problems encountered using the fancier method
334330 $label = $hideBots ? wfMsgHtml( 'show' ) : wfMsgHtml( 'hide' );
335331 $linkBits = wfArrayToCGI( array( 'hideBots' => 1 - (int)$hideBots ), $nondefaults );
336 - $link = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits );
 332+ $link = Linker::makeKnownLinkObj( $thisTitle, $label, $linkBits );
337333 $links[] = wfMsgHtml( 'wlhideshowbots', $link );
338334
339335 $label = $hideOwn ? wfMsgHtml( 'show' ) : wfMsgHtml( 'hide' );
340336 $linkBits = wfArrayToCGI( array( 'hideOwn' => 1 - (int)$hideOwn ), $nondefaults );
341 - $link = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits );
 337+ $link = Linker::makeKnownLinkObj( $thisTitle, $label, $linkBits );
342338 $links[] = wfMsgHtml( 'wlhideshowown', $link );
343339
344340 $wgOut->addHTML( implode( ' | ', $links ) );
@@ -403,9 +399,8 @@
404400 }
405401
406402 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(
410405 $wgContLang->specialPage( $page ),
411406 $wgLang->formatNum( $h ),
412407 wfArrayToCGI( array('days' => ($h / 24.0)), $options ) );
@@ -413,9 +408,8 @@
414409 }
415410
416411 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(
420414 $wgContLang->specialPage( $page ),
421415 ($d ? $wgLang->formatNum( $d ) : wfMsgHtml( 'watchlistall2' ) ),
422416 wfArrayToCGI( array('days' => $d), $options ) );
Index: trunk/phase3/includes/SpecialSearch.php
@@ -126,8 +126,7 @@
127127
128128 $this->setupPage( $term );
129129
130 - global $wgUser, $wgOut;
131 - $sk = $wgUser->getSkin();
 130+ global $wgOut;
132131 $wgOut->addWikiText( wfMsg( 'searchresulttext' ) );
133132
134133 #if ( !$this->parseQuery() ) {
@@ -321,14 +320,13 @@
322321 wfProfileOut( $fname );
323322 return "<!-- Broken link in search result -->\n";
324323 }
325 - $sk =& $wgUser->getSkin();
326324
327325 $contextlines = $wgUser->getOption( 'contextlines' );
328326 if ( '' == $contextlines ) { $contextlines = 5; }
329327 $contextchars = $wgUser->getOption( 'contextchars' );
330328 if ( '' == $contextchars ) { $contextchars = 50; }
331329
332 - $link = $sk->makeKnownLinkObj( $t );
 330+ $link = Linker::makeKnownLinkObj( $t );
333331 $revision = Revision::newFromTitle( $t );
334332 $text = $revision->getText();
335333 $size = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'),
Index: trunk/phase3/RELEASE-NOTES
@@ -153,6 +153,7 @@
154154 if they have selected that option in preferences.
155155 * (bug 5936) Show an 'm' to the left of the edit summary on diff pages for minor edits.
156156 * (bug 7820) Improve error reporting for uploads via URL.
 157+* (bug 7405) Make Linker methods static.
157158
158159
159160 == Languages updated ==
Index: trunk/phase3/skins/Nostalgia.php
@@ -57,7 +57,7 @@
5858 $sep = " |\n";
5959
6060 $s = $this->mainPageLink() . $sep
61 - . $this->specialLink( "recentchanges" );
 61+ . self::specialLink( "recentchanges" );
6262
6363 if ( $wgOut->isArticle() ) {
6464 $s .= $sep . $this->editThisPage()
@@ -69,9 +69,9 @@
7070 $s .= $this->extensionTabLinks();
7171
7272 if ( $wgUser->isAnon() ) {
73 - $s .= $sep . $this->specialLink( "userlogin" );
 73+ $s .= $sep . self::specialLink( "userlogin" );
7474 } else {
75 - $s .= $sep . $this->specialLink( "userlogout" );
 75+ $s .= $sep . self::specialLink( "userlogout" );
7676 }
7777
7878 $s .= $sep . $this->specialPagesList();
Index: trunk/phase3/skins/disabled/HTMLDump.php
@@ -80,7 +80,7 @@
8181 $hasMembers = $dbr->selectField( 'categorylinks', '1',
8282 array( 'cl_to' => $nt->getDBkey() ), __METHOD__ );
8383 if ( $hasMembers ) {
84 - return $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
 84+ return self::makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
8585 }
8686 }
8787
Index: trunk/phase3/skins/disabled/MonoBookCBT.php
@@ -428,12 +428,12 @@
429429 $usertalktitle = $usertitle->getTalkPage();
430430 if( !$usertalktitle->equals( $this->mTitle ) ) {
431431 $ntl = wfMsg( 'youhavenewmessages',
432 - $this->makeKnownLinkObj(
 432+ self::makeKnownLinkObj(
433433 $usertalktitle,
434434 wfMsgHtml( 'newmessageslink' ),
435435 'redirect=no'
436436 ),
437 - $this->makeKnownLinkObj(
 437+ self::makeKnownLinkObj(
438438 $usertalktitle,
439439 wfMsgHtml( 'newmessagesdifflink' ),
440440 'diff=cur'
Index: trunk/phase3/skins/CologneBlue.php
@@ -84,7 +84,7 @@
8585 $s .= "<td class='bottom' align='center' valign='top'>";
8686
8787 $s .= $this->bottomLinks();
88 - $s .= "\n<br />" . $this->makeKnownLink( wfMsgForContent( "mainpage" ) ) . " | "
 88+ $s .= "\n<br />" . self::makeKnownLink( wfMsgForContent( "mainpage" ) ) . " | "
8989 . $this->aboutLink() . " | "
9090 . $this->searchForm( wfMsg( "qbfind" ) );
9191
@@ -138,15 +138,15 @@
139139 }
140140
141141 $s = "" .
142 - $this->makeKnownLink( wfMsgForContent( "mainpage" ), wfMsg( "mainpage" ) )
 142+ self::makeKnownLink( wfMsgForContent( "mainpage" ), wfMsg( "mainpage" ) )
143143 . " | " .
144 - $this->makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) )
 144+ self::makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) )
145145 . " | " .
146 - $this->makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) )
 146+ self::makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) )
147147 . " | " .
148 - $this->makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") )
 148+ self::makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") )
149149 . " | " .
150 - $this->specialLink( "specialpages" );
 150+ self::specialLink( "specialpages" );
151151
152152 /* show links to different language variants */
153153 $s .= $this->variantLinks();
@@ -154,9 +154,9 @@
155155
156156 $s .= " | ";
157157 if ( $wgUser->isLoggedIn() ) {
158 - $s .= $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
 158+ $s .= self::makeKnownLink( $lo, wfMsg( "logout" ), $q );
159159 } else {
160 - $s .= $this->makeKnownLink( $li, wfMsg( "login" ), $q );
 160+ $s .= self::makeKnownLink( $li, wfMsg( "login" ), $q );
161161 }
162162
163163 return $s;
@@ -195,7 +195,7 @@
196196 $s .= $this->menuHead( "qbedit" );
197197 $s .= "<strong>" . $this->editThisPage() . "</strong>";
198198
199 - $s .= $sep . $this->makeKnownLink( wfMsgForContent( "edithelppage" ), wfMsg( "edithelp" ) );
 199+ $s .= $sep . self::makeKnownLink( wfMsgForContent( "edithelppage" ), wfMsg( "edithelp" ) );
200200
201201 if( $wgUser->isLoggedIn() ) {
202202 $s .= $sep . $this->moveThisPage();
@@ -244,31 +244,31 @@
245245 $s .= $this->menuHead( "qbmyoptions" );
246246 if ( $wgUser->isLoggedIn() ) {
247247 $name = $wgUser->getName();
248 - $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
 248+ $tl = self::makeKnownLinkObj( $wgUser->getTalkPage(),
249249 wfMsg( 'mytalk' ) );
250250 if ( $wgUser->getNewtalk() ) {
251251 $tl .= " *";
252252 }
253253
254 - $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(),
 254+ $s .= self::makeKnownLinkObj( $wgUser->getUserPage(),
255255 wfMsg( "mypage" ) )
256256 . $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() ),
259259 wfMsg( "mycontris" ) )
260 - . $sep . $this->specialLink( "preferences" )
261 - . $sep . $this->specialLink( "userlogout" );
 260+ . $sep . self::specialLink( "preferences" )
 261+ . $sep . self::specialLink( "userlogout" );
262262 } else {
263 - $s .= $this->specialLink( "userlogin" );
 263+ $s .= self::specialLink( "userlogin" );
264264 }
265265
266266 $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" )
270270 . $sep . $this->bugReportsLink();
271271 if ( $wgUser->isLoggedIn() && $wgEnableUploads ) {
272 - $s .= $sep . $this->specialLink( "upload" );
 272+ $s .= $sep . self::specialLink( "upload" );
273273 }
274274 global $wgSiteSupportPage;
275275 if( $wgSiteSupportPage) {
@@ -276,7 +276,7 @@
277277 .wfMsg( "sitesupport" )."</a>";
278278 }
279279
280 - $s .= $sep . $this->makeKnownLinkObj(
 280+ $s .= $sep . self::makeKnownLinkObj(
281281 SpecialPage::getTitleFor( 'Specialpages' ),
282282 wfMsg( 'moredotdotdot' ) );
283283
Index: trunk/phase3/skins/Standard.php
@@ -118,7 +118,7 @@
119119 $s .= $this->bottomLinks();
120120 $s .= "\n<br />" . $this->mainPageLink()
121121 . ' | ' . $this->aboutLink()
122 - . ' | ' . $this->specialLink( 'recentchanges' )
 122+ . ' | ' . self::specialLink( 'recentchanges' )
123123 . ' | ' . $this->searchForm()
124124 . '<br /><span id="pagestats">' . $this->pageStats() . '</span>';
125125
@@ -164,8 +164,8 @@
165165 }
166166
167167 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' ),
170170 wfMsg( 'mycontris' ), 'target=' . wfUrlencode($wgUser->getName() ) );
171171 }
172172 // only show watchlist link if logged in
@@ -220,7 +220,7 @@
221221 $link = $nstext . ':' . $link ;
222222 }
223223
224 - $s .= $this->makeLink( $link, $text );
 224+ $s .= self::makeLink( $link, $text );
225225 } elseif( $wgTitle->getNamespace() != NS_SPECIAL ) {
226226 # we just throw in a "New page" text to tell the user that he's in edit mode,
227227 # and to avoid messing with the separator that is prepended to the next item
@@ -231,10 +231,10 @@
232232
233233 # "Post a comment" link
234234 if( ( $wgTitle->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
235 - $s .= '<br />' . $this->makeKnownLinkObj( $wgTitle, wfMsg( 'postcomment' ), 'action=edit&section=new' );
 235+ $s .= '<br />' . self::makeKnownLinkObj( $wgTitle, wfMsg( 'postcomment' ), 'action=edit&section=new' );
236236
237237 #if( $tns%2 && $action!='edit' && !$wpPreview) {
238 - #$s.= '<br />'.$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg('postcomment'),'action=edit&section=new');
 238+ #$s.= '<br />'.self::makeKnownLink($wgTitle->getPrefixedText(),wfMsg('postcomment'),'action=edit&section=new');
239239 #}
240240
241241 /*
@@ -282,9 +282,9 @@
283283 }
284284
285285 if ( $wgUser->isLoggedIn() && ( $wgEnableUploads || $wgRemoteUploads ) ) {
286 - $s .= $this->specialLink( 'upload' ) . $sep;
 286+ $s .= self::specialLink( 'upload' ) . $sep;
287287 }
288 - $s .= $this->specialLink( 'specialpages' )
 288+ $s .= self::specialLink( 'specialpages' )
289289 . $sep . $this->bugReportsLink();
290290
291291 global $wgSiteSupportPage;

Follow-up revisions

RevisionCommit summaryAuthorDate
r17480* (bug 7405) Change extensions to use static calls to Linker. Patch by Dan Li.simetrical05:23, 8 November 2006
r17481Fix parserTests regression introduced in r17479....nickj06:03, 8 November 2006
r17484Reverting 17479/17480, breaks subclassing of Linker methods by skins. See my ...tstarling07:12, 8 November 2006