r17484 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17483‎ | r17484 | r17485 >
Date:07:12, 8 November 2006
Author:tstarling
Status:old
Tags:
Comment:
Reverting 17479/17480, breaks subclassing of Linker methods by skins. See my comment on bug 7405.
Modified paths:
  • /trunk/extensions/CrossNamespaceLinks/SpecialCrossNamespaceLinks_body.php (modified) (history)
  • /trunk/extensions/LinkSearch/LinkSearch.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Datatype.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/Relations/SMW_SpecialAttributes.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/Relations/SMW_SpecialRelations.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/Relations/SMW_SpecialTypes.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/Relations/SMW_SpecialUnusedAttributes.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/Relations/SMW_SpecialUnusedRelations.php (modified) (history)
  • /trunk/extensions/interact/SpecialInteract.php (modified) (history)
  • /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/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 />" . self::makeKnownLink( wfMsgForContent( "mainpage" ) ) . " | "
 88+ $s .= "\n<br />" . $this->makeKnownLink( wfMsgForContent( "mainpage" ) ) . " | "
8989 . $this->aboutLink() . " | "
9090 . $this->searchForm( wfMsg( "qbfind" ) );
9191
@@ -138,15 +138,15 @@
139139 }
140140
141141 $s = "" .
142 - self::makeKnownLink( wfMsgForContent( "mainpage" ), wfMsg( "mainpage" ) )
 142+ $this->makeKnownLink( wfMsgForContent( "mainpage" ), wfMsg( "mainpage" ) )
143143 . " | " .
144 - self::makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) )
 144+ $this->makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) )
145145 . " | " .
146 - self::makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) )
 146+ $this->makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) )
147147 . " | " .
148 - self::makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") )
 148+ $this->makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") )
149149 . " | " .
150 - self::specialLink( "specialpages" );
 150+ $this->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 .= self::makeKnownLink( $lo, wfMsg( "logout" ), $q );
 158+ $s .= $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
159159 } else {
160 - $s .= self::makeKnownLink( $li, wfMsg( "login" ), $q );
 160+ $s .= $this->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 . self::makeKnownLink( wfMsgForContent( "edithelppage" ), wfMsg( "edithelp" ) );
 199+ $s .= $sep . $this->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 = self::makeKnownLinkObj( $wgUser->getTalkPage(),
 248+ $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
249249 wfMsg( 'mytalk' ) );
250250 if ( $wgUser->getNewtalk() ) {
251251 $tl .= " *";
252252 }
253253
254 - $s .= self::makeKnownLinkObj( $wgUser->getUserPage(),
 254+ $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(),
255255 wfMsg( "mypage" ) )
256256 . $sep . $tl
257 - . $sep . self::specialLink( "watchlist" )
258 - . $sep . self::makeKnownLinkObj( SpecialPage::getSafeTitleFor( "Contributions", $wgUser->getName() ),
 257+ . $sep . $this->specialLink( "watchlist" )
 258+ . $sep . $this->makeKnownLinkObj( SpecialPage::getSafeTitleFor( "Contributions", $wgUser->getName() ),
259259 wfMsg( "mycontris" ) )
260 - . $sep . self::specialLink( "preferences" )
261 - . $sep . self::specialLink( "userlogout" );
 260+ . $sep . $this->specialLink( "preferences" )
 261+ . $sep . $this->specialLink( "userlogout" );
262262 } else {
263 - $s .= self::specialLink( "userlogin" );
 263+ $s .= $this->specialLink( "userlogin" );
264264 }
265265
266266 $s .= $this->menuHead( "qbspecialpages" )
267 - . self::specialLink( "newpages" )
268 - . $sep . self::specialLink( "imagelist" )
269 - . $sep . self::specialLink( "statistics" )
 267+ . $this->specialLink( "newpages" )
 268+ . $sep . $this->specialLink( "imagelist" )
 269+ . $sep . $this->specialLink( "statistics" )
270270 . $sep . $this->bugReportsLink();
271271 if ( $wgUser->isLoggedIn() && $wgEnableUploads ) {
272 - $s .= $sep . self::specialLink( "upload" );
 272+ $s .= $sep . $this->specialLink( "upload" );
273273 }
274274 global $wgSiteSupportPage;
275275 if( $wgSiteSupportPage) {
@@ -276,7 +276,7 @@
277277 .wfMsg( "sitesupport" )."</a>";
278278 }
279279
280 - $s .= $sep . self::makeKnownLinkObj(
 280+ $s .= $sep . $this->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 - . ' | ' . self::specialLink( 'recentchanges' )
 122+ . ' | ' . $this->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.= self::specialLink( 'watchlist' ) ;
169 - $s .= $sep . self::makeKnownLink( $wgContLang->specialPage( 'Contributions' ),
 168+ $s.= $this->specialLink( 'watchlist' ) ;
 169+ $s .= $sep . $this->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 .= self::makeLink( $link, $text );
 224+ $s .= $this->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 />' . self::makeKnownLinkObj( $wgTitle, wfMsg( 'postcomment' ), 'action=edit&section=new' );
 235+ $s .= '<br />' . $this->makeKnownLinkObj( $wgTitle, wfMsg( 'postcomment' ), 'action=edit&section=new' );
236236
237237 #if( $tns%2 && $action!='edit' && !$wpPreview) {
238 - #$s.= '<br />'.self::makeKnownLink($wgTitle->getPrefixedText(),wfMsg('postcomment'),'action=edit&section=new');
 238+ #$s.= '<br />'.$this->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 .= self::specialLink( 'upload' ) . $sep;
 286+ $s .= $this->specialLink( 'upload' ) . $sep;
287287 }
288 - $s .= self::specialLink( 'specialpages' )
 288+ $s .= $this->specialLink( 'specialpages' )
289289 . $sep . $this->bugReportsLink();
290290
291291 global $wgSiteSupportPage;
Index: trunk/phase3/skins/Nostalgia.php
@@ -57,7 +57,7 @@
5858 $sep = " |\n";
5959
6060 $s = $this->mainPageLink() . $sep
61 - . self::specialLink( "recentchanges" );
 61+ . $this->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 . self::specialLink( "userlogin" );
 73+ $s .= $sep . $this->specialLink( "userlogin" );
7474 } else {
75 - $s .= $sep . self::specialLink( "userlogout" );
 75+ $s .= $sep . $this->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 self::makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
 84+ return $this->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 - self::makeKnownLinkObj(
 432+ $this->makeKnownLinkObj(
433433 $usertalktitle,
434434 wfMsgHtml( 'newmessageslink' ),
435435 'redirect=no'
436436 ),
437 - self::makeKnownLinkObj(
 437+ $this->makeKnownLinkObj(
438438 $usertalktitle,
439439 wfMsgHtml( 'newmessagesdifflink' ),
440440 'diff=cur'
Index: trunk/phase3/RELEASE-NOTES
@@ -153,7 +153,6 @@
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.
158157
159158
160159 == Languages updated ==
Index: trunk/phase3/includes/SpecialSpecialpages.php
@@ -9,23 +9,25 @@
1010 *
1111 */
1212 function wfSpecialSpecialpages() {
13 - global $wgOut;
 13+ global $wgOut, $wgUser;
1414
1515 $wgOut->setRobotpolicy( 'index,nofollow' );
 16+ $sk = $wgUser->getSkin();
1617
1718 /** Pages available to all */
18 - wfSpecialSpecialpages_gen( SpecialPage::getRegularPages(), 'spheading' );
 19+ wfSpecialSpecialpages_gen( SpecialPage::getRegularPages(), 'spheading', $sk );
1920
2021 /** Restricted special pages */
21 - wfSpecialSpecialpages_gen( SpecialPage::getRestrictedPages(), 'restrictedpheading' );
 22+ wfSpecialSpecialpages_gen( SpecialPage::getRestrictedPages(), 'restrictedpheading', $sk );
2223 }
2324
2425 /**
2526 * sub function generating the list of pages
2627 * @param $pages the list of pages
2728 * @param $heading header to be used
 29+ * @param $sk skin object ???
2830 */
29 -function wfSpecialSpecialpages_gen( $pages, $heading ) {
 31+function wfSpecialSpecialpages_gen($pages,$heading,$sk) {
3032 global $wgOut, $wgSortSpecialPages;
3133
3234 if( count( $pages ) == 0 ) {
@@ -49,7 +51,7 @@
5052 /** Now output the HTML */
5153 $wgOut->addHTML( '<h2>' . wfMsgHtml( $heading ) . "</h2>\n<ul>" );
5254 foreach ( $sortedPages as $desc => $title ) {
53 - $link = Linker::makeKnownLinkObj( $title, $desc );
 55+ $link = $sk->makeKnownLinkObj( $title, $desc );
5456 $wgOut->addHTML( "<li>{$link}</li>\n" );
5557 }
5658 $wgOut->addHTML( "</ul>\n" );
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;
 25+ var $mArticle, $mTitle, $mSkin;
2626 var $lastdate;
2727 var $linesonpage;
2828 var $mNotificationTimestamp;
@@ -34,9 +34,12 @@
3535 * @returns nothing
3636 */
3737 function PageHistory($article) {
 38+ global $wgUser;
 39+
3840 $this->mArticle =& $article;
3941 $this->mTitle =& $article->mTitle;
4042 $this->mNotificationTimestamp = NULL;
 43+ $this->mSkin = $wgUser->getSkin();
4144 }
4245
4346 /**
@@ -68,7 +71,7 @@
6972 $wgOut->setSyndicated( true );
7073
7174 $logPage = SpecialPage::getTitleFor( 'Log' );
72 - $logLink = Linker::makeKnownLinkObj( $logPage, wfMsgHtml( 'viewpagelogs' ), 'page=' . $this->mTitle->getPrefixedUrl() );
 75+ $logLink = $this->mSkin->makeKnownLinkObj( $logPage, wfMsgHtml( 'viewpagelogs' ), 'page=' . $this->mTitle->getPrefixedUrl() );
7376
7477 $subtitle = wfMsgHtml( 'revhistory' ) . '<br />' . $logLink;
7578 $wgOut->setSubtitle( $subtitle );
@@ -175,8 +178,8 @@
176179 $arbitrary = $this->diffButtons( $rev, $firstInList, $counter );
177180 $link = $this->revLink( $rev );
178181
179 - $user = Linker::userLink( $rev->getUser(), $rev->getUserText() )
180 - . Linker::userToolLinks( $rev->getUser(), $rev->getUserText() );
 182+ $user = $this->mSkin->userLink( $rev->getUser(), $rev->getUserText() )
 183+ . $this->mSkin->userToolLinks( $rev->getUser(), $rev->getUserText() );
181184
182185 $s .= "($curlink) ($lastlink) $arbitrary";
183186
@@ -186,7 +189,7 @@
187190 // We don't currently handle well changing the top revision's settings
188191 $del = wfMsgHtml( 'rev-delundel' );
189192 } else {
190 - $del = Linker::makeKnownLinkObj( $revdel,
 193+ $del = $this->mSkin->makeKnownLinkObj( $revdel,
191194 wfMsg( 'rev-delundel' ),
192195 'target=' . urlencode( $this->mTitle->getPrefixedDbkey() ) .
193196 '&oldid=' . urlencode( $rev->getId() ) );
@@ -200,7 +203,7 @@
201204 $s .= ' ' . wfElement( 'span', array( 'class' => 'minor' ), wfMsg( 'minoreditletter') );
202205 }
203206
204 - $s .= Linker::revComment( $rev );
 207+ $s .= $this->mSkin->revComment( $rev );
205208 if ($notificationtimestamp && ($row->rev_timestamp >= $notificationtimestamp)) {
206209 $s .= ' <span class="updatedmarker">' . wfMsgHtml( 'updatedmarker' ) . '</span>';
207210 }
@@ -217,7 +220,7 @@
218221 global $wgLang;
219222 $date = $wgLang->timeanddate( wfTimestamp(TS_MW, $rev->getTimestamp()), true );
220223 if( $rev->userCan( Revision::DELETED_TEXT ) ) {
221 - $link = Linker::makeKnownLinkObj(
 224+ $link = $this->mSkin->makeKnownLinkObj(
222225 $this->mTitle, $date, "oldid=" . $rev->getId() );
223226 } else {
224227 $link = $date;
@@ -234,7 +237,7 @@
235238 if( $latest || !$rev->userCan( Revision::DELETED_TEXT ) ) {
236239 return $cur;
237240 } else {
238 - return Linker::makeKnownLinkObj(
 241+ return $this->mSkin->makeKnownLinkObj(
239242 $this->mTitle, $cur,
240243 'diff=' . $this->getLatestID() .
241244 "&oldid=" . $rev->getId() );
@@ -249,14 +252,14 @@
250253 return $last;
251254 } elseif ( $next === 'unknown' ) {
252255 # Next row probably exists but is unknown, use an oldid=prev link
253 - return Linker::makeKnownLinkObj(
 256+ return $this->mSkin->makeKnownLinkObj(
254257 $this->mTitle,
255258 $last,
256259 "diff=" . $rev->getId() . "&oldid=prev" );
257260 } elseif( !$rev->userCan( Revision::DELETED_TEXT ) ) {
258261 return $last;
259262 } else {
260 - return Linker::makeKnownLinkObj(
 263+ return $this->mSkin->makeKnownLinkObj(
261264 $this->mTitle,
262265 $last,
263266 "diff=" . $rev->getId() . "&oldid={$next->rev_id}"
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 - self::makeKnownLinkObj(
 299+ $this->makeKnownLinkObj(
300300 $usertalktitle,
301301 wfMsgHtml( 'newmessageslink' ),
302302 'redirect=no'
303303 ),
304 - self::makeKnownLinkObj(
 304+ $this->makeKnownLinkObj(
305305 $usertalktitle,
306306 wfMsgHtml( 'newmessagesdifflink' ),
307307 'diff=cur'
Index: trunk/phase3/includes/SpecialWantedpages.php
@@ -66,7 +66,7 @@
6767 }
6868
6969
70 - function formatResult( $result ) {
 70+ function formatResult( $skin, $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 = Linker::makeBrokenLinkObj( $title );
 79+ $pageLink = $skin->makeBrokenLinkObj( $title );
8080 } else {
8181 # Make a a struck-out normal link
82 - $pageLink = "<s>" . Linker::makeLinkObj( $title ) . "</s>";
 82+ $pageLink = "<s>" . $skin->makeLinkObj( $title ) . "</s>";
8383 }
8484 } else {
8585 # Not cached? Don't bother checking existence; it can't
86 - $pageLink = Linker::makeBrokenLinkObj( $title );
 86+ $pageLink = $skin->makeBrokenLinkObj( $title );
8787 }
8888
8989 # Make a link to "what links here" if it's required
9090 $wlhLink = $this->nlinks
91 - ? $this->makeWlhLink( $title,
 91+ ? $this->makeWlhLink( $title, $skin,
9292 wfMsgExt( 'nlinks', array( 'parsemag', 'escape'),
9393 $wgLang->formatNum( $result->value ) ) )
9494 : null;
@@ -98,12 +98,13 @@
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
102103 * @param $text Link text
103104 * @return string
104105 */
105 - function makeWlhLink( &$title, $text ) {
 106+ function makeWlhLink( &$title, &$skin, $text ) {
106107 $wlhTitle = SpecialPage::getTitleFor( 'Whatlinkshere' );
107 - return Linker::makeKnownLinkObj( $wlhTitle, $text, 'target=' . $title->getPrefixedUrl() );
 108+ return $skin->makeKnownLinkObj( $wlhTitle, $text, 'target=' . $title->getPrefixedUrl() );
108109 }
109110
110111 }
Index: trunk/phase3/includes/SpecialUserlogin.php
@@ -177,6 +177,7 @@
178178 } else {
179179 # Confirm that the account was created
180180 global $wgOut;
 181+ $skin = $wgUser->getSkin();
181182 $self = SpecialPage::getTitleFor( 'Userlogin' );
182183 $wgOut->setPageTitle( wfMsgHtml( 'accountcreated' ) );
183184 $wgOut->setArticleRelated( false );
@@ -726,13 +727,15 @@
727728 * @param $lang Language code
728729 */
729730 function makeLanguageSelectorLink( $text, $lang ) {
 731+ global $wgUser;
730732 $self = SpecialPage::getTitleFor( 'Userlogin' );
731733 $attr[] = 'uselang=' . $lang;
732734 if( $this->mType == 'signup' )
733735 $attr[] = 'type=signup';
734736 if( $this->mReturnTo )
735737 $attr[] = 'returnto=' . $this->mReturnTo;
736 - return Linker::makeKnownLinkObj( $self, htmlspecialchars( $text ), implode( '&', $attr ) );
 738+ $skin =& $wgUser->getSkin();
 739+ return $skin->makeKnownLinkObj( $self, htmlspecialchars( $text ), implode( '&', $attr ) );
737740 }
738741
739742 }
Index: trunk/phase3/includes/SpecialUnusedcategories.php
@@ -33,9 +33,9 @@
3434 AND page_is_redirect = 0";
3535 }
3636
37 - function formatResult( $result ) {
 37+ function formatResult( $skin, $result ) {
3838 $title = Title::makeTitle( NS_CATEGORY, $result->title );
39 - return Linker::makeLinkObj( $title, $title->getText() );
 39+ return $skin->makeLinkObj( $title, $title->getText() );
4040 }
4141 }
4242
Index: trunk/phase3/includes/AjaxFunctions.php
@@ -71,6 +71,8 @@
7272 function wfSajaxSearch( $term ) {
7373 global $wgContLang, $wgOut;
7474 $limit = 16;
 75+
 76+ $l = new Linker;
7577
7678 $term = str_replace( ' ', '_', $wgContLang->ucfirst(
7779 $wgContLang->checkTitleEncoding( $wgContLang->recodeInput( js_unescape( $term ) ) )
@@ -92,10 +94,10 @@
9395 $i=0;
9496 while ( ( $row = $db->fetchObject( $res ) ) && ( ++$i <= $limit ) ) {
9597 $nt = Title::newFromDBkey( $row->page_title );
96 - $r .= '<li>' . Linker::makeKnownLinkObj( $nt ) . "</li>\n";
 98+ $r .= '<li>' . $l->makeKnownLinkObj( $nt ) . "</li>\n";
9799 }
98100 if ( $i > $limit ) {
99 - $more = '<i>' . Linker::makeKnownLink( $wgContLang->specialPage( "Allpages" ),
 101+ $more = '<i>' . $l->makeKnownLink( $wgContLang->specialPage( "Allpages" ),
100102 wfMsg('moredotdotdot'),
101103 "namespace=0&from=" . wfUrlEncode ( $term ) ) .
102104 '</i>';
@@ -111,10 +113,10 @@
112114 . wfMsg( 'hideresults' ) . '</a></div>'
113115 . '<h1 class="firstHeading">'.wfMsg('search')
114116 . '</h1><div id="contentSub">'. $subtitle . '</div><ul><li>'
115 - . Linker::makeKnownLink( $wgContLang->specialPage( 'Search' ),
 117+ . $l->makeKnownLink( $wgContLang->specialPage( 'Search' ),
116118 wfMsg( 'searchcontaining', $term ),
117119 "search=$term&fulltext=Search" )
118 - . '</li><li>' . Linker::makeKnownLink( $wgContLang->specialPage( 'Search' ),
 120+ . '</li><li>' . $l->makeKnownLink( $wgContLang->specialPage( 'Search' ),
119121 wfMsg( 'searchnamed', $term ) ,
120122 "search=$term&go=Go" )
121123 . "</li></ul><h2>" . wfMsg( 'articletitles', $term ) . "</h2>"
Index: trunk/phase3/includes/SpecialDoubleRedirects.php
@@ -61,7 +61,7 @@
6262 return '';
6363 }
6464
65 - function formatResult( $result ) {
 65+ function formatResult( $skin, $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 = 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 );
 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 );
9191 $arr = $wgContLang->getArrow() . $wgContLang->getDirMark();
9292
9393 return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
Index: trunk/phase3/includes/SpecialUnusedimages.php
@@ -40,7 +40,7 @@
4141 }
4242 }
4343
44 - function formatResult( $result ) {
 44+ function formatResult( $skin, $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 - '('.Linker::makeKnownLinkObj( $title, wfMsg('imgdesc') ).') ' . $dirmark .
 53+ '('.$skin->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 - Linker::makeLinkObj( Title::makeTitle( NS_USER, $result->img_user_text ),
 63+ $skin->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 - Linker::commentBlock( $wgContLang->convert( $result->img_description ) );
 67+ $skin->commentBlock( $wgContLang->convert( $result->img_description ) );
6868
6969 return $return;
7070 }
Index: trunk/phase3/includes/SpecialRecentchangeslinked.php
@@ -23,6 +23,7 @@
2424 $hideminor = $wgRequest->getBool( 'hideminor' ) ? 1 : 0;
2525
2626 $wgOut->setPagetitle( wfMsg( 'recentchangeslinked' ) );
 27+ $sk = $wgUser->getSkin();
2728
2829 # Validate the title
2930 $nt = Title::newFromURL( $target );
@@ -54,11 +55,11 @@
5556
5657 $hideminor = ($hideminor ? 1 : 0);
5758 if ( $hideminor ) {
58 - $mlink = Linker::makeKnownLink( $wgContLang->specialPage( 'Recentchangeslinked' ),
 59+ $mlink = $sk->makeKnownLink( $wgContLang->specialPage( 'Recentchangeslinked' ),
5960 wfMsg( 'show' ), 'target=' . htmlspecialchars( $nt->getPrefixedURL() ) .
6061 "&days={$days}&limit={$limit}&hideminor=0" );
6162 } else {
62 - $mlink = Linker::makeKnownLink( $wgContLang->specialPage( "Recentchangeslinked" ),
 63+ $mlink = $sk->makeKnownLink( $wgContLang->specialPage( "Recentchangeslinked" ),
6364 wfMsg( "hide" ), "target=" . htmlspecialchars( $nt->getPrefixedURL() ) .
6465 "&days={$days}&limit={$limit}&hideminor=1" );
6566 }
@@ -137,7 +138,7 @@
138139 }
139140 $res = $dbr->query( $sql, $fname );
140141
141 - $wgOut->addHTML("&lt; ".Linker::makeKnownLinkObj($nt, "", "redirect=no" )."<br />\n");
 142+ $wgOut->addHTML("&lt; ".$sk->makeKnownLinkObj($nt, "", "redirect=no" )."<br />\n");
142143 $note = wfMsg( "rcnote", $limit, $days, $wgLang->timeAndDate( wfTimestampNow(), true ) );
143144 $wgOut->addHTML( "<hr />\n{$note}\n<br />" );
144145
Index: trunk/phase3/includes/SpecialAncientpages.php
@@ -44,12 +44,12 @@
4545 return false;
4646 }
4747
48 - function formatResult( $result ) {
 48+ function formatResult( $skin, $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 = Linker::makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
 53+ $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
5454 return wfSpecialList($link, $d);
5555 }
5656 }
Index: trunk/phase3/includes/SpecialUnwatchedpages.php
@@ -39,14 +39,14 @@
4040
4141 function sortDescending() { return false; }
4242
43 - function formatResult( $result ) {
 43+ function formatResult( $skin, $result ) {
4444 global $wgContLang;
4545
4646 $nt = Title::makeTitle( $result->namespace, $result->title );
4747 $text = $wgContLang->convert( $nt->getPrefixedText() );
4848
49 - $plink = Linker::makeKnownLinkObj( $nt, htmlspecialchars( $text ) );
50 - $wlink = Linker::makeKnownLinkObj( $nt, wfMsgHtml( 'watch' ), 'action=watch' );
 49+ $plink = $skin->makeKnownLinkObj( $nt, htmlspecialchars( $text ) );
 50+ $wlink = $skin->makeKnownLinkObj( $nt, wfMsgHtml( 'watch' ), 'action=watch' );
5151
5252 return wfSpecialList( $plink, $wlink );
5353 }
Index: trunk/phase3/includes/Skin.php
@@ -70,7 +70,7 @@
7171 */
7272 static function normalizeKey( $key ) {
7373 global $wgDefaultSkin;
74 - $skinNames = self::getSkinNames();
 74+ $skinNames = Skin::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 = self::normalizeKey( $key );
 114+ $key = Skin::normalizeKey( $key );
115115
116 - $skinNames = self::getSkinNames();
 116+ $skinNames = Skin::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 = self::makeLinkObj( Title::newFromText( wfMsgForContent('pagecategorieslink') ), $msg )
 583+ $s = $this->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", self::drawCategoryBrowser($parenttree, $this) );
 595+ $tempout = explode("\n", Skin::drawCategoryBrowser($parenttree, $this) );
596596 # Clean out bogus first entry and sort them
597597 unset($tempout[0]);
598598 asort($tempout);
@@ -602,14 +602,12 @@
603603 return $s;
604604 }
605605
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
 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
610609 * @return String separated by &gt;, terminate with "\n"
611 - * @static
612610 */
613 - static function drawCategoryBrowser($tree, &$skin) {
 611+ function drawCategoryBrowser($tree, &$skin) {
614612 $return = '';
615613 foreach ($tree as $element => $parent) {
616614 if (empty($parent)) {
@@ -617,11 +615,11 @@
618616 $return .= "\n";
619617 } else {
620618 # grab the others elements
621 - $return .= self::drawCategoryBrowser($parent, $skin) . ' &gt; ';
 619+ $return .= Skin::drawCategoryBrowser($parent, $skin) . ' &gt; ';
622620 }
623621 # add our current element to the list
624622 $eltitle = Title::NewFromText($element);
625 - $return .= self::makeLinkObj( $eltitle, $eltitle->getText() ) ;
 623+ $return .= $skin->makeLinkObj( $eltitle, $eltitle->getText() ) ;
626624 }
627625 return $return;
628626 }
@@ -692,13 +690,13 @@
693691 $image = new Image( $wgTitle );
694692 if( $image->exists() ) {
695693 $link = htmlspecialchars( $image->getURL() );
696 - $style = self::getInternalLinkAttributes( $link, $name );
 694+ $style = $this->getInternalLinkAttributes( $link, $name );
697695 $s .= " | <a href=\"{$link}\"{$style}>{$name}</a>";
698696 }
699697 }
700698 }
701699 if ( 'history' == $action || isset( $diff ) || isset( $oldid ) ) {
702 - $s .= ' | ' . self::makeKnownLinkObj( $wgTitle,
 700+ $s .= ' | ' . $this->makeKnownLinkObj( $wgTitle,
703701 wfMsg( 'currentrev' ) );
704702 }
705703
@@ -706,8 +704,8 @@
707705 # do not show "You have new messages" text when we are viewing our
708706 # own talk page
709707 if( !$wgTitle->equals( $wgUser->getTalkPage() ) ) {
710 - $tl = self::makeKnownLinkObj( $wgUser->getTalkPage(), wfMsgHtml( 'newmessageslink' ), 'redirect=no' );
711 - $dl = self::makeKnownLinkObj( $wgUser->getTalkPage(), wfMsgHtml( 'newmessagesdifflink' ), 'diff=cur' );
 708+ $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(), wfMsgHtml( 'newmessageslink' ), 'redirect=no' );
 709+ $dl = $this->makeKnownLinkObj( $wgUser->getTalkPage(), wfMsgHtml( 'newmessagesdifflink' ), 'diff=cur' );
712710 $s.= ' | <strong>'. wfMsg( 'youhavenewmessages', $tl, $dl ) . '</strong>';
713711 # disable caching
714712 $wgOut->setSquidMaxage(0);
@@ -734,7 +732,7 @@
735733 $msg = 'viewdeleted';
736734 }
737735 return wfMsg( $msg,
738 - self::makeKnownLink(
 736+ $this->makeKnownLink(
739737 $wgContLang->SpecialPage( 'Undelete/' . $wgTitle->getPrefixedDBkey() ),
740738 wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $n ) ) );
741739 }
@@ -796,7 +794,7 @@
797795 $c++;
798796 if ($c<count($links)) {
799797 $growinglink .= $link;
800 - $getlink = self::makeLink( $growinglink, htmlspecialchars( $link ) );
 798+ $getlink = $this->makeLink( $growinglink, htmlspecialchars( $link ) );
801799 if(preg_match('/class="new"/i',$getlink)) { break; } # this is a hack, but it saves time
802800 if ($c>1) {
803801 $subpages .= ' | ';
@@ -823,7 +821,7 @@
824822 if( $wgShowIPinHeader && isset( $_COOKIE[ini_get('session.name')] ) ) {
825823 $n = wfGetIP();
826824
827 - $tl = self::makeKnownLinkObj( $wgUser->getTalkPage(),
 825+ $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
828826 $wgLang->getNsText( NS_TALK ) );
829827
830828 $s .= $n . ' ('.$tl.')';
@@ -836,24 +834,24 @@
837835 $q = '';
838836 } else { $q = "returnto={$rt}"; }
839837
840 - $s .= "\n<br />" . self::makeKnownLinkObj(
 838+ $s .= "\n<br />" . $this->makeKnownLinkObj(
841839 SpecialPage::getTitleFor( 'Userlogin' ),
842840 wfMsg( 'login' ), $q );
843841 } else {
844842 $n = $wgUser->getName();
845843 $rt = $wgTitle->getPrefixedURL();
846 - $tl = self::makeKnownLinkObj( $wgUser->getTalkPage(),
 844+ $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
847845 $wgLang->getNsText( NS_TALK ) );
848846
849847 $tl = " ({$tl})";
850848
851 - $s .= self::makeKnownLinkObj( $wgUser->getUserPage(),
 849+ $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(),
852850 $n ) . "{$tl}<br />" .
853 - self::makeKnownLinkObj( SpecialPage::getTitleFor( 'Userlogout' ), wfMsg( 'logout' ),
 851+ $this->makeKnownLinkObj( SpecialPage::getTitleFor( 'Userlogout' ), wfMsg( 'logout' ),
854852 "returnto={$rt}" ) . ' | ' .
855 - self::specialLink( 'preferences' );
 853+ $this->specialLink( 'preferences' );
856854 }
857 - $s .= ' | ' . self::makeKnownLink( wfMsgForContent( 'helppage' ),
 855+ $s .= ' | ' . $this->makeKnownLink( wfMsgForContent( 'helppage' ),
858856 wfMsg( 'help' ) );
859857
860858 return $s;
@@ -887,7 +885,7 @@
888886 $sep = " |\n";
889887
890888 $s = $this->mainPageLink() . $sep
891 - . self::specialLink( 'recentchanges' );
 889+ . $this->specialLink( 'recentchanges' );
892890
893891 if ( $wgOut->isArticleRelated() ) {
894892 $s .= $sep . $this->editThisPage()
@@ -1044,9 +1042,9 @@
10451043
10461044 $out = '';
10471045 if( $wgRightsPage ) {
1048 - $link = self::makeKnownLink( $wgRightsPage, $wgRightsText );
 1046+ $link = $this->makeKnownLink( $wgRightsPage, $wgRightsText );
10491047 } elseif( $wgRightsUrl ) {
1050 - $link = self::makeExternalLink( $wgRightsUrl, $wgRightsText );
 1048+ $link = $this->makeExternalLink( $wgRightsUrl, $wgRightsText );
10511049 } else {
10521050 # Give up now
10531051 return $out;
@@ -1150,12 +1148,12 @@
11511149 function mainPageLink() {
11521150 $mp = wfMsgForContent( 'mainpage' );
11531151 $mptxt = wfMsg( 'mainpage');
1154 - $s = self::makeKnownLink( $mp, $mptxt );
 1152+ $s = $this->makeKnownLink( $mp, $mptxt );
11551153 return $s;
11561154 }
11571155
11581156 function copyrightLink() {
1159 - $s = self::makeKnownLink( wfMsgForContent( 'copyrightpage' ),
 1157+ $s = $this->makeKnownLink( wfMsgForContent( 'copyrightpage' ),
11601158 wfMsg( 'copyrightpagename' ) );
11611159 return $s;
11621160 }
@@ -1165,12 +1163,12 @@
11661164 if ($privacy == '-') {
11671165 return '';
11681166 } else {
1169 - return self::makeKnownLink( wfMsgForContent( 'privacypage' ), $privacy);
 1167+ return $this->makeKnownLink( wfMsgForContent( 'privacypage' ), $privacy);
11701168 }
11711169 }
11721170
11731171 function aboutLink() {
1174 - $s = self::makeKnownLink( wfMsgForContent( 'aboutpage' ),
 1172+ $s = $this->makeKnownLink( wfMsgForContent( 'aboutpage' ),
11751173 wfMsg( 'aboutsite' ) );
11761174 return $s;
11771175 }
@@ -1180,7 +1178,7 @@
11811179 if ($disclaimers == '-') {
11821180 return '';
11831181 } else {
1184 - return self::makeKnownLink( wfMsgForContent( 'disclaimerpage' ),
 1182+ return $this->makeKnownLink( wfMsgForContent( 'disclaimerpage' ),
11851183 $disclaimers );
11861184 }
11871185 }
@@ -1197,7 +1195,7 @@
11981196 $t = wfMsg( 'viewsource' );
11991197 }
12001198
1201 - $s = self::makeKnownLinkObj( $wgTitle, $t, $this->editUrlOptions() );
 1199+ $s = $this->makeKnownLinkObj( $wgTitle, $t, $this->editUrlOptions() );
12021200 }
12031201 return $s;
12041202 }
@@ -1226,7 +1224,7 @@
12271225 if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isAllowed('delete') ) {
12281226 $t = wfMsg( 'deletethispage' );
12291227
1230 - $s = self::makeKnownLinkObj( $wgTitle, $t, 'action=delete' );
 1228+ $s = $this->makeKnownLinkObj( $wgTitle, $t, 'action=delete' );
12311229 } else {
12321230 $s = '';
12331231 }
@@ -1245,7 +1243,7 @@
12461244 $t = wfMsg( 'protectthispage' );
12471245 $q = 'action=protect';
12481246 }
1249 - $s = self::makeKnownLinkObj( $wgTitle, $t, $q );
 1247+ $s = $this->makeKnownLinkObj( $wgTitle, $t, $q );
12501248 } else {
12511249 $s = '';
12521250 }
@@ -1263,7 +1261,7 @@
12641262 $t = wfMsg( 'watchthispage' );
12651263 $q = 'action=watch';
12661264 }
1267 - $s = self::makeKnownLinkObj( $wgTitle, $t, $q );
 1265+ $s = $this->makeKnownLinkObj( $wgTitle, $t, $q );
12681266 } else {
12691267 $s = wfMsg( 'notanarticle' );
12701268 }
@@ -1274,7 +1272,7 @@
12751273 global $wgTitle;
12761274
12771275 if ( $wgTitle->userCanMove() ) {
1278 - return self::makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ),
 1276+ return $this->makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ),
12791277 wfMsg( 'movethispage' ), 'target=' . $wgTitle->getPrefixedURL() );
12801278 } else {
12811279 // no message if page is protected - would be redundant
@@ -1285,14 +1283,14 @@
12861284 function historyLink() {
12871285 global $wgTitle;
12881286
1289 - return self::makeKnownLinkObj( $wgTitle,
 1287+ return $this->makeKnownLinkObj( $wgTitle,
12901288 wfMsg( 'history' ), 'action=history' );
12911289 }
12921290
12931291 function whatLinksHere() {
12941292 global $wgTitle;
12951293
1296 - return self::makeKnownLinkObj(
 1294+ return $this->makeKnownLinkObj(
12971295 SpecialPage::getTitleFor( 'Whatlinkshere', $wgTitle->getPrefixedDBkey() ),
12981296 wfMsg( 'whatlinkshere' ) );
12991297 }
@@ -1300,7 +1298,7 @@
13011299 function userContribsLink() {
13021300 global $wgTitle;
13031301
1304 - return self::makeKnownLinkObj(
 1302+ return $this->makeKnownLinkObj(
13051303 SpecialPage::getTitleFor( 'Contributions', $wgTitle->getDBkey() ),
13061304 wfMsg( 'contributions' ) );
13071305 }
@@ -1319,7 +1317,7 @@
13201318 function emailUserLink() {
13211319 global $wgTitle;
13221320
1323 - return self::makeKnownLinkObj(
 1321+ return $this->makeKnownLinkObj(
13241322 SpecialPage::getTitleFor( 'Emailuser', $wgTitle->getDBkey() ),
13251323 wfMsg( 'emailuser' ) );
13261324 }
@@ -1330,7 +1328,7 @@
13311329 if ( ! $wgOut->isArticleRelated() ) {
13321330 return '(' . wfMsg( 'notanarticle' ) . ')';
13331331 } else {
1334 - return self::makeKnownLinkObj(
 1332+ return $this->makeKnownLinkObj(
13351333 SpecialPage::getTitleFor( 'Recentchangeslinked', $wgTitle->getPrefixedDBkey() ),
13361334 wfMsg( 'recentchangeslinked' ) );
13371335 }
@@ -1367,7 +1365,7 @@
13681366 $text = $wgContLang->getLanguageName( $nt->getInterwiki() );
13691367
13701368 if ( '' == $text ) { $text = $l; }
1371 - $style = self::getExternalLinkAttributes( $l, $text );
 1369+ $style = $this->getExternalLinkAttributes( $l, $text );
13721370 $s .= "<a href=\"{$url}\"{$style}>{$text}</a>";
13731371 }
13741372 if($wgContLang->isRTL()) $s .= '</span>';
@@ -1375,7 +1373,7 @@
13761374 }
13771375
13781376 function bugReportsLink() {
1379 - $s = self::makeKnownLink( wfMsgForContent( 'bugreportspage' ),
 1377+ $s = $this->makeKnownLink( wfMsgForContent( 'bugreportspage' ),
13801378 wfMsg( 'bugreports' ) );
13811379 return $s;
13821380 }
@@ -1387,18 +1385,18 @@
13881386 $id = $t1->getArticleID();
13891387
13901388 if ( 0 == $id ) {
1391 - $s = self::makeBrokenLink( $t1->getText() );
 1389+ $s = $this->makeBrokenLink( $t1->getText() );
13921390 } else {
1393 - $s = self::makeKnownLink( $t1->getText() );
 1391+ $s = $this->makeKnownLink( $t1->getText() );
13941392 }
13951393 $s .= ', ';
13961394
13971395 $id = $t2->getArticleID();
13981396
13991397 if ( 0 == $id ) {
1400 - $s .= self::makeBrokenLink( $t2->getText() );
 1398+ $s .= $this->makeBrokenLink( $t2->getText() );
14011399 } else {
1402 - $s .= self::makeKnownLink( $t2->getText() );
 1400+ $s .= $this->makeKnownLink( $t2->getText() );
14031401 }
14041402 return $s;
14051403 }
@@ -1446,7 +1444,7 @@
14471445 $text = wfMsg( 'talkpage' );
14481446 }
14491447
1450 - $s = self::makeLinkObj( $link, $text );
 1448+ $s = $this->makeLinkObj( $link, $text );
14511449
14521450 return $s;
14531451 }
@@ -1469,7 +1467,7 @@
14701468 $title =& $wgTitle->getTalkPage();
14711469 }
14721470
1473 - return self::makeKnownLinkObj( $title, wfMsg( 'postcomment' ), 'action=edit&section=new' );
 1471+ return $this->makeKnownLinkObj( $title, wfMsg( 'postcomment' ), 'action=edit&section=new' );
14741472 }
14751473
14761474 /* these are used extensively in SkinTemplate, but also some other places */
Index: trunk/phase3/includes/SpecialMostimages.php
@@ -34,17 +34,17 @@
3535 ";
3636 }
3737
38 - function formatResult( $result ) {
 38+ function formatResult( $skin, $result ) {
3939 global $wgLang, $wgContLang;
4040
4141 $nt = Title::makeTitle( $result->namespace, $result->title );
4242 $text = $wgContLang->convert( $nt->getPrefixedText() );
4343
44 - $plink = Linker::makeKnownLink( $nt->getPrefixedText(), $text );
 44+ $plink = $skin->makeKnownLink( $nt->getPrefixedText(), $text );
4545
4646 $nl = wfMsgExt( 'nlinks', array( 'parsemag', 'escape'),
4747 $wgLang->formatNum ( $result->value ) );
48 - $nlink = Linker::makeKnownLink( $nt->getPrefixedText() . '#filelinks', $nl );
 48+ $nlink = $skin->makeKnownLink( $nt->getPrefixedText() . '#filelinks', $nl );
4949
5050 return wfSpecialList($plink, $nlink);
5151 }
Index: trunk/phase3/includes/ImagePage.php
@@ -181,6 +181,7 @@
182182 $max = $wgImageLimits[$sizeSel];
183183 $maxWidth = $max[0];
184184 $maxHeight = $max[1];
 185+ $sk = $wgUser->getSkin();
185186
186187 if ( $this->img->exists() ) {
187188 # image
@@ -253,9 +254,9 @@
254255
255256 if ( $page > 1 ) {
256257 $label = $wgOut->parse( wfMsg( 'imgmultipageprev' ), false );
257 - $link = Linker::makeLinkObj( $this->mTitle, $label, 'page='. ($page-1) );
 258+ $link = $sk->makeLinkObj( $this->mTitle, $label, 'page='. ($page-1) );
258259 $this->img->selectPage( $page - 1 );
259 - $thumb1 = Linker::makeThumbLinkObj( $this->img, $link, $label, 'none' );
 260+ $thumb1 = $sk->makeThumbLinkObj( $this->img, $link, $label, 'none' );
260261 } else {
261262 $thumb1 = '';
262263 }
@@ -263,8 +264,8 @@
264265 if ( $page < $count ) {
265266 $label = wfMsg( 'imgmultipagenext' );
266267 $this->img->selectPage( $page + 1 );
267 - $link = Linker::makeLinkObj( $this->mTitle, $label, 'page='. ($page+1) );
268 - $thumb2 = Linker::makeThumbLinkObj( $this->img, $link, $label, 'none' );
 268+ $link = $sk->makeLinkObj( $this->mTitle, $label, 'page='. ($page+1) );
 269+ $thumb2 = $sk->makeThumbLinkObj( $this->img, $link, $label, 'none' );
269270 } else {
270271 $thumb2 = '';
271272 }
@@ -333,20 +334,22 @@
334335 # Image does not exist
335336
336337 $title = SpecialPage::getTitleFor( 'Upload' );
337 - $link = Linker::makeKnownLinkObj($title, wfMsgHtml('noimage-linktext'),
 338+ $link = $sk->makeKnownLinkObj($title, wfMsgHtml('noimage-linktext'),
338339 'wpDestFile=' . urlencode( $this->img->getName() ) );
339340 $wgOut->addHTML( wfMsgWikiHtml( 'noimage', $link ) );
340341 }
341342 }
342343
343344 function printSharedImageText() {
344 - global $wgRepositoryBaseUrl, $wgFetchCommonsDescriptions, $wgOut;
 345+ global $wgRepositoryBaseUrl, $wgFetchCommonsDescriptions, $wgOut, $wgUser;
345346
346347 $url = $wgRepositoryBaseUrl . urlencode($this->mTitle->getDBkey());
347348 $sharedtext = "<div class='sharedUploadNotice'>" . wfMsgWikiHtml("sharedupload");
348349 if ($wgRepositoryBaseUrl && !$wgFetchCommonsDescriptions) {
 350+
 351+ $sk = $wgUser->getSkin();
349352 $title = SpecialPage::getTitleFor( 'Upload' );
350 - $link = Linker::makeKnownLinkObj($title, wfMsgHtml('shareduploadwiki-linktext'),
 353+ $link = $sk->makeKnownLinkObj($title, wfMsgHtml('shareduploadwiki-linktext'),
351354 array( 'wpDestFile' => urlencode( $this->img->getName() )));
352355 $sharedtext .= " " . wfMsgWikiHtml('shareduploadwiki', $link);
353356 }
@@ -376,16 +379,18 @@
377380 if( $this->img->fromSharedDirectory )
378381 return;
379382
 383+ $sk = $wgUser->getSkin();
 384+
380385 $wgOut->addHtml( '<br /><ul>' );
381386
382387 # "Upload a new version of this file" link
383388 if( $wgUser->isAllowed( 'reupload' ) ) {
384 - $ulink = Linker::makeExternalLink( $this->getUploadUrl(), wfMsg( 'uploadnewversion-linktext' ) );
 389+ $ulink = $sk->makeExternalLink( $this->getUploadUrl(), wfMsg( 'uploadnewversion-linktext' ) );
385390 $wgOut->addHtml( "<li><div>{$ulink}</div></li>" );
386391 }
387392
388393 # External editing link
389 - $elink = Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'edit-externally' ), 'action=edit&externaledit=true&mode=file' );
 394+ $elink = $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'edit-externally' ), 'action=edit&externaledit=true&mode=file' );
390395 $wgOut->addHtml( '<li>' . $elink . '<div>' . wfMsgWikiHtml( 'edit-externally-help' ) . '</div></li>' );
391396
392397 $wgOut->addHtml( '</ul>' );
@@ -401,13 +406,16 @@
402407 * If the page we've just displayed is in the "Image" namespace,
403408 * we follow it with an upload history of the image and its usage.
404409 */
405 - function imageHistory() {
406 - global $wgOut, $wgUseExternalEditor;
 410+ function imageHistory()
 411+ {
 412+ global $wgUser, $wgOut, $wgUseExternalEditor;
407413
 414+ $sk = $wgUser->getSkin();
 415+
408416 $line = $this->img->nextHistoryLine();
409417
410418 if ( $line ) {
411 - $list = new ImageHistoryList();
 419+ $list = new ImageHistoryList( $sk );
412420 $s = $list->beginImageHistoryList() .
413421 $list->imageHistoryLine( true, wfTimestamp(TS_MW, $line->img_timestamp),
414422 $this->mTitle->getDBkey(), $line->img_user,
@@ -434,8 +442,9 @@
435443
436444 }
437445
438 - function imageLinks() {
439 - global $wgOut;
 446+ function imageLinks()
 447+ {
 448+ global $wgUser, $wgOut;
440449
441450 $wgOut->addHTML( '<h2 id="filelinks">' . wfMsg( 'imagelinks' ) . "</h2>\n" );
442451
@@ -454,9 +463,10 @@
455464 }
456465 $wgOut->addHTML( '<p>' . wfMsg( 'linkstoimage' ) . "</p>\n<ul>" );
457466
 467+ $sk = $wgUser->getSkin();
458468 while ( $s = $dbr->fetchObject( $res ) ) {
459469 $name = Title::MakeTitle( $s->page_namespace, $s->page_title );
460 - $link = Linker::makeKnownLinkObj( $name, "" );
 470+ $link = $sk->makeKnownLinkObj( $name, "" );
461471 $wgOut->addHTML( "<li>{$link}</li>\n" );
462472 }
463473 $wgOut->addHTML( "</ul>\n" );
@@ -689,7 +699,8 @@
690700 * @package MediaWiki
691701 */
692702 class ImageHistoryList {
693 - function ImageHistoryList() {
 703+ function ImageHistoryList( &$skin ) {
 704+ $this->skin =& $skin;
694705 }
695706
696707 function beginImageHistoryList() {
@@ -715,8 +726,11 @@
716727 $url = Image::imageUrl( $img );
717728 $rlink = $cur;
718729 if ( $wgUser->isAllowed('delete') ) {
719 - $dlink = Linker::makeKnownLinkObj( $wgTitle, $delall,
720 - 'image=' . $wgTitle->getPartialURL() . '&action=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>';
721735 } else {
722736 $dlink = $del;
723737 }
@@ -724,10 +738,10 @@
725739 $url = htmlspecialchars( wfImageArchiveUrl( $img ) );
726740 if( $wgUser->getID() != 0 && $wgTitle->userCanEdit() ) {
727741 $token = urlencode( $wgUser->editToken( $img ) );
728 - $rlink = Linker::makeKnownLinkObj( $wgTitle,
 742+ $rlink = $this->skin->makeKnownLinkObj( $wgTitle,
729743 wfMsg( 'revertimg' ), 'action=revert&oldimage=' .
730744 urlencode( $img ) . "&wpEditToken=$token" );
731 - $dlink = Linker::makeKnownLinkObj( $wgTitle,
 745+ $dlink = $this->skin->makeKnownLinkObj( $wgTitle,
732746 $del, 'action=delete&oldimage=' . urlencode( $img ) .
733747 "&wpEditToken=$token" );
734748 } else {
@@ -739,15 +753,15 @@
740754 }
741755 }
742756
743 - $userlink = Linker::userLink( $user, $usertext ) . Linker::userToolLinks( $user, $usertext );
 757+ $userlink = $this->skin->userLink( $user, $usertext ) . $this->skin->userToolLinks( $user, $usertext );
744758 $nbytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ),
745759 $wgLang->formatNum( $size ) );
746760 $widthheight = wfMsg( 'widthheight', $width, $height );
747 - $style = Linker::getInternalLinkAttributes( $url, $datetime );
 761+ $style = $this->skin->getInternalLinkAttributes( $url, $datetime );
748762
749763 $s = "<li> ({$dlink}) ({$rlink}) <a href=\"{$url}\"{$style}>{$datetime}</a> . . {$userlink} . . {$widthheight} ({$nbytes})";
750764
751 - $s .= Linker::commentBlock( $description, $wgTitle );
 765+ $s .= $this->skin->commentBlock( $description, $wgTitle );
752766 $s .= "</li>\n";
753767 return $s;
754768 }
Index: trunk/phase3/includes/EditPage.php
@@ -820,6 +820,8 @@
821821 $fname = 'EditPage::showEditForm';
822822 wfProfileIn( $fname );
823823
 824+ $sk =& $wgUser->getSkin();
 825+
824826 wfRunHooks( 'EditPage::showEditForm:initial', array( &$this ) ) ;
825827
826828 $wgOut->setRobotpolicy( 'noindex,nofollow' );
@@ -941,7 +943,7 @@
942944 $minor = wfMsgExt('minoredit', array('parseinline'));
943945 $watchthis = wfMsgExt('watchthis', array('parseinline'));
944946
945 - $cancel = Linker::makeKnownLink( $this->mTitle->getPrefixedText(),
 947+ $cancel = $sk->makeKnownLink( $this->mTitle->getPrefixedText(),
946948 wfMsgExt('cancel', array('parseinline')) );
947949 $edithelpurl = Skin::makeInternalOrExternalUrl( wfMsgForContent( 'edithelppage' ));
948950 $edithelp = '<a target="helpwindow" href="'.$edithelpurl.'">'.
@@ -1252,9 +1254,13 @@
12531255 * Prepare a list of templates used by this page. Returns HTML.
12541256 */
12551257 function formatTemplates() {
 1258+ global $wgUser;
 1259+
12561260 $fname = 'EditPage::formatTemplates';
12571261 wfProfileIn( $fname );
12581262
 1263+ $sk =& $wgUser->getSkin();
 1264+
12591265 $outText = '';
12601266 $templates = $this->mArticle->getUsedTemplates();
12611267 if ( count( $templates ) > 0 ) {
@@ -1270,7 +1276,7 @@
12711277 wfMsgExt( 'templatesused', array( 'parse' ) ) .
12721278 '</div><ul>';
12731279 foreach ( $templates as $titleObj ) {
1274 - $outText .= '<li>' . Linker::makeLinkObj( $titleObj ) . '</li>';
 1280+ $outText .= '<li>' . $sk->makeLinkObj( $titleObj ) . '</li>';
12751281 }
12761282 $outText .= '</ul>';
12771283 }
@@ -1430,10 +1436,11 @@
14311437 * Produce the stock "please login to edit pages" page
14321438 */
14331439 function userNotLoggedInPage() {
1434 - global $wgOut;
 1440+ global $wgUser, $wgOut;
 1441+ $skin = $wgUser->getSkin();
14351442
14361443 $loginTitle = SpecialPage::getTitleFor( 'Userlogin' );
1437 - $loginLink = Linker::makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $this->mTitle->getPrefixedUrl() );
 1444+ $loginLink = $skin->makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $this->mTitle->getPrefixedUrl() );
14381445
14391446 $wgOut->setPageTitle( wfMsg( 'whitelistedittitle' ) );
14401447 $wgOut->setRobotPolicy( 'noindex,nofollow' );
Index: trunk/phase3/includes/SpecialBrokenRedirects.php
@@ -45,7 +45,7 @@
4646 return '';
4747 }
4848
49 - function formatResult( $result ) {
 49+ function formatResult( $skin, $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>' . Linker::makeLinkObj( $fromObj ) . '</s>';
 66+ return '<s>' . $skin->makeLinkObj( $fromObj ) . '</s>';
6767 }
6868
69 - $from = Linker::makeKnownLinkObj( $fromObj ,'', 'redirect=no' );
70 - $edit = Linker::makeBrokenLinkObj( $fromObj , "(".wfMsg("qbedit").")" , 'redirect=no');
71 - $to = Linker::makeBrokenLinkObj( $toObj );
 69+ $from = $skin->makeKnownLinkObj( $fromObj ,'', 'redirect=no' );
 70+ $edit = $skin->makeBrokenLinkObj( $fromObj , "(".wfMsg("qbedit").")" , 'redirect=no');
 71+ $to = $skin->makeBrokenLinkObj( $toObj );
7272 $arr = $wgContLang->getArrow();
7373
7474 return "$from $edit $arr $to";
Index: trunk/phase3/includes/ImageGallery.php
@@ -17,6 +17,7 @@
1818 {
1919 var $mImages, $mShowBytes, $mShowFilename;
2020 var $mCaption = false;
 21+ var $mSkin = false;
2122
2223 /**
2324 * Is the gallery on a wiki page (i.e. not a special page)
@@ -50,6 +51,30 @@
5152 }
5253
5354 /**
 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+ /**
5479 * Add an image to the gallery.
5580 *
5681 * @param $image Image object that is added to the gallery
@@ -111,6 +136,8 @@
112137 function toHTML() {
113138 global $wgLang, $wgIgnoreImageErrors, $wgGenerateThumbnailOnParse;
114139
 140+ $sk = $this->getSkin();
 141+
115142 $s = '<table class="gallery" cellspacing="0" cellpadding="0">';
116143 if( $this->mCaption )
117144 $s .= '<td class="galleryheader" colspan="4"><big>' . htmlspecialchars( $this->mCaption ) . '</big></td>';
@@ -130,7 +157,7 @@
131158 else if( $this->mParsing && wfIsBadImage( $nt->getDBkey() ) ) {
132159 # The image is blacklisted, just show it as a text link.
133160 $thumbhtml = '<div style="height: 152px;">'
134 - . Linker::makeKnownLinkObj( $nt, htmlspecialchars( $nt->getText() ) ) . '</div>';
 161+ . $sk->makeKnownLinkObj( $nt, htmlspecialchars( $nt->getText() ) ) . '</div>';
135162 } else if( !( $thumb = $img->getThumbnail( 120, 120, $wgGenerateThumbnailOnParse ) ) ) {
136163 # Error generating thumbnail.
137164 $thumbhtml = '<div style="height: 152px;">'
@@ -139,11 +166,11 @@
140167 else {
141168 $vpad = floor( ( 150 - $thumb->height ) /2 ) - 2;
142169 $thumbhtml = '<div class="thumb" style="padding: ' . $vpad . 'px 0;">'
143 - . Linker::makeKnownLinkObj( $nt, $thumb->toHtml() ) . '</div>';
 170+ . $sk->makeKnownLinkObj( $nt, $thumb->toHtml() ) . '</div>';
144171 }
145172
146173 //TODO
147 - //$ul = Linker::makeLink( $wgContLang->getNsText( Namespace::getUser() ) . ":{$ut}", $ut );
 174+ //$ul = $sk->makeLink( $wgContLang->getNsText( Namespace::getUser() ) . ":{$ut}", $ut );
148175
149176 if( $this->mShowBytes ) {
150177 if( $img->exists() ) {
@@ -158,7 +185,7 @@
159186 }
160187
161188 $textlink = $this->mShowFilename ?
162 - Linker::makeKnownLinkObj( $nt, htmlspecialchars( $wgLang->truncate( $nt->getText(), 20, '...' ) ) ) . "<br />\n" :
 189+ $sk->makeKnownLinkObj( $nt, htmlspecialchars( $wgLang->truncate( $nt->getText(), 20, '...' ) ) ) . "<br />\n" :
163190 '' ;
164191
165192 # ATTENTION: The newline after <div class="gallerytext"> is needed to accommodate htmltidy which
Index: trunk/phase3/includes/SpecialWatchlist.php
@@ -22,13 +22,14 @@
2323 global $wgEnotifWatchlist;
2424 $fname = 'wfSpecialWatchlist';
2525
 26+ $skin =& $wgUser->getSkin();
2627 $specialTitle = SpecialPage::getTitleFor( 'Watchlist' );
2728 $wgOut->setRobotPolicy( 'noindex,nofollow' );
2829
2930 # Anons don't get a watchlist
3031 if( $wgUser->isAnon() ) {
3132 $wgOut->setPageTitle( wfMsg( 'watchnologin' ) );
32 - $llink = Linker::makeKnownLinkObj( SpecialPage::getTitleFor( 'Userlogin' ), wfMsgHtml( 'loginreqlink' ), 'returnto=' . $specialTitle->getPrefixedUrl() );
 33+ $llink = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Userlogin' ), wfMsgHtml( 'loginreqlink' ), 'returnto=' . $specialTitle->getPrefixedUrl() );
3334 $wgOut->addHtml( wfMsgWikiHtml( 'watchlistanontext', $llink ) );
3435 return;
3536 } else {
@@ -189,6 +190,8 @@
190191 $linkBatch->execute();
191192 if( $dbr->numRows( $res ) > 0 )
192193 $dbr->dataSeek( $res, 0 ); # Let's do the time warp again!
 194+
 195+ $sk = $wgUser->getSkin();
193196
194197 $list = array();
195198 while( $s = $dbr->fetchObject( $res ) ) {
@@ -213,10 +216,10 @@
214217 global $wgContLang;
215218 $toolLinks = array();
216219 $titleText = $titleObj->getPrefixedText();
217 - $pageLink = Linker::makeLinkObj( $titleObj );
218 - $toolLinks[] = Linker::makeLinkObj( $titleObj->getTalkPage(), $wgLang->getNsText( NS_TALK ) );
 220+ $pageLink = $sk->makeLinkObj( $titleObj );
 221+ $toolLinks[] = $sk->makeLinkObj( $titleObj->getTalkPage(), $wgLang->getNsText( NS_TALK ) );
219222 if( $titleObj->exists() )
220 - $toolLinks[] = Linker::makeKnownLinkObj( $titleObj, wfMsgHtml( 'history_short' ), 'action=history' );
 223+ $toolLinks[] = $sk->makeKnownLinkObj( $titleObj, wfMsgHtml( 'history_short' ), 'action=history' );
221224 $toolLinks = '(' . implode( ' | ', $toolLinks ) . ')';
222225 $checkbox = '<input type="checkbox" name="id[]" value="' . htmlspecialchars( $titleObj->getPrefixedText() ) . '" /> ' . ( $wgContLang->isRTL() ? '&rlm;' : '&lrm;' );
223226 if( $redir ) {
@@ -323,17 +326,18 @@
324327
325328 # Spit out some control panel links
326329 $thisTitle = SpecialPage::getTitleFor( 'Watchlist' );
 330+ $skin = $wgUser->getSkin();
327331 $linkElements = array( 'hideOwn' => 'wlhideshowown', 'hideBots' => 'wlhideshowbots' );
328332
329333 # Problems encountered using the fancier method
330334 $label = $hideBots ? wfMsgHtml( 'show' ) : wfMsgHtml( 'hide' );
331335 $linkBits = wfArrayToCGI( array( 'hideBots' => 1 - (int)$hideBots ), $nondefaults );
332 - $link = Linker::makeKnownLinkObj( $thisTitle, $label, $linkBits );
 336+ $link = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits );
333337 $links[] = wfMsgHtml( 'wlhideshowbots', $link );
334338
335339 $label = $hideOwn ? wfMsgHtml( 'show' ) : wfMsgHtml( 'hide' );
336340 $linkBits = wfArrayToCGI( array( 'hideOwn' => 1 - (int)$hideOwn ), $nondefaults );
337 - $link = Linker::makeKnownLinkObj( $thisTitle, $label, $linkBits );
 341+ $link = $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits );
338342 $links[] = wfMsgHtml( 'wlhideshowown', $link );
339343
340344 $wgOut->addHTML( implode( ' | ', $links ) );
@@ -399,8 +403,9 @@
400404 }
401405
402406 function wlHoursLink( $h, $page, $options = array() ) {
403 - global $wgLang, $wgContLang;
404 - $s = Linker::makeKnownLink(
 407+ global $wgUser, $wgLang, $wgContLang;
 408+ $sk = $wgUser->getSkin();
 409+ $s = $sk->makeKnownLink(
405410 $wgContLang->specialPage( $page ),
406411 $wgLang->formatNum( $h ),
407412 wfArrayToCGI( array('days' => ($h / 24.0)), $options ) );
@@ -408,8 +413,9 @@
409414 }
410415
411416 function wlDaysLink( $d, $page, $options = array() ) {
412 - global $wgLang, $wgContLang;
413 - $s = Linker::makeKnownLink(
 417+ global $wgUser, $wgLang, $wgContLang;
 418+ $sk = $wgUser->getSkin();
 419+ $s = $sk->makeKnownLink(
414420 $wgContLang->specialPage( $page ),
415421 ($d ? $wgLang->formatNum( $d ) : wfMsgHtml( 'watchlistall2' ) ),
416422 wfArrayToCGI( array('days' => $d), $options ) );
Index: trunk/phase3/includes/SpecialUndelete.php
@@ -482,7 +482,7 @@
483483 }
484484
485485 /* private */ function showList() {
486 - global $wgLang, $wgContLang, $wgOut;
 486+ global $wgLang, $wgContLang, $wgUser, $wgOut;
487487
488488 # List undeletable articles
489489 $result = PageArchive::listAllPages();
@@ -494,11 +494,12 @@
495495 }
496496 $wgOut->addWikiText( wfMsg( "undeletepagetext" ) );
497497
 498+ $sk = $wgUser->getSkin();
498499 $undelete =& SpecialPage::getTitleFor( 'Undelete' );
499500 $wgOut->addHTML( "<ul>\n" );
500501 while( $row = $result->fetchObject() ) {
501502 $title = Title::makeTitleSafe( $row->ar_namespace, $row->ar_title );
502 - $link = Linker::makeKnownLinkObj( $undelete, htmlspecialchars( $title->getPrefixedText() ), 'target=' . $title->getPrefixedUrl() );
 503+ $link = $sk->makeKnownLinkObj( $undelete, htmlspecialchars( $title->getPrefixedText() ), 'target=' . $title->getPrefixedUrl() );
503504 $revs = wfMsgHtml( 'undeleterevisions', $wgLang->formatNum( $row->count ) );
504505 $wgOut->addHtml( "<li>{$link} ({$revs})</li>\n" );
505506 }
@@ -581,6 +582,7 @@
582583 /* private */ function showHistory() {
583584 global $wgLang, $wgUser, $wgOut;
584585
 586+ $sk = $wgUser->getSkin();
585587 if ( $this->mAllowed ) {
586588 $wgOut->setPagetitle( wfMsg( "undeletepage" ) );
587589 } else {
@@ -669,15 +671,15 @@
670672 $ts = wfTimestamp( TS_MW, $row->ar_timestamp );
671673 if ( $this->mAllowed ) {
672674 $checkBox = wfCheck( "ts$ts" );
673 - $pageLink = Linker::makeKnownLinkObj( $titleObj,
 675+ $pageLink = $sk->makeKnownLinkObj( $titleObj,
674676 $wgLang->timeanddate( $ts, true ),
675677 "target=$target&timestamp=$ts" );
676678 } else {
677679 $checkBox = '';
678680 $pageLink = $wgLang->timeanddate( $ts, true );
679681 }
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 );
 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 );
682684 $wgOut->addHTML( "<li>$checkBox $pageLink . . $userLink $comment</li>\n" );
683685
684686 }
@@ -697,14 +699,14 @@
698700 $checkBox = wfCheck( "fileid" . $row->fa_id );
699701 $key = urlencode( $row->fa_storage_key );
700702 $target = urlencode( $this->mTarget );
701 - $pageLink = Linker::makeKnownLinkObj( $titleObj,
 703+ $pageLink = $sk->makeKnownLinkObj( $titleObj,
702704 $wgLang->timeanddate( $ts, true ),
703705 "target=$target&file=$key" );
704706 } else {
705707 $checkBox = '';
706708 $pageLink = $wgLang->timeanddate( $ts, true );
707709 }
708 - $userLink = Linker::userLink( $row->fa_user, $row->fa_user_text ) . Linker::userToolLinks( $row->fa_user, $row->fa_user_text );
 710+ $userLink = $sk->userLink( $row->fa_user, $row->fa_user_text ) . $sk->userToolLinks( $row->fa_user, $row->fa_user_text );
709711 $data =
710712 wfMsgHtml( 'widthheight',
711713 $wgLang->formatNum( $row->fa_width ),
@@ -712,7 +714,7 @@
713715 ' (' .
714716 wfMsgHtml( 'nbytes', $wgLang->formatNum( $row->fa_size ) ) .
715717 ')';
716 - $comment = Linker::commentBlock( $row->fa_description );
 718+ $comment = $sk->commentBlock( $row->fa_description );
717719 $wgOut->addHTML( "<li>$checkBox $pageLink . . $userLink $data $comment</li>\n" );
718720 }
719721 $files->free();
@@ -730,7 +732,7 @@
731733 }
732734
733735 function undelete() {
734 - global $wgOut;
 736+ global $wgOut, $wgUser;
735737 if( !is_null( $this->mTargetObj ) ) {
736738 $archive = new PageArchive( $this->mTargetObj );
737739 $ok = true;
@@ -741,7 +743,8 @@
742744 $this->mFileVersions );
743745
744746 if( $ok ) {
745 - $link = Linker::makeKnownLinkObj( $this->mTargetObj );
 747+ $skin =& $wgUser->getSkin();
 748+ $link = $skin->makeKnownLinkObj( $this->mTargetObj );
746749 $wgOut->addHtml( wfMsgWikiHtml( 'undeletedpage', $link ) );
747750 return true;
748751 }
Index: trunk/phase3/includes/SpecialNewpages.php
@@ -84,20 +84,21 @@
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
8889 * @param $result Result row
8990 * @return string
9091 */
91 - function formatResult( $result ) {
 92+ function formatResult( $skin, $result ) {
9293 global $wgLang, $wgContLang;
9394 $dm = $wgContLang->getDirMark();
9495
9596 $title = Title::makeTitleSafe( $result->namespace, $result->title );
9697 $time = $wgLang->timeAndDate( $result->timestamp, true );
97 - $plink = Linker::makeKnownLinkObj( $title, '', $this->patrollable( $result ) ? 'rcid=' . $result->rcid : '' );
98 - $hist = Linker::makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' );
 98+ $plink = $skin->makeKnownLinkObj( $title, '', $this->patrollable( $result ) ? 'rcid=' . $result->rcid : '' );
 99+ $hist = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' );
99100 $length = wfMsgHtml( 'nbytes', $wgLang->formatNum( htmlspecialchars( $result->length ) ) );
100 - $ulink = Linker::userLink( $result->user, $result->user_text ) . Linker::userToolLinks( $result->user, $result->user_text );
101 - $comment = Linker::commentBlock( $result->comment );
 101+ $ulink = $skin->userLink( $result->user, $result->user_text ) . $skin->userToolLinks( $result->user, $result->user_text );
 102+ $comment = $skin->commentBlock( $result->comment );
102103
103104 return "{$time} {$dm}{$plink} ({$hist}) {$dm}[{$length}] {$dm}{$ulink} {$comment}";
104105 }
Index: trunk/phase3/includes/SpecialNewimages.php
@@ -9,10 +9,11 @@
1010 *
1111 */
1212 function wfSpecialNewimages( $par, $specialPage ) {
13 - global $wgOut, $wgLang, $wgContLang, $wgRequest, $wgGroupPermissions;
 13+ global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgGroupPermissions;
1414
1515 $wpIlMatch = $wgRequest->getText( 'wpIlMatch' );
1616 $dbr =& wfGetDB( DB_SLAVE );
 17+ $sk = $wgUser->getSkin();
1718 $shownav = !$specialPage->including();
1819 $hidebots = $wgRequest->getBool('hidebots',1);
1920
@@ -134,7 +135,7 @@
135136
136137 $nt = Title::newFromText( $name, NS_IMAGE );
137138 $img = new Image( $nt );
138 - $ul = Linker::makeLinkObj( Title::makeTitle( NS_USER, $ut ), $ut );
 139+ $ul = $sk->makeLinkObj( Title::makeTitle( NS_USER, $ut ), $ut );
139140
140141 $gallery->add( $img, "$ul<br />\n<i>".$wgLang->timeanddate( $s->img_timestamp, true )."</i><br />\n" );
141142
@@ -176,18 +177,18 @@
177178 }
178179 $now = wfTimestampNow();
179180 $date = $wgLang->timeanddate( $now, true );
180 - $dateLink = Linker::makeKnownLinkObj( $titleObj, wfMsg( 'sp-newimages-showfrom', $date ), 'from='.$now.$botpar.$searchpar );
 181+ $dateLink = $sk->makeKnownLinkObj( $titleObj, wfMsg( 'sp-newimages-showfrom', $date ), 'from='.$now.$botpar.$searchpar );
181182
182 - $botLink = Linker::makeKnownLinkObj($titleObj, wfMsg( 'showhidebots', ($hidebots ? wfMsg('show') : wfMsg('hide'))),'hidebots='.($hidebots ? '0' : '1').$searchpar);
 183+ $botLink = $sk->makeKnownLinkObj($titleObj, wfMsg( 'showhidebots', ($hidebots ? wfMsg('show') : wfMsg('hide'))),'hidebots='.($hidebots ? '0' : '1').$searchpar);
183184
184185 $prevLink = wfMsg( 'prevn', $wgLang->formatNum( $limit ) );
185186 if( $firstTimestamp && $firstTimestamp != $latestTimestamp ) {
186 - $prevLink = Linker::makeKnownLinkObj( $titleObj, $prevLink, 'from=' . $firstTimestamp . $botpar . $searchpar );
 187+ $prevLink = $sk->makeKnownLinkObj( $titleObj, $prevLink, 'from=' . $firstTimestamp . $botpar . $searchpar );
187188 }
188189
189190 $nextLink = wfMsg( 'nextn', $wgLang->formatNum( $limit ) );
190191 if( $shownImages > $limit && $lastTimestamp ) {
191 - $nextLink = Linker::makeKnownLinkObj( $titleObj, $nextLink, 'until=' . $lastTimestamp.$botpar.$searchpar );
 192+ $nextLink = $sk->makeKnownLinkObj( $titleObj, $nextLink, 'until=' . $lastTimestamp.$botpar.$searchpar );
192193 }
193194
194195 $prevnext = '<p>' . $botLink . ' '. wfMsg( 'viewprevnext', $prevLink, $nextLink, $dateLink ) .'</p>';
Index: trunk/phase3/includes/Pager.php
@@ -225,7 +225,7 @@
226226 if ( $query === null ) {
227227 return $text;
228228 } else {
229 - return Linker::makeKnownLinkObj( $this->getTitle(), $text,
 229+ return $this->getSkin()->makeKnownLinkObj( $this->getTitle(), $text,
230230 wfArrayToCGI( $query, $this->getDefaultQuery() ) );
231231 }
232232 }
@@ -262,6 +262,17 @@
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+ /**
266277 * Get an array of query parameters that should be put into self-links.
267278 * By default, all parameters passed in the URL are used, except for a
268279 * short blacklist.
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( $result ) {
 39+ function formatResult( $skin, $result ) {
4040 global $wgLang, $wgContLang;
4141 $title = Title::makeTitle( $result->namespace, $result->title );
42 - $link = Linker::makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
 42+ $link = $skin->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/SpecialSearch.php
@@ -126,7 +126,8 @@
127127
128128 $this->setupPage( $term );
129129
130 - global $wgOut;
 130+ global $wgUser, $wgOut;
 131+ $sk = $wgUser->getSkin();
131132 $wgOut->addWikiText( wfMsg( 'searchresulttext' ) );
132133
133134 #if ( !$this->parseQuery() ) {
@@ -320,13 +321,14 @@
321322 wfProfileOut( $fname );
322323 return "<!-- Broken link in search result -->\n";
323324 }
 325+ $sk =& $wgUser->getSkin();
324326
325327 $contextlines = $wgUser->getOption( 'contextlines' );
326328 if ( '' == $contextlines ) { $contextlines = 5; }
327329 $contextchars = $wgUser->getOption( 'contextchars' );
328330 if ( '' == $contextchars ) { $contextchars = 50; }
329331
330 - $link = Linker::makeKnownLinkObj( $t );
 332+ $link = $sk->makeKnownLinkObj( $t );
331333 $revision = Revision::newFromTitle( $t );
332334 $text = $revision->getText();
333335 $size = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'),
Index: trunk/phase3/includes/CategoryPage.php
@@ -49,7 +49,8 @@
5050 var $title, $limit, $from, $until,
5151 $articles, $articles_start_char,
5252 $children, $children_start_char,
53 - $showGallery, $gallery;
 53+ $showGallery, $gallery,
 54+ $skin;
5455
5556 function __construct( $title, $from = '', $until = '' ) {
5657 global $wgCategoryPagingLimit;
@@ -98,13 +99,21 @@
99100 }
100101 }
101102
 103+ function getSkin() {
 104+ if ( !$this->skin ) {
 105+ global $wgUser;
 106+ $this->skin = $wgUser->getSkin();
 107+ }
 108+ return $this->skin;
 109+ }
 110+
102111 /**
103112 * Add a subcategory to the internal lists
104113 */
105114 function addSubcategory( $title, $sortkey, $pageLength ) {
106115 global $wgContLang;
107116 // Subcategory; strip the 'Category' namespace from the link text.
108 - $this->children[] = Linker::makeKnownLinkObj(
 117+ $this->children[] = $this->getSkin()->makeKnownLinkObj(
109118 $title, $wgContLang->convertHtml( $title->getText() ) );
110119
111120 $this->children_start_char[] = $this->getSubcategorySortChar( $title, $sortkey );
@@ -150,7 +159,7 @@
151160 */
152161 function addPage( $title, $sortkey, $pageLength ) {
153162 global $wgContLang;
154 - $this->articles[] = Linker::makeSizeLinkObj(
 163+ $this->articles[] = $this->getSkin()->makeSizeLinkObj(
155164 $pageLength, $title, $wgContLang->convert( $title->getPrefixedText() )
156165 );
157166 $this->articles_start_char[] = $wgContLang->convert( $wgContLang->firstChar( $sortkey ) );
@@ -379,16 +388,17 @@
380389 */
381390 function pagingLinks( $title, $first, $last, $limit, $query = array() ) {
382391 global $wgUser, $wgLang;
 392+ $sk =& $this->getSkin();
383393 $limitText = $wgLang->formatNum( $limit );
384394
385395 $prevLink = htmlspecialchars( wfMsg( 'prevn', $limitText ) );
386396 if( $first != '' ) {
387 - $prevLink = Linker::makeLinkObj( $title, $prevLink,
 397+ $prevLink = $sk->makeLinkObj( $title, $prevLink,
388398 wfArrayToCGI( $query + array( 'until' => $first ) ) );
389399 }
390400 $nextLink = htmlspecialchars( wfMsg( 'nextn', $limitText ) );
391401 if( $last != '' ) {
392 - $nextLink = Linker::makeLinkObj( $title, $nextLink,
 402+ $nextLink = $sk->makeLinkObj( $title, $nextLink,
393403 wfArrayToCGI( $query + array( 'from' => $last ) ) );
394404 }
395405
Index: trunk/phase3/includes/SpecialMostlinked.php
@@ -58,26 +58,28 @@
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
6263 * @return string
6364 */
64 - function makeWlhLink( &$title, $caption ) {
 65+ function makeWlhLink( &$title, $caption, &$skin ) {
6566 $wlh = SpecialPage::getTitleFor( 'Whatlinkshere', $title->getPrefixedDBkey() );
66 - return Linker::makeKnownLinkObj( $wlh, $caption );
 67+ return $skin->makeKnownLinkObj( $wlh, $caption );
6768 }
6869
6970 /**
7071 * Make links to the page corresponding to the item, and the "what links here" page for it
7172 *
 73+ * @param $skin Skin to be used
7274 * @param $result Result row
7375 * @return string
7476 */
75 - function formatResult( $result ) {
 77+ function formatResult( $skin, $result ) {
7678 global $wgLang;
7779 $title = Title::makeTitleSafe( $result->namespace, $result->title );
78 - $link = Linker::makeLinkObj( $title );
 80+ $link = $skin->makeLinkObj( $title );
7981 $wlh = $this->makeWlhLink( $title,
8082 wfMsgExt( 'nlinks', array( 'parsemag', 'escape'),
81 - $wgLang->formatNum( $result->value ) ) );
 83+ $wgLang->formatNum( $result->value ) ), $skin );
8284 return wfSpecialList( $link, $wlh );
8385 }
8486 }
Index: trunk/phase3/includes/User.php
@@ -2388,7 +2388,9 @@
23892389 }
23902390 $title = self::getGroupPage( $group );
23912391 if( $title ) {
2392 - return Linker::makeLinkObj( $title, $text );
 2392+ global $wgUser;
 2393+ $sk = $wgUser->getSkin();
 2394+ return $sk->makeLinkObj( $title, $text );
23932395 } else {
23942396 return $text;
23952397 }
Index: trunk/phase3/includes/SpecialMIMEsearch.php
@@ -59,19 +59,19 @@
6060 ";
6161 }
6262
63 - function formatResult( $result ) {
 63+ function formatResult( $skin, $result ) {
6464 global $wgContLang, $wgLang;
6565
6666 $nt = Title::makeTitle( $result->namespace, $result->title );
6767 $text = $wgContLang->convert( $nt->getText() );
68 - $plink = Linker::makeLink( $nt->getPrefixedText(), $text );
 68+ $plink = $skin->makeLink( $nt->getPrefixedText(), $text );
6969
70 - $download = Linker::makeMediaLink( $nt->getText(), 'fuck me!', wfMsgHtml( 'download' ) );
 70+ $download = $skin->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 = Linker::makeLinkObj( Title::makeTitle( NS_USER, $result->img_user_text ), $result->img_user_text );
 75+ $user = $skin->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/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 = Linker::makeKnownLinkObj( Title::makeTitle( NS_IMAGE, $name ),
 116+ $desc = $this->getSkin()->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 = Linker::makeLinkObj( Title::makeTitle( NS_USER, $value ),
 125+ $link = $this->getSkin()->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 Linker::commentBlock( $value );
 134+ return $this->getSkin()->commentBlock( $value );
135135 }
136136 }
137137
Index: trunk/phase3/includes/DifferenceEngine.php
@@ -143,12 +143,13 @@
144144 exit;
145145 }
146146
 147+ $sk = $wgUser->getSkin();
147148 $talk = $wgContLang->getNsText( NS_TALK );
148149 $contribs = wfMsg( 'contribslink' );
149150
150151 if ( $this->mNewRev->isCurrent() && $wgUser->isAllowed('rollback') ) {
151152 $username = $this->mNewRev->getUserText();
152 - $rollback = '&nbsp;&nbsp;&nbsp;<strong>[' . Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'rollbacklink' ),
 153+ $rollback = '&nbsp;&nbsp;&nbsp;<strong>[' . $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'rollbacklink' ),
153154 'action=rollback&from=' . urlencode( $username ) .
154155 '&token=' . urlencode( $wgUser->editToken( array( $this->mTitle->getPrefixedText(), $username ) ) ) ) .
155156 ']</strong>';
@@ -156,17 +157,17 @@
157158 $rollback = '';
158159 }
159160 if( $wgUseRCPatrol && $this->mRcidMarkPatrolled != 0 && $wgUser->isAllowed( 'patrol' ) ) {
160 - $patrol = ' [' . Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'markaspatrolleddiff' ), "action=markpatrolled&rcid={$this->mRcidMarkPatrolled}" ) . ']';
 161+ $patrol = ' [' . $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'markaspatrolleddiff' ), "action=markpatrolled&rcid={$this->mRcidMarkPatrolled}" ) . ']';
161162 } else {
162163 $patrol = '';
163164 }
164165
165 - $prevlink = Linker::makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'previousdiff' ),
 166+ $prevlink = $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'previousdiff' ),
166167 'diff=prev&oldid='.$this->mOldid, '', '', 'id="differences-prevlink"' );
167168 if ( $this->mNewRev->isCurrent() ) {
168169 $nextlink = '&nbsp;';
169170 } else {
170 - $nextlink = Linker::makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'nextdiff' ),
 171+ $nextlink = $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'nextdiff' ),
171172 'diff=next&oldid='.$this->mNewid, '', '', 'id="differences-nextlink"' );
172173 }
173174
@@ -184,12 +185,12 @@
185186 }
186187
187188 $oldHeader = "<strong>{$this->mOldtitle}</strong><br />" .
188 - Linker::revUserTools( $this->mOldRev ) . "<br />" .
189 - $oldminor . Linker::revComment( $this->mOldRev ) . "<br />" .
 189+ $sk->revUserTools( $this->mOldRev ) . "<br />" .
 190+ $oldminor . $sk->revComment( $this->mOldRev ) . "<br />" .
190191 $prevlink;
191192 $newHeader = "<strong>{$this->mNewtitle}</strong><br />" .
192 - Linker::revUserTools( $this->mNewRev ) . " $rollback<br />" .
193 - $newminor . Linker::revComment( $this->mNewRev ) . "<br />" .
 193+ $sk->revUserTools( $this->mNewRev ) . " $rollback<br />" .
 194+ $newminor . $sk->revComment( $this->mNewRev ) . "<br />" .
194195 $nextlink . $patrol;
195196
196197 $this->showDiff( $oldHeader, $newHeader );
@@ -217,7 +218,7 @@
218219 * contrast to normal "old revision" display style.
219220 */
220221 function showFirstRevision() {
221 - global $wgOut;
 222+ global $wgOut, $wgUser;
222223
223224 $fname = 'DifferenceEngine::showFirstRevision';
224225 wfProfileIn( $fname );
@@ -248,10 +249,12 @@
249250
250251 # Prepare the header box
251252 #
252 - $nextlink = Linker::makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'nextdiff' ), 'diff=next&oldid='.$this->mNewid, '', '', 'id="differences-nextlink"' );
 253+ $sk = $wgUser->getSkin();
 254+
 255+ $nextlink = $sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'nextdiff' ), 'diff=next&oldid='.$this->mNewid, '', '', 'id="differences-nextlink"' );
253256 $header = "<div class=\"firstrevisionheader\" style=\"text-align: center\"><strong>{$this->mOldtitle}</strong><br />" .
254 - Linker::revUserTools( $this->mNewRev ) . "<br />" .
255 - Linker::revComment( $this->mNewRev ) . "<br />" .
 257+ $sk->revUserTools( $this->mNewRev ) . "<br />" .
 258+ $sk->revComment( $this->mNewRev ) . "<br />" .
256259 $nextlink . "</div>\n";
257260
258261 $wgOut->addHTML( $header );
Index: trunk/phase3/includes/SpecialUnusedtemplates.php
@@ -33,10 +33,10 @@
3434 return $sql;
3535 }
3636
37 - function formatResult( $result ) {
 37+ function formatResult( $skin, $result ) {
3838 $title = Title::makeTitle( NS_TEMPLATE, $result->title );
39 - $pageLink = Linker::makeKnownLinkObj( $title, '', 'redirect=no' );
40 - $wlhLink = Linker::makeKnownLinkObj(
 39+ $pageLink = $skin->makeKnownLinkObj( $title, '', 'redirect=no' );
 40+ $wlhLink = $skin->makeKnownLinkObj(
4141 SpecialPage::getTitleFor( 'Whatlinkshere' ),
4242 wfMsgHtml( 'unusedtemplateswlh' ),
4343 'target=' . $title->getPrefixedUrl() );
Index: trunk/phase3/includes/SpecialMostrevisions.php
@@ -38,17 +38,17 @@
3939 ";
4040 }
4141
42 - function formatResult( $result ) {
 42+ function formatResult( $skin, $result ) {
4343 global $wgLang, $wgContLang;
4444
4545 $nt = Title::makeTitle( $result->namespace, $result->title );
4646 $text = $wgContLang->convert( $nt->getPrefixedText() );
4747
48 - $plink = Linker::makeKnownLinkObj( $nt, $text );
 48+ $plink = $skin->makeKnownLinkObj( $nt, $text );
4949
5050 $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape'),
5151 $wgLang->formatNum( $result->value ) );
52 - $nlink = Linker::makeKnownLinkObj( $nt, $nl, 'action=history' );
 52+ $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' );
5353
5454 return wfSpecialList($plink, $nlink);
5555 }
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( $row ) {
 41+ function formatResult( &$skin, $row ) {
4242 global $wgContLang;
4343 $title = Title::makeTitleSafe( NS_IMAGE, $row->title );
4444 $label = htmlspecialchars( $wgContLang->convert( $title->getText() ) );
45 - return Linker::makeKnownLinkObj( $title, $label );
 45+ return $skin->makeKnownLinkObj( $title, $label );
4646 }
4747
4848 }
Index: trunk/phase3/includes/Credits.php
@@ -171,8 +171,9 @@
172172 *
173173 */
174174 function creditLink($user_name, $link_text = '') {
175 - global $wgContLang;
176 - return Linker::makeLink($wgContLang->getNsText(NS_USER) . ':' . $user_name,
 175+ global $wgUser, $wgContLang;
 176+ $skin = $wgUser->getSkin();
 177+ return $skin->makeLink($wgContLang->getNsText(NS_USER) . ':' . $user_name,
177178 htmlspecialchars( (empty($link_text)) ? $user_name : $link_text ));
178179 }
179180
@@ -180,7 +181,9 @@
181182 *
182183 */
183184 function creditOthersLink($article) {
184 - return Linker::makeKnownLink($article->mTitle->getPrefixedText(), wfMsg('others'), 'action=credits');
 185+ global $wgUser;
 186+ $skin = $wgUser->getSkin();
 187+ return $skin->makeKnownLink($article->mTitle->getPrefixedText(), wfMsg('others'), 'action=credits');
185188 }
186189
187190 ?>
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 $wgContLang;
 235+ global $wgUser, $wgContLang;
236236
237237 if ( !is_array( $categories ) ) {
238238 return;
@@ -242,10 +242,11 @@
243243 $lb->setArray( $arr );
244244 $lb->execute();
245245
 246+ $sk =& $wgUser->getSkin();
246247 foreach ( $categories as $category => $arbitrary ) {
247248 $title = Title::makeTitleSafe( NS_CATEGORY, $category );
248249 $text = $wgContLang->convertHtml( $title->getText() );
249 - $this->mCategoryLinks[] = Linker::makeLinkObj( $title, $text );
 250+ $this->mCategoryLinks[] = $sk->makeLinkObj( $title, $text );
250251 }
251252 }
252253
@@ -614,6 +615,9 @@
615616 # Buffer output; final headers may depend on later processing
616617 ob_start();
617618
 619+ # Disable temporary placeholders, so that the skin produces HTML
 620+ $sk->postParseLinkColour( false );
 621+
618622 $wgRequest->response()->header( "Content-type: $wgMimeType; charset={$wgOutputEncoding}" );
619623 $wgRequest->response()->header( 'Content-language: '.$wgContLanguageCode );
620624
@@ -756,7 +760,7 @@
757761 * @param string $permission key required
758762 */
759763 public function permissionRequired( $permission ) {
760 - global $wgGroupPermissions;
 764+ global $wgGroupPermissions, $wgUser;
761765
762766 $this->setPageTitle( wfMsg( 'badaccess' ) );
763767 $this->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
@@ -770,7 +774,8 @@
771775 $groupName = User::getGroupName( $key );
772776 $groupPage = User::getGroupPage( $key );
773777 if( $groupPage ) {
774 - $groups[] = '"'.Linker::makeLinkObj( $groupPage, $groupName ).'"';
 778+ $skin =& $wgUser->getSkin();
 779+ $groups[] = '"'.$skin->makeLinkObj( $groupPage, $groupName ).'"';
775780 } else {
776781 $groups[] = '"'.$groupName.'"';
777782 }
@@ -818,13 +823,15 @@
819824 return;
820825 }
821826
 827+ $skin = $wgUser->getSkin();
 828+
822829 $this->setPageTitle( wfMsg( 'loginreqtitle' ) );
823830 $this->setHtmlTitle( wfMsg( 'errorpagetitle' ) );
824831 $this->setRobotPolicy( 'noindex,nofollow' );
825832 $this->setArticleFlag( false );
826833
827834 $loginTitle = SpecialPage::getTitleFor( 'Userlogin' );
828 - $loginLink = Linker::makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $wgTitle->getPrefixedUrl() );
 835+ $loginLink = $skin->makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $wgTitle->getPrefixedUrl() );
829836 $this->addHtml( wfMsgWikiHtml( 'loginreqpagetext', $loginLink ) );
830837 $this->addHtml( "\n<!--" . $wgTitle->getPrefixedUrl() . "-->" );
831838
@@ -852,8 +859,9 @@
853860 $this->setArticleRelated( false );
854861
855862 if( $protected ) {
 863+ $skin = $wgUser->getSkin();
856864 $this->setPageTitle( wfMsg( 'viewsource' ) );
857 - $this->setSubtitle( wfMsg( 'viewsourcefor', Linker::makeKnownLinkObj( $wgTitle ) ) );
 865+ $this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) );
858866
859867 # Determine if protection is due to the page being a system message
860868 # and show an appropriate explanation
@@ -957,7 +965,7 @@
958966 * @param $returnto page title to return to. Default is Main Page.
959967 */
960968 public function returnToMain( $auto = true, $returnto = NULL ) {
961 - global $wgOut, $wgRequest;
 969+ global $wgUser, $wgOut, $wgRequest;
962970
963971 if ( $returnto == NULL ) {
964972 $returnto = $wgRequest->getText( 'returnto' );
@@ -976,7 +984,8 @@
977985 $titleObj = Title::newMainPage();
978986 }
979987
980 - $link = Linker::makeLinkObj( $titleObj, '' );
 988+ $sk = $wgUser->getSkin();
 989+ $link = $sk->makeLinkObj( $titleObj, '' );
981990
982991 $r = wfMsg( 'returnto', $link );
983992 if ( $auto ) {
Index: trunk/phase3/includes/SpecialWhatlinkshere.php
@@ -18,10 +18,12 @@
1919 class WhatLinksHerePage {
2020 var $request, $par;
2121 var $limit, $from, $dir, $target;
22 - var $selfTitle;
 22+ var $selfTitle, $skin;
2323
2424 function WhatLinksHerePage( &$request, $par = null ) {
 25+ global $wgUser;
2526 $this->request =& $request;
 27+ $this->skin =& $wgUser->getSkin();
2628 $this->par = $par;
2729 }
2830
@@ -57,7 +59,7 @@
5860
5961 $isredir = ' (' . wfMsg( 'isredirect' ) . ")\n";
6062
61 - $wgOut->addHTML( wfMsg( 'whatlinkshere-barrow' ) .' '.Linker::makeLinkObj($this->target, '', 'redirect=no' )."<br />\n");
 63+ $wgOut->addHTML( wfMsg( 'whatlinkshere-barrow' ) . ' ' .$this->skin->makeLinkObj($this->target, '', 'redirect=no' )."<br />\n");
6264
6365 $this->showIndirectLinks( 0, $this->target, $this->limit, $this->from, $this->dir );
6466 }
@@ -205,7 +207,7 @@
206208 $extra = '';
207209 }
208210
209 - $link = Linker::makeKnownLinkObj( $nt, '', $extra );
 211+ $link = $this->skin->makeKnownLinkObj( $nt, '', $extra );
210212 $wgOut->addHTML( '<li>'.$link );
211213
212214 // Display properties (redirect or template)
@@ -236,7 +238,7 @@
237239 }
238240
239241 function makeSelfLink( $text, $query ) {
240 - return Linker::makeKnownLinkObj( $this->selfTitle, $text, $query );
 242+ return $this->skin->makeKnownLinkObj( $this->selfTitle, $text, $query );
241243 }
242244
243245 function getPrevNext( $limit, $prevId, $nextId ) {
Index: trunk/phase3/includes/SpecialRecentchanges.php
@@ -222,6 +222,7 @@
223223 }
224224
225225 // And now for the content
 226+ $sk = $wgUser->getSkin();
226227 $wgOut->setSyndicated( true );
227228
228229 $list = ChangesList::newFromUser( $wgUser );
@@ -420,8 +421,9 @@
421422 *
422423 */
423424 function rcCountLink( $lim, $d, $page='Recentchanges', $more='' ) {
424 - global $wgLang, $wgContLang;
425 - $s = Linker::makeKnownLink( $wgContLang->specialPage( $page ),
 425+ global $wgUser, $wgLang, $wgContLang;
 426+ $sk = $wgUser->getSkin();
 427+ $s = $sk->makeKnownLink( $wgContLang->specialPage( $page ),
426428 ($lim ? $wgLang->formatNum( "{$lim}" ) : wfMsg( 'recentchangesall' ) ), "{$more}" .
427429 ($d ? "days={$d}&" : '') . 'limit='.$lim );
428430 return $s;
@@ -431,8 +433,9 @@
432434 *
433435 */
434436 function rcDaysLink( $lim, $d, $page='Recentchanges', $more='' ) {
435 - global $wgLang, $wgContLang;
436 - $s = Linker::makeKnownLink( $wgContLang->specialPage( $page ),
 437+ global $wgUser, $wgLang, $wgContLang;
 438+ $sk = $wgUser->getSkin();
 439+ $s = $sk->makeKnownLink( $wgContLang->specialPage( $page ),
437440 ($d ? $wgLang->formatNum( "{$d}" ) : wfMsg( 'recentchangesall' ) ), $more.'days='.$d .
438441 ($lim ? '&limit='.$lim : '') );
439442 return $s;
@@ -475,8 +478,9 @@
476479 * @param $options
477480 */
478481 function makeOptionsLink( $title, $override, $options ) {
479 - global $wgContLang;
480 - return Linker::makeKnownLink( $wgContLang->specialPage( 'Recentchanges' ),
 482+ global $wgUser, $wgContLang;
 483+ $sk = $wgUser->getSkin();
 484+ return $sk->makeKnownLink( $wgContLang->specialPage( 'Recentchanges' ),
481485 htmlspecialchars( $title ), wfArrayToCGI( $override, $options ) );
482486 }
483487
@@ -617,11 +621,12 @@
618622 }
619623
620624 function rcFormatDiffRow( $title, $oldid, $newid, $timestamp, $comment ) {
621 - global $wgFeedDiffCutoff, $wgContLang;
 625+ global $wgFeedDiffCutoff, $wgContLang, $wgUser;
622626 $fname = 'rcFormatDiff';
623627 wfProfileIn( $fname );
624628
625 - $completeText = '<p>' . Linker::formatComment( $comment ) . "</p>\n";
 629+ $skin = $wgUser->getSkin();
 630+ $completeText = '<p>' . $skin->formatComment( $comment ) . "</p>\n";
626631
627632 if( $title->getNamespace() >= 0 ) {
628633 if( $oldid ) {
Index: trunk/phase3/includes/SpecialImport.php
@@ -176,14 +176,16 @@
177177 }
178178
179179 function reportPage( $title, $origTitle, $revisionCount, $successCount ) {
180 - global $wgOut, $wgLang, $wgContLang;
181 -
 180+ global $wgOut, $wgUser, $wgLang, $wgContLang;
 181+
 182+ $skin = $wgUser->getSkin();
 183+
182184 $this->mPageCount++;
183185
184186 $localCount = $wgLang->formatNum( $successCount );
185187 $contentCount = $wgContLang->formatNum( $successCount );
186188
187 - $wgOut->addHtml( "<li>" . Linker::makeKnownLinkObj( $title ) .
 189+ $wgOut->addHtml( "<li>" . $skin->makeKnownLinkObj( $title ) .
188190 " " .
189191 wfMsgExt( 'import-revision-count', array( 'parsemag', 'escape' ), $localCount ) .
190192 "</li>\n" );
Index: trunk/phase3/includes/LogPage.php
@@ -130,7 +130,7 @@
131131 /**
132132 * @static
133133 */
134 - static function actionText( $type, $action, $title = NULL, $forContent = true, $params = array(), $filterWikilinks=false, $translate=false ) {
 134+ function actionText( $type, $action, $title = NULL, $skin = NULL, $params = array(), $filterWikilinks=false, $translate=false ) {
135135 global $wgLang, $wgContLang, $wgLogActions;
136136
137137 $key = "$type/$action";
@@ -138,35 +138,37 @@
139139 if( is_null( $title ) ) {
140140 $rv=wfMsg( $wgLogActions[$key] );
141141 } else {
142 - if( $forContent ) {
143 - $titleLink = $title->getPrefixedText();
144 - } else {
 142+ if( $skin ) {
 143+
145144 switch( $type ) {
146145 case 'move':
147 - $titleLink = Linker::makeLinkObj( $title, $title->getPrefixedText(), 'redirect=no' );
148 - $params[0] = Linker::makeLinkObj( Title::newFromText( $params[0] ), $params[0] );
 146+ $titleLink = $skin->makeLinkObj( $title, $title->getPrefixedText(), 'redirect=no' );
 147+ $params[0] = $skin->makeLinkObj( Title::newFromText( $params[0] ), $params[0] );
149148 break;
150149 case 'block':
151150 if( substr( $title->getText(), 0, 1 ) == '#' ) {
152151 $titleLink = $title->getText();
153152 } else {
154 - $titleLink = Linker::makeLinkObj( $title, $title->getText() );
155 - $titleLink .= ' (' . Linker::makeKnownLinkObj( SpecialPage::getTitleFor( 'Contributions', $title->getDBkey() ), wfMsg( 'contribslink' ) ) . ')';
 153+ $titleLink = $skin->makeLinkObj( $title, $title->getText() );
 154+ $titleLink .= ' (' . $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Contributions', $title->getDBkey() ), wfMsg( 'contribslink' ) ) . ')';
156155 }
157156 break;
158157 case 'rights':
159158 $text = $wgContLang->ucfirst( $title->getText() );
160 - $titleLink = Linker::makeLinkObj( Title::makeTitle( NS_USER, $text ) );
 159+ $titleLink = $skin->makeLinkObj( Title::makeTitle( NS_USER, $text ) );
161160 break;
162161 default:
163 - $titleLink = Linker::makeLinkObj( $title );
 162+ $titleLink = $skin->makeLinkObj( $title );
164163 }
 164+
 165+ } else {
 166+ $titleLink = $title->getPrefixedText();
165167 }
166168 if( $key == 'rights/rights' ) {
167 - if( $forContent ) {
 169+ if ($skin) {
 170+ $rightsnone = wfMsg( 'rightsnone' );
 171+ } else {
168172 $rightsnone = wfMsgForContent( 'rightsnone' );
169 - } else {
170 - $rightsnone = wfMsg( 'rightsnone' );
171173 }
172174 if( !isset( $params[0] ) || trim( $params[0] ) == '' )
173175 $params[0] = $rightsnone;
@@ -174,17 +176,17 @@
175177 $params[1] = $rightsnone;
176178 }
177179 if( count( $params ) == 0 ) {
178 - if ( $forContent ) {
 180+ if ( $skin ) {
 181+ $rv = wfMsg( $wgLogActions[$key], $titleLink );
 182+ } else {
179183 $rv = wfMsgForContent( $wgLogActions[$key], $titleLink );
180 - } else {
181 - $rv = wfMsg( $wgLogActions[$key], $titleLink );
182184 }
183185 } else {
184186 array_unshift( $params, $titleLink );
185187 if ( $translate && $key == 'block/block' ) {
186188 $params[1] = $wgLang->translateBlockExpiry($params[1]);
187189 }
188 - $rv = wfMsgReal( $wgLogActions[$key], $params, true, $forContent );
 190+ $rv = wfMsgReal( $wgLogActions[$key], $params, true, !$skin );
189191 }
190192 }
191193 } else {
@@ -192,8 +194,8 @@
193195 $rv = "$action";
194196 }
195197 if( $filterWikilinks ) {
196 - $rv = str_replace( '[[', '', $rv );
197 - $rv = str_replace( ']]', '', $rv );
 198+ $rv = str_replace( "[[", "", $rv );
 199+ $rv = str_replace( "]]", "", $rv );
198200 }
199201 return $rv;
200202 }
@@ -213,9 +215,9 @@
214216 $this->action = $action;
215217 $this->target = $target;
216218 $this->comment = $comment;
217 - $this->params = self::makeParamBlob( $params );
 219+ $this->params = LogPage::makeParamBlob( $params );
218220
219 - $this->actionText = self::actionText( $this->type, $action, $target, true, $params );
 221+ $this->actionText = LogPage::actionText( $this->type, $action, $target, NULL, $params );
220222
221223 return $this->saveContent();
222224 }
@@ -224,7 +226,7 @@
225227 * Create a blob from a parameter array
226228 * @static
227229 */
228 - static function makeParamBlob( $params ) {
 230+ function makeParamBlob( $params ) {
229231 return implode( "\n", $params );
230232 }
231233
@@ -232,7 +234,7 @@
233235 * Extract a parameter array from a blob
234236 * @static
235237 */
236 - static function extractParams( $blob ) {
 238+ function extractParams( $blob ) {
237239 if ( $blob === '' ) {
238240 return array();
239241 } else {
Index: trunk/phase3/includes/SpecialCategories.php
@@ -44,10 +44,10 @@
4545 return false;
4646 }
4747
48 - function formatResult( $result ) {
 48+ function formatResult( $skin, $result ) {
4949 global $wgLang;
5050 $title = Title::makeTitle( NS_CATEGORY, $result->title );
51 - $plink = Linker::makeLinkObj( $title, $title->getText() );
 51+ $plink = $skin->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/SpecialWantedcategories.php
@@ -55,15 +55,15 @@
5656 $db->dataSeek( $res, 0 );
5757 }
5858
59 - function formatResult( $result ) {
 59+ function formatResult( $skin, $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 - Linker::makeLinkObj( $nt, htmlspecialchars( $text ) ) :
67 - Linker::makeBrokenLinkObj( $nt, htmlspecialchars( $text ) );
 66+ $skin->makeLinkObj( $nt, htmlspecialchars( $text ) ) :
 67+ $skin->makeBrokenLinkObj( $nt, htmlspecialchars( $text ) );
6868
6969 $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
7070 $wgLang->formatNum( $result->value ) );
Index: trunk/phase3/includes/SpecialMostcategories.php
@@ -36,18 +36,18 @@
3737 ";
3838 }
3939
40 - function formatResult( $result ) {
 40+ function formatResult( $skin, $result ) {
4141 global $wgContLang, $wgLang;
4242
4343 $nt = Title::makeTitle( $result->namespace, $result->title );
4444 $text = $wgContLang->convert( $nt->getPrefixedText() );
4545
46 - $plink = Linker::makeKnownLink( $nt->getPrefixedText(), $text );
 46+ $plink = $skin->makeKnownLink( $nt->getPrefixedText(), $text );
4747
4848 $nl = wfMsgExt( 'ncategories', array( 'parsemag', 'escape' ),
4949 $wgLang->formatNum( $result->value ) );
5050
51 - $nlink = Linker::makeKnownLink( $wgContLang->specialPage( 'Categories' ),
 51+ $nlink = $skin->makeKnownLink( $wgContLang->specialPage( 'Categories' ),
5252 $nl, 'article=' . $nt->getPrefixedURL() );
5353
5454 return wfSpecialList($plink, $nlink);
Index: trunk/phase3/includes/SpecialStatistics.php
@@ -82,16 +82,17 @@
8383
8484 $wgOut->addWikiText( $text );
8585
86 - global $wgDisableCounters, $wgMiserMode, $wgLang, $wgContLang;
 86+ global $wgDisableCounters, $wgMiserMode, $wgUser, $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();
9394 $wgOut->addHtml( '<ol>' );
9495 while( $row = $dbr->fetchObject( $res ) ) {
95 - $link = Linker::makeKnownLinkObj( Title::makeTitleSafe( $row->page_namespace, $row->page_title ) );
 96+ $link = $skin->makeKnownLinkObj( Title::makeTitleSafe( $row->page_namespace, $row->page_title ) );
9697 $dirmark = $wgContLang->getDirMark();
9798 $wgOut->addHtml( '<li>' . $link . $dirmark . ' [' . $wgLang->formatNum( $row->page_counter ) . ']</li>' );
9899 }
Index: trunk/phase3/includes/SpecialContributions.php
@@ -291,8 +291,9 @@
292292
293293 $wgOut->addHTML( "<ul>\n" );
294294
 295+ $sk = $wgUser->getSkin();
295296 foreach ( $contribs as $contrib )
296 - $wgOut->addHTML( ucListEdit( $contrib ) );
 297+ $wgOut->addHTML( ucListEdit( $sk, $contrib ) );
297298
298299 $wgOut->addHTML( "</ul>\n" );
299300 $wgOut->addHTML( "<p>{$prevnextbits}</p>\n" );
@@ -305,26 +306,27 @@
306307 function contributionsSub( $nt ) {
307308 global $wgSysopUserBans, $wgLang, $wgUser;
308309
 310+ $sk = $wgUser->getSkin();
309311 $id = User::idFromName( $nt->getText() );
310312
311313 if ( 0 == $id ) {
312314 $ul = $nt->getText();
313315 } else {
314 - $ul = Linker::makeLinkObj( $nt, htmlspecialchars( $nt->getText() ) );
 316+ $ul = $sk->makeLinkObj( $nt, htmlspecialchars( $nt->getText() ) );
315317 }
316318 $talk = $nt->getTalkPage();
317319 if( $talk ) {
318320 # Talk page link
319 - $tools[] = Linker::makeLinkObj( $talk, $wgLang->getNsText( NS_TALK ) );
 321+ $tools[] = $sk->makeLinkObj( $talk, $wgLang->getNsText( NS_TALK ) );
320322 if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && User::isIP( $nt->getText() ) ) ) {
321323 # Block link
322324 if( $wgUser->isAllowed( 'block' ) )
323 - $tools[] = Linker::makeKnownLinkObj( SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ), wfMsgHtml( 'blocklink' ) );
 325+ $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ), wfMsgHtml( 'blocklink' ) );
324326 # Block log link
325 - $tools[] = Linker::makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), htmlspecialchars( LogPage::logName( 'block' ) ), 'type=block&page=' . $nt->getPrefixedUrl() );
 327+ $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), htmlspecialchars( LogPage::logName( 'block' ) ), 'type=block&page=' . $nt->getPrefixedUrl() );
326328 }
327329 # Other logs link
328 - $tools[] = Linker::makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsgHtml( 'log' ), 'user=' . $nt->getPartialUrl() );
 330+ $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsgHtml( 'log' ), 'user=' . $nt->getPartialUrl() );
329331 $ul .= ' (' . implode( ' | ', $tools ) . ')';
330332 }
331333 return $ul;
@@ -375,7 +377,7 @@
376378 *
377379 * @todo This would probably look a lot nicer in a table.
378380 */
379 -function ucListEdit( $row ) {
 381+function ucListEdit( $sk, $row ) {
380382 $fname = 'ucListEdit';
381383 wfProfileIn( $fname );
382384
@@ -390,12 +392,12 @@
391393 $rev = new Revision( $row );
392394
393395 $page = Title::makeTitle( $row->page_namespace, $row->page_title );
394 - $link = Linker::makeKnownLinkObj( $page );
 396+ $link = $sk->makeKnownLinkObj( $page );
395397 $difftext = $topmarktext = '';
396398 if( $row->rev_id == $row->page_latest ) {
397399 $topmarktext .= '<strong>' . $messages['uctop'] . '</strong>';
398400 if( !$row->page_is_new ) {
399 - $difftext .= '(' . Linker::makeKnownLinkObj( $page, $messages['diff'], 'diff=0' ) . ')';
 401+ $difftext .= '(' . $sk->makeKnownLinkObj( $page, $messages['diff'], 'diff=0' ) . ')';
400402 } else {
401403 $difftext .= $messages['newarticle'];
402404 }
@@ -404,20 +406,20 @@
405407 $extraRollback = $wgRequest->getBool( 'bot' ) ? '&bot=1' : '';
406408 $extraRollback .= '&token=' . urlencode(
407409 $wgUser->editToken( array( $page->getPrefixedText(), $row->rev_user_text ) ) );
408 - $topmarktext .= ' ['. Linker::makeKnownLinkObj( $page,
 410+ $topmarktext .= ' ['. $sk->makeKnownLinkObj( $page,
409411 $messages['rollbacklink'],
410412 'action=rollback&from=' . urlencode( $row->rev_user_text ) . $extraRollback ) .']';
411413 }
412414
413415 }
414416 if( $rev->userCan( Revision::DELETED_TEXT ) ) {
415 - $difftext = '(' . Linker::makeKnownLinkObj( $page, $messages['diff'], 'diff=prev&oldid='.$row->rev_id ) . ')';
 417+ $difftext = '(' . $sk->makeKnownLinkObj( $page, $messages['diff'], 'diff=prev&oldid='.$row->rev_id ) . ')';
416418 } else {
417419 $difftext = '(' . $messages['diff'] . ')';
418420 }
419 - $histlink = '(' . Linker::makeKnownLinkObj( $page, $messages['hist'], 'action=history' ) . ')';
 421+ $histlink='('.$sk->makeKnownLinkObj( $page, $messages['hist'], 'action=history' ) . ')';
420422
421 - $comment = Linker::revComment( $rev );
 423+ $comment = $sk->revComment( $rev );
422424 $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true );
423425
424426 if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
Index: trunk/phase3/includes/SpecialConfirmemail.php
@@ -38,7 +38,8 @@
3939 } else {
4040 $title = SpecialPage::getTitleFor( 'Userlogin' );
4141 $self = SpecialPage::getTitleFor( 'Confirmemail' );
42 - $llink = Linker::makeKnownLinkObj( $title, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $self->getPrefixedUrl() );
 42+ $skin = $wgUser->getSkin();
 43+ $llink = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $self->getPrefixedUrl() );
4344 $wgOut->addHtml( wfMsgWikiHtml( 'confirmemail_needlogin', $llink ) );
4445 }
4546 } else {
Index: trunk/phase3/includes/SpecialIpblocklist.php
@@ -234,8 +234,10 @@
235235
236236 wfProfileIn( __METHOD__ );
237237
238 - static $msg=null;
 238+ static $sk=null, $msg=null;
239239
 240+ if( is_null( $sk ) )
 241+ $sk = $wgUser->getSkin();
240242 if( is_null( $msg ) ) {
241243 $msg = array();
242244 $keys = array( 'infiniteblock', 'expiringblock', 'contribslink', 'unblocklink',
@@ -249,15 +251,15 @@
250252
251253 # Prepare links to the blocker's user and talk pages
252254 $blocker_name = $block->getByName();
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 ) ) . ')';
 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 ) ) . ')';
255257
256258 # Prepare links to the block target's user and contribs. pages (as applicable, don't do it for autoblocks)
257259 if( $block->mAuto ) {
258260 $target = $block->getRedactedName(); # Hide the IP addresses of auto-blocks; privacy
259261 } else {
260 - $target = Linker::makeLinkObj( Title::makeTitle( NS_USER, $block->mAddress ), $block->mAddress );
261 - $target .= ' (' . Linker::makeKnownLinkObj( SpecialPage::getSafeTitleFor( 'Contributions', $block->mAddress ), $msg['contribslink'] ) . ')';
 262+ $target = $sk->makeLinkObj( Title::makeTitle( NS_USER, $block->mAddress ), $block->mAddress );
 263+ $target .= ' (' . $sk->makeKnownLinkObj( SpecialPage::getSafeTitleFor( 'Contributions', $block->mAddress ), $msg['contribslink'] ) . ')';
262264 }
263265
264266 $formattedTime = $wgLang->timeanddate( $block->mTimestamp, true );
@@ -287,9 +289,9 @@
288290
289291 if ( $wgUser->isAllowed('block') ) {
290292 $titleObj = SpecialPage::getTitleFor( "Ipblocklist" );
291 - $s .= ' (' . Linker::makeKnownLinkObj($titleObj, $msg['unblocklink'], 'action=unblock&id=' . urlencode( $block->mId ) ) . ')';
 293+ $s .= ' (' . $sk->makeKnownLinkObj($titleObj, $msg['unblocklink'], 'action=unblock&id=' . urlencode( $block->mId ) ) . ')';
292294 }
293 - $s .= Linker::commentBlock( $block->mReason );
 295+ $s .= $sk->commentBlock( $block->mReason );
294296 $s .= "</li>\n";
295297 wfProfileOut( __METHOD__ );
296298 return $s;
Index: trunk/phase3/includes/SpecialMostlinkedcategories.php
@@ -53,13 +53,13 @@
5454 $db->dataSeek( $res, 0 );
5555 }
5656
57 - function formatResult( $result ) {
 57+ function formatResult( $skin, $result ) {
5858 global $wgLang, $wgContLang;
5959
6060 $nt = Title::makeTitle( $result->namespace, $result->title );
6161 $text = $wgContLang->convert( $nt->getText() );
6262
63 - $plink = Linker::makeLinkObj( $nt, htmlspecialchars( $text ) );
 63+ $plink = $skin->makeLinkObj( $nt, htmlspecialchars( $text ) );
6464
6565 $nlinks = wfMsgExt( 'nmembers', array( 'parsemag', 'escape'),
6666 $wgLang->formatNum( $result->value ) );
Index: trunk/phase3/includes/SpecialLog.php
@@ -218,6 +218,8 @@
219219 * @param LogReader &$reader where to get our data from
220220 */
221221 function LogViewer( &$reader ) {
 222+ global $wgUser;
 223+ $this->skin =& $wgUser->getSkin();
222224 $this->reader =& $reader;
223225 }
224226
@@ -314,15 +316,15 @@
315317 $linkCache->addBadLinkObj( $title );
316318 }
317319
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 );
 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 );
320322 $paramArray = LogPage::extractParams( $s->log_params );
321323 $revert = '';
322324 if ( $s->log_type == 'move' && isset( $paramArray[0] ) ) {
323325 $specialTitle = SpecialPage::getTitleFor( 'Movepage' );
324326 $destTitle = Title::newFromText( $paramArray[0] );
325327 if ( $destTitle ) {
326 - $revert = '(' . Linker::makeKnownLinkObj( $specialTitle, wfMsg( 'revertmove' ),
 328+ $revert = '(' . $this->skin->makeKnownLinkObj( $specialTitle, wfMsg( 'revertmove' ),
327329 'wpOldTitle=' . urlencode( $destTitle->getPrefixedDBkey() ) .
328330 '&wpNewTitle=' . urlencode( $title->getPrefixedDBkey() ) .
329331 '&wpReason=' . urlencode( wfMsgForContent( 'revertmove' ) ) .
@@ -330,7 +332,7 @@
331333 }
332334 }
333335
334 - $action = LogPage::actionText( $s->log_type, $s->log_action, $title, false, $paramArray, true, true );
 336+ $action = LogPage::actionText( $s->log_type, $s->log_action, $title, $this->skin, $paramArray, true, true );
335337 $out = "<li>$time $userLink $action $comment $revert</li>\n";
336338 return $out;
337339 }
Index: trunk/phase3/includes/SpecialRevisiondelete.php
@@ -10,11 +10,12 @@
1111 */
1212
1313 function wfSpecialRevisiondelete( $par = null ) {
14 - global $wgOut, $wgRequest;
 14+ global $wgOut, $wgRequest, $wgUser;
1515
1616 $target = $wgRequest->getVal( 'target' );
1717 $oldid = $wgRequest->getIntArray( 'oldid' );
1818
 19+ $sk = $wgUser->getSkin();
1920 $page = Title::newFromUrl( $target );
2021
2122 if( is_null( $page ) ) {
@@ -48,6 +49,7 @@
4950
5051 $this->revisions = $request->getIntArray( 'oldid', array() );
5152
 53+ $this->skin = $wgUser->getSkin();
5254 $this->checks = array(
5355 array( 'revdelete-hide-text', 'wpHideText', Revision::DELETED_TEXT ),
5456 array( 'revdelete-hide-comment', 'wpHideComment', Revision::DELETED_COMMENT ),
@@ -120,11 +122,11 @@
121123 $date = $wgContLang->timeanddate( $rev->getTimestamp() );
122124 return
123125 "<li>" .
124 - Linker::makeLinkObj( $this->page, $date, 'oldid=' . $rev->getId() ) .
 126+ $this->skin->makeLinkObj( $this->page, $date, 'oldid=' . $rev->getId() ) .
125127 " " .
126 - Linker::revUserLink( $rev ) .
 128+ $this->skin->revUserLink( $rev ) .
127129 " " .
128 - Linker::revComment( $rev ) .
 130+ $this->skin->revComment( $rev ) .
129131 "</li>";
130132 }
131133
Index: trunk/phase3/includes/SpecialDisambiguations.php
@@ -23,8 +23,11 @@
2424 return Title::makeTitleSafe( NS_MEDIAWIKI, 'disambiguationspage');
2525 }
2626
27 - function getPageHeader() {
28 - return '<p>'.wfMsg('disambiguationstext', Linker::makeKnownLinkObj($this->getDisambiguationPageObj()))."</p><br />\n";
 27+ function getPageHeader( ) {
 28+ global $wgUser;
 29+ $sk = $wgUser->getSkin();
 30+
 31+ return '<p>'.wfMsg('disambiguationstext', $sk->makeKnownLinkObj($this->getDisambiguationPageObj()))."</p><br />\n";
2932 }
3033
3134 function getSQL() {
@@ -85,15 +88,15 @@
8689 return '';
8790 }
8891
89 - function formatResult( $result ) {
 92+ function formatResult( $skin, $result ) {
9093 global $wgContLang;
9194 $title = Title::newFromId( $result->value );
9295 $dp = Title::makeTitle( $result->namespace, $result->title );
9396
94 - $from = Linker::makeKnownLinkObj( $title,'');
95 - $edit = Linker::makeBrokenLinkObj( $title, "(".wfMsg("qbedit").")" , 'redirect=no');
 97+ $from = $skin->makeKnownLinkObj( $title,'');
 98+ $edit = $skin->makeBrokenLinkObj( $title, "(".wfMsg("qbedit").")" , 'redirect=no');
9699 $arr = $wgContLang->getArrow();
97 - $to = Linker::makeKnownLinkObj( $dp,'');
 100+ $to = $skin->makeKnownLinkObj( $dp,'');
98101
99102 return "$from $edit $arr $to";
100103 }
Index: trunk/phase3/includes/SpecialAllpages.php
@@ -83,7 +83,8 @@
8484 * @param integer $namespace (default NS_MAIN)
8585 */
8686 function showToplevel ( $namespace = NS_MAIN, $including = false ) {
87 - global $wgOut;
 87+ global $wgOut, $wgUser;
 88+ $sk = $wgUser->getSkin();
8889 $fname = "indexShowToplevel";
8990
9091 # TODO: Either make this *much* faster or cache the title index points
@@ -184,6 +185,8 @@
185186 * @param integer $namespace (Default NS_MAIN)
186187 */
187188 function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) {
 189+ global $wgUser;
 190+ $sk = $wgUser->getSkin();
188191 $dbr =& wfGetDB( DB_SLAVE );
189192
190193 $inpointf = htmlspecialchars( str_replace( '_', ' ', $inpoint ) );
@@ -205,10 +208,12 @@
206209 * @param string $from list all pages from this name (default FALSE)
207210 */
208211 function showChunk( $namespace = NS_MAIN, $from, $including = false ) {
209 - global $wgOut, $wgContLang;
 212+ global $wgOut, $wgUser, $wgContLang;
210213
211214 $fname = 'indexShowChunk';
212215
 216+ $sk = $wgUser->getSkin();
 217+
213218 $fromList = $this->getNamespaceKeyAndText($namespace, $from);
214219
215220 if ( !$fromList ) {
@@ -241,7 +246,7 @@
242247 $t = Title::makeTitle( $s->page_namespace, $s->page_title );
243248 if( $t ) {
244249 $link = ($s->page_is_redirect ? '<div class="allpagesredirect">' : '' ) .
245 - Linker::makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) .
 250+ $sk->makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) .
246251 ($s->page_is_redirect ? '</div>' : '' );
247252 } else {
248253 $link = '[[' . htmlspecialchars( $s->page_title ) . ']]';
@@ -268,12 +273,12 @@
269274 $out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">';
270275 $out2 .= '<tr valign="top"><td align="left">' . $nsForm;
271276 $out2 .= '</td><td align="right" style="font-size: smaller; margin-bottom: 1em;">' .
272 - Linker::makeKnownLink( $wgContLang->specialPage( "Allpages" ),
 277+ $sk->makeKnownLink( $wgContLang->specialPage( "Allpages" ),
273278 wfMsgHtml ( 'allpages' ) );
274279 if ( isset($dbr) && $dbr && ($n == $this->maxPerPage) && ($s = $dbr->fetchObject( $res )) ) {
275280 $self = SpecialPage::getTitleFor( 'Allpages' );
276281 $q = 'from=' . $t->getPartialUrl() . ( $namespace ? '&namespace=' . $namespace : '' );
277 - $out2 .= ' | ' . Linker::makeKnownLinkObj( $self, wfMsgHtml( 'nextpage', $t->getText() ), $q );
 282+ $out2 .= ' | ' . $sk->makeKnownLinkObj( $self, wfMsgHtml( 'nextpage', $t->getText() ), $q );
278283 }
279284 $out2 .= "</td></tr></table><hr />";
280285 }
Index: trunk/phase3/includes/SpecialListusers.php
@@ -173,9 +173,9 @@
174174 return false;
175175 }
176176
177 - function formatResult( $result ) {
 177+ function formatResult( $skin, $result ) {
178178 $userPage = Title::makeTitle( $result->namespace, $result->title );
179 - $name = Linker::makeLinkObj( $userPage, htmlspecialchars( $userPage->getText() ) );
 179+ $name = $skin->makeLinkObj( $userPage, htmlspecialchars( $userPage->getText() ) );
180180 $groups = null;
181181
182182 if( !isset( $result->numgroups ) || $result->numgroups > 0 ) {
Index: trunk/phase3/includes/SpecialPreferences.php
@@ -506,8 +506,9 @@
507507 $disableEmailPrefs = false;
508508 } else {
509509 $disableEmailPrefs = true;
 510+ $skin = $wgUser->getSkin();
510511 $emailauthenticated = wfMsg('emailnotauthenticated').'<br />' .
511 - Linker::makeKnownLinkObj( SpecialPage::getTitleFor( 'Confirmemail' ),
 512+ $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Confirmemail' ),
512513 wfMsg( 'emailconfirmlink' ) );
513514 }
514515 } else {
Index: trunk/phase3/includes/QueryPage.php
@@ -156,11 +156,12 @@
157157 }
158158
159159 /**
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.
 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.
162163 * If the function return "false", the line output will be skipped.
163164 */
164 - function formatResult( $result ) {
 165+ function formatResult( $skin, $result ) {
165166 return '';
166167 }
167168
@@ -274,7 +275,7 @@
275276 * @param $shownavigation show navigation like "next 200"?
276277 */
277278 function doQuery( $offset, $limit, $shownavigation=true ) {
278 - global $wgOut, $wgLang, $wgContLang;
 279+ global $wgUser, $wgOut, $wgLang, $wgContLang;
279280
280281 $this->offset = $offset;
281282 $this->limit = $limit;
@@ -320,6 +321,8 @@
321322
322323 $this->preprocessResults( $dbr, $res );
323324
 325+ $sk = $wgUser->getSkin( );
 326+
324327 if($shownavigation) {
325328 $wgOut->addHTML( $this->getPageHeader() );
326329 $top = wfShowingResults( $offset, $num);
@@ -340,7 +343,7 @@
341344
342345 # Only read at most $num rows, because $res may contain the whole 1000
343346 for ( $i = 0; $i < $num && $obj = $dbr->fetchObject( $res ); $i++ ) {
344 - $format = $this->formatResult( $obj );
 347+ $format = $this->formatResult( $sk, $obj );
345348 if ( $format ) {
346349 $attr = ( isset ( $obj->usepatrol ) && $obj->usepatrol &&
347350 $obj->patrolled == 0 ) ? ' class="not-patrolled"' : '';
@@ -351,7 +354,7 @@
352355 if($this->tryLastResult()) {
353356 // flush the very last result
354357 $obj = null;
355 - $format = $this->formatResult( $obj );
 358+ $format = $this->formatResult( $sk, $obj );
356359 if( $format ) {
357360 $attr = ( isset ( $obj->usepatrol ) && $obj->usepatrol &&
358361 $obj->patrolled == 0 ) ? ' class="not-patrolled"' : '';
@@ -470,10 +473,10 @@
471474 */
472475 class PageQueryPage extends QueryPage {
473476
474 - function formatResult( $result ) {
 477+ function formatResult( $skin, $result ) {
475478 global $wgContLang;
476479 $nt = Title::makeTitle( $result->namespace, $result->title );
477 - return Linker::makeKnownLinkObj( $nt, htmlspecialchars( $wgContLang->convert( $nt->getPrefixedText() ) ) );
 480+ return $skin->makeKnownLinkObj( $nt, htmlspecialchars( $wgContLang->convert( $nt->getPrefixedText() ) ) );
478481 }
479482 }
480483
Index: trunk/phase3/includes/ChangesList.php
@@ -34,7 +34,8 @@
3535 #
3636
3737 /** @todo document */
38 - function ChangesList() {
 38+ function ChangesList( &$skin ) {
 39+ $this->skin =& $skin;
3940 $this->preCacheMessages();
4041 }
4142
@@ -46,9 +47,10 @@
4748 * @return ChangesList derivative
4849 */
4950 function newFromUser( &$user ) {
 51+ $sk =& $user->getSkin();
5052 $list = NULL;
51 - if( wfRunHooks( 'FetchChangesList', array( &$user, &$list ) ) ) {
52 - return $user->getOption( 'usenewrc' ) ? new EnhancedChangesList() : new OldChangesList();
 53+ if( wfRunHooks( 'FetchChangesList', array( &$user, &$skin, &$list ) ) ) {
 54+ return $user->getOption( 'usenewrc' ) ? new EnhancedChangesList( $sk ) : new OldChangesList( $sk );
5355 } else {
5456 return $list;
5557 }
@@ -110,13 +112,13 @@
111113 # Diff
112114 $s .= '(' . $this->message['diff'] . ') (';
113115 # Hist
114 - $s .= Linker::makeKnownLinkObj( $rc->getMovedToTitle(), $this->message['hist'], 'action=history' ) .
 116+ $s .= $this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), $this->message['hist'], 'action=history' ) .
115117 ') . . ';
116118
117119 # "[[x]] moved to [[y]]"
118120 $msg = ( $rc->mAttribs['rc_type'] == RC_MOVE ) ? '1movedto2' : '1movedto2_redir';
119 - $s .= wfMsg( $msg, Linker::makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
120 - Linker::makeKnownLinkObj( $rc->getMovedToTitle(), '' ) );
 121+ $s .= wfMsg( $msg, $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
 122+ $this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) );
121123 }
122124
123125 function insertDateHeader(&$s, $rc_timestamp) {
@@ -137,7 +139,7 @@
138140
139141 function insertLog(&$s, $title, $logtype) {
140142 $logname = LogPage::logName( $logtype );
141 - $s .= '(' . Linker::makeKnownLinkObj($title, $logname ) . ')';
 143+ $s .= '(' . $this->skin->makeKnownLinkObj($title, $logname ) . ')';
142144 }
143145
144146
@@ -149,7 +151,7 @@
150152 $rcidparam = $unpatrolled
151153 ? array( 'rcid' => $rc->mAttribs['rc_id'] )
152154 : array();
153 - $diffLink = Linker::makeKnownLinkObj( $rc->getTitle(), $this->message['diff'],
 155+ $diffLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['diff'],
154156 wfArrayToCGI( array(
155157 'curid' => $rc->mAttribs['rc_cur_id'],
156158 'diff' => $rc->mAttribs['rc_this_oldid'],
@@ -160,7 +162,7 @@
161163 $s .= '('.$diffLink.') (';
162164
163165 # History link
164 - $s .= Linker::makeKnownLinkObj( $rc->getTitle(), $this->message['hist'],
 166+ $s .= $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['hist'],
165167 wfArrayToCGI( array(
166168 'curid' => $rc->mAttribs['rc_cur_id'],
167169 'action' => 'history' ) ) );
@@ -174,7 +176,7 @@
175177 $params = ( $unpatrolled && $rc->mAttribs['rc_type'] == RC_NEW )
176178 ? 'rcid='.$rc->mAttribs['rc_id']
177179 : '';
178 - $articlelink = ' '. Linker::makeKnownLinkObj( $rc->getTitle(), '', $params );
 180+ $articlelink = ' '. $this->skin->makeKnownLinkObj( $rc->getTitle(), '', $params );
179181 if($watched) $articlelink = '<strong>'.$articlelink.'</strong>';
180182 global $wgContLang;
181183 $articlelink .= $wgContLang->getDirMark();
@@ -190,15 +192,15 @@
191193
192194 /** Insert links to user page, user talk page and eventually a blocking link */
193195 function insertUserRelatedLinks(&$s, &$rc) {
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'] );
 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'] );
196198 }
197199
198200 /** insert a formatted comment */
199201 function insertComment(&$s, &$rc) {
200202 # Add comment
201203 if( $rc->mAttribs['rc_type'] != RC_MOVE && $rc->mAttribs['rc_type'] != RC_MOVE_OVER_REDIRECT ) {
202 - $s .= Linker::commentBlock( $rc->mAttribs['rc_comment'], $rc->getTitle() );
 204+ $s .= $this->skin->commentBlock( $rc->mAttribs['rc_comment'], $rc->getTitle() );
203205 }
204206 }
205207
@@ -322,23 +324,23 @@
323325 # Make article link
324326 if( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
325327 $msg = ( $rc_type == RC_MOVE ) ? "1movedto2" : "1movedto2_redir";
326 - $clink = wfMsg( $msg, Linker::makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
327 - Linker::makeKnownLinkObj( $rc->getMovedToTitle(), '' ) );
 328+ $clink = wfMsg( $msg, $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
 329+ $this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) );
328330 } elseif( $rc_namespace == NS_SPECIAL ) {
329331 list( $specialName, $logtype ) = SpecialPage::resolveAliasWithSubpage( $rc_title );
330332 if ( $specialName == 'Log' ) {
331333 # Log updates, etc
332334 $logname = LogPage::logName( $logtype );
333 - $clink = '(' . Linker::makeKnownLinkObj( $rc->getTitle(), $logname ) . ')';
 335+ $clink = '(' . $this->skin->makeKnownLinkObj( $rc->getTitle(), $logname ) . ')';
334336 } else {
335337 wfDebug( "Unexpected special page in recentchanges\n" );
336338 $clink = '';
337339 }
338340 } elseif( $rc->unpatrolled && $rc_type == RC_NEW ) {
339341 # Unpatrolled new page, give rc_id in query
340 - $clink = Linker::makeKnownLinkObj( $rc->getTitle(), '', "rcid={$rc_id}" );
 342+ $clink = $this->skin->makeKnownLinkObj( $rc->getTitle(), '', "rcid={$rc_id}" );
341343 } else {
342 - $clink = Linker::makeKnownLinkObj( $rc->getTitle(), '' );
 344+ $clink = $this->skin->makeKnownLinkObj( $rc->getTitle(), '' );
343345 }
344346
345347 $time = $wgContLang->time( $rc_timestamp, true, true );
@@ -356,31 +358,31 @@
357359 $querycur = $curIdEq."&diff=0&oldid=$rc_this_oldid";
358360 $querydiff = $curIdEq."&diff=$rc_this_oldid&oldid=$rc_last_oldid$rcIdQuery";
359361 $aprops = ' tabindex="'.$baseRC->counter.'"';
360 - $curLink = Linker::makeKnownLinkObj( $rc->getTitle(), $this->message['cur'], $querycur, '' ,'', $aprops );
 362+ $curLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['cur'], $querycur, '' ,'', $aprops );
361363 if( $rc_type == RC_NEW || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
362364 if( $rc_type != RC_NEW ) {
363365 $curLink = $this->message['cur'];
364366 }
365367 $diffLink = $this->message['diff'];
366368 } else {
367 - $diffLink = Linker::makeKnownLinkObj( $rc->getTitle(), $this->message['diff'], $querydiff, '' ,'', $aprops );
 369+ $diffLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['diff'], $querydiff, '' ,'', $aprops );
368370 }
369371
370372 # Make "last" link
371373 if( $rc_last_oldid == 0 || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
372374 $lastLink = $this->message['last'];
373375 } else {
374 - $lastLink = Linker::makeKnownLinkObj( $rc->getTitle(), $this->message['last'],
 376+ $lastLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['last'],
375377 $curIdEq.'&diff='.$rc_this_oldid.'&oldid='.$rc_last_oldid . $rcIdQuery );
376378 }
377379
378 - $rc->userlink = Linker::userLink( $rc_user, $rc_user_text );
 380+ $rc->userlink = $this->skin->userLink( $rc_user, $rc_user_text );
379381
380382 $rc->lastlink = $lastLink;
381383 $rc->curlink = $curLink;
382384 $rc->difflink = $diffLink;
383385
384 - $rc->usertalklink = Linker::userToolLinks( $rc_user, $rc_user_text );
 386+ $rc->usertalklink = $this->skin->userToolLinks( $rc_user, $rc_user_text );
385387
386388 # Put accumulated information into the cache, for later display
387389 # Page moves go on their own line
@@ -470,13 +472,13 @@
471473 if( $isnew ) {
472474 $r .= $this->message['changes'];
473475 } else {
474 - $r .= Linker::makeKnownLinkObj( $block[0]->getTitle(),
 476+ $r .= $this->skin->makeKnownLinkObj( $block[0]->getTitle(),
475477 $this->message['changes'], $curIdEq."&diff=$currentRevision&oldid=$oldid" );
476478 }
477479 $r .= '; ';
478480
479481 # History
480 - $r .= Linker::makeKnownLinkObj( $block[0]->getTitle(),
 482+ $r .= $this->skin->makeKnownLinkObj( $block[0]->getTitle(),
481483 $this->message['history'], $curIdEq.'&action=history' );
482484 $r .= ')';
483485 }
@@ -507,7 +509,7 @@
508510 if( $rc_type == RC_LOG ) {
509511 $link = $rcObj->timestamp;
510512 } else {
511 - $link = Linker::makeKnownLinkObj( $rcObj->getTitle(), $rcObj->timestamp, $curIdEq.'&'.$o );
 513+ $link = $this->skin->makeKnownLinkObj( $rcObj->getTitle(), $rcObj->timestamp, $curIdEq.'&'.$o );
512514 }
513515 $link = '<tt>'.$link.'</tt>';
514516
@@ -518,7 +520,7 @@
519521 $r .= $rcObj->lastlink;
520522 $r .= ') . . '.$rcObj->userlink;
521523 $r .= $rcObj->usertalklink;
522 - $r .= Linker::commentBlock( $rc_comment, $rcObj->getTitle() );
 524+ $r .= $this->skin->commentBlock( $rc_comment, $rcObj->getTitle() );
523525 $r .= "<br />\n";
524526 }
525527 $r .= "</div>\n";
@@ -614,14 +616,14 @@
615617 $r .= ' ('. $rcObj->difflink .'; ';
616618
617619 # Hist
618 - $r .= Linker::makeKnownLinkObj( $rcObj->getTitle(), wfMsg( 'hist' ), $curIdEq.'&action=history' );
 620+ $r .= $this->skin->makeKnownLinkObj( $rcObj->getTitle(), wfMsg( 'hist' ), $curIdEq.'&action=history' );
619621
620622 # User/talk
621623 $r .= ') . . '.$rcObj->userlink . $rcObj->usertalklink;
622624
623625 # Comment
624626 if( $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) {
625 - $r .= Linker::commentBlock( $rc_comment, $rcObj->getTitle() );
 627+ $r .= $this->skin->commentBlock( $rc_comment, $rcObj->getTitle() );
626628 }
627629
628630 if( $rcObj->numberofWatchingusers > 0 ) {
Index: trunk/phase3/includes/SpecialShortpages.php
@@ -60,7 +60,7 @@
6161 return false;
6262 }
6363
64 - function formatResult( $result ) {
 64+ function formatResult( $skin, $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 = Linker::makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' );
 72+ $hlink = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' );
7373 $plink = $this->isCached()
74 - ? Linker::makeLinkObj( $title )
75 - : Linker::makeKnownLinkObj( $title );
 74+ ? $skin->makeLinkObj( $title )
 75+ : $skin->makeKnownLinkObj( $title );
7676 $size = wfMsgHtml( 'nbytes', $wgLang->formatNum( htmlspecialchars( $result->value ) ) );
7777
7878 return $title->exists()
Index: trunk/phase3/includes/SpecialListredirects.php
@@ -27,13 +27,13 @@
2828 return( $sql );
2929 }
3030
31 - function formatResult( $result ) {
 31+ function formatResult( $skin, $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 = Linker::makeKnownLinkObj( $rd_title, '', 'redirect=no' );
 37+ $rd_link = $skin->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 = Linker::makeLinkObj( $target );
 45+ $targetLink = $skin->makeLinkObj( $target );
4646 } else {
4747 /** @todo Put in some decent error display here */
4848 $targetLink = '*';
Index: trunk/phase3/includes/Article.php
@@ -613,6 +613,7 @@
614614 global $wgUser, $wgOut, $wgRequest, $wgContLang;
615615 global $wgEnableParserCache, $wgStylePath, $wgUseRCPatrol, $wgParser;
616616 global $wgUseTrackbacks, $wgNamespaceRobotPolicies;
 617+ $sk = $wgUser->getSkin();
617618
618619 wfProfileIn( __METHOD__ );
619620
@@ -692,7 +693,8 @@
693694 // This is an internally redirected page view.
694695 // We'll need a backlink to the source page for navigation.
695696 if ( wfRunHooks( 'ArticleViewRedirect', array( &$this ) ) ) {
696 - $redir = Linker::makeKnownLinkObj( $this->mRedirectedFrom, '', 'redirect=no' );
 697+ $sk = $wgUser->getSkin();
 698+ $redir = $sk->makeKnownLinkObj( $this->mRedirectedFrom, '', 'redirect=no' );
697699 $s = wfMsg( 'redirectedfrom', $redir );
698700 $wgOut->setSubtitle( $s );
699701 $wasRedirected = true;
@@ -702,7 +704,8 @@
703705 // If it was reported from a trusted site, supply a backlink.
704706 global $wgRedirectSources;
705707 if( $wgRedirectSources && preg_match( $wgRedirectSources, $rdfrom ) ) {
706 - $redir = Linker::makeExternalLink( $rdfrom, $rdfrom );
 708+ $sk = $wgUser->getSkin();
 709+ $redir = $sk->makeExternalLink( $rdfrom, $rdfrom );
707710 $s = wfMsg( 'redirectedfrom', $redir );
708711 $wgOut->setSubtitle( $s );
709712 $wasRedirected = true;
@@ -784,7 +787,7 @@
785788 $targetUrl = $rt->escapeLocalURL();
786789 # fixme unused $titleText :
787790 $titleText = htmlspecialchars( $rt->getPrefixedText() );
788 - $link = Linker::makeLinkObj( $rt );
 791+ $link = $sk->makeLinkObj( $rt );
789792
790793 $wgOut->addHTML( '<img src="'.$imageUrl.'" alt="#REDIRECT" />' .
791794 '<span class="redirectText">'.$link.'</span>' );
@@ -826,7 +829,7 @@
827830 $wgOut->addHTML(
828831 "<div class='patrollink'>" .
829832 wfMsg ( 'markaspatrolledlink',
830 - Linker::makeKnownLinkObj( $this->mTitle, wfMsg('markaspatrolledtext'), "action=markpatrolled&rcid=$rcid" )
 833+ $sk->makeKnownLinkObj( $this->mTitle, wfMsg('markaspatrolledtext'), "action=markpatrolled&rcid=$rcid" )
831834 ) .
832835 '</div>'
833836 );
@@ -2253,7 +2256,7 @@
22542257 * @param string $oldid Revision ID of this article revision
22552258 */
22562259 function setOldSubtitle( $oldid=0 ) {
2257 - global $wgLang, $wgOut;
 2260+ global $wgLang, $wgOut, $wgUser;
22582261
22592262 if ( !wfRunHooks( 'DisplayOldSubtitle', array(&$this, &$oldid) ) ) {
22602263 return;
@@ -2263,25 +2266,26 @@
22642267
22652268 $current = ( $oldid == $this->mLatest );
22662269 $td = $wgLang->timeanddate( $this->mTimestamp, true );
 2270+ $sk = $wgUser->getSkin();
22672271 $lnk = $current
22682272 ? wfMsg( 'currentrevisionlink' )
2269 - : $lnk = Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'currentrevisionlink' ) );
 2273+ : $lnk = $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'currentrevisionlink' ) );
22702274 $prev = $this->mTitle->getPreviousRevisionID( $oldid ) ;
22712275 $prevlink = $prev
2272 - ? Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'previousrevision' ), 'direction=prev&oldid='.$oldid )
 2276+ ? $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'previousrevision' ), 'direction=prev&oldid='.$oldid )
22732277 : wfMsg( 'previousrevision' );
22742278 $prevdiff = $prev
2275 - ? Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'diff' ), 'diff=prev&oldid='.$oldid )
 2279+ ? $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'diff' ), 'diff=prev&oldid='.$oldid )
22762280 : wfMsg( 'diff' );
22772281 $nextlink = $current
22782282 ? wfMsg( 'nextrevision' )
2279 - : Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'nextrevision' ), 'direction=next&oldid='.$oldid );
 2283+ : $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'nextrevision' ), 'direction=next&oldid='.$oldid );
22802284 $nextdiff = $current
22812285 ? wfMsg( 'diff' )
2282 - : Linker::makeKnownLinkObj( $this->mTitle, wfMsg( 'diff' ), 'diff=next&oldid='.$oldid );
 2286+ : $sk->makeKnownLinkObj( $this->mTitle, wfMsg( 'diff' ), 'diff=next&oldid='.$oldid );
22832287
2284 - $userlinks = Linker::userLink( $revision->getUser(), $revision->getUserText() )
2285 - . Linker::userToolLinks( $revision->getUser(), $revision->getUserText() );
 2288+ $userlinks = $sk->userLink( $revision->getUser(), $revision->getUserText() )
 2289+ . $sk->userToolLinks( $revision->getUser(), $revision->getUserText() );
22862290
22872291 $r = wfMsg( 'old-revision-navigation', $td, $lnk, $prevlink, $nextlink, $userlinks, $prevdiff, $nextdiff );
22882292 $wgOut->setSubtitle( $r );
Index: trunk/phase3/includes/Linker.php
@@ -16,20 +16,18 @@
1717 * @package MediaWiki
1818 */
1919 class Linker {
 20+
2021 function Linker() {}
2122
2223 /**
2324 * @deprecated
2425 */
25 - private static function postParseLinkColour( $s = NULL ) {
 26+ function postParseLinkColour( $s = NULL ) {
2627 return NULL;
2728 }
2829
29 - /**
30 - * @todo document
31 - * @static
32 - */
33 - public static function getExternalLinkAttributes( $link, $text, $class='' ) {
 30+ /** @todo document */
 31+ function getExternalLinkAttributes( $link, $text, $class='' ) {
3432 $link = htmlspecialchars( $link );
3533
3634 $r = ($class != '') ? " class=\"$class\"" : " class=\"external\"";
@@ -38,11 +36,7 @@
3937 return $r;
4038 }
4139
42 - /**
43 - * @todo document
44 - * @static
45 - */
46 - protected static function getInterwikiLinkAttributes( $link, $text, $class='' ) {
 40+ function getInterwikiLinkAttributes( $link, $text, $class='' ) {
4741 global $wgContLang;
4842
4943 $same = ($link == $text);
@@ -57,12 +51,8 @@
5852 return $r;
5953 }
6054
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 ) {
 55+ /** @todo document */
 56+ function getInternalLinkAttributes( $link, $text, $broken = false ) {
6757 $link = urldecode( $link );
6858 $link = str_replace( '_', ' ', $link );
6959 $link = htmlspecialchars( $link );
@@ -80,13 +70,11 @@
8171 }
8272
8373 /**
84 - * @param $nt Title object
85 - * @param $text String FIXME
86 - * @param $broken String FIXME, default false
87 - *
88 - * @static
 74+ * @param $nt Title object.
 75+ * @param $text String: FIXME
 76+ * @param $broken Boolean: FIXME, default 'false'.
8977 */
90 - protected static function getInternalLinkAttributesObj( &$nt, $text, $broken = false ) {
 78+ function getInternalLinkAttributesObj( &$nt, $text, $broken = false ) {
9179 if( $broken == 'stub' ) {
9280 $r = ' class="stub"';
9381 } else if ( $broken == 'yes' ) {
@@ -102,24 +90,22 @@
10391 /**
10492 * This function is a shortcut to makeLinkObj(Title::newFromText($title),...). Do not call
10593 * it if you already have a title object handy. See makeLinkObj for further documentation.
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
 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
11199 * be included in the link text. Other characters will be appended after
112100 * the end of the link.
113 - *
114 - * @static
115101 */
116 - public static function makeLink( $title, $text = '', $query = '', $trail = '' ) {
 102+ function makeLink( $title, $text = '', $query = '', $trail = '' ) {
117103 wfProfileIn( 'Linker::makeLink' );
118104 $nt = Title::newFromText( $title );
119105 if ($nt) {
120 - $result = self::makeLinkObj( $nt, $text, $query, $trail );
 106+ $result = $this->makeLinkObj( Title::newFromText( $title ), $text, $query, $trail );
121107 } else {
122 - wfDebug( "Invalid title passed to Linker::makeLink(): \"$title\"\n" );
123 - $result = $text == '' ? $title : $text;
 108+ wfDebug( 'Invalid title passed to Linker::makeLink(): "'.$title."\"\n" );
 109+ $result = $text == "" ? $title : $text;
124110 }
125111
126112 wfProfileOut( 'Linker::makeLink' );
@@ -130,21 +116,19 @@
131117 * This function is a shortcut to makeKnownLinkObj(Title::newFromText($title),...). Do not call
132118 * it if you already have a title object handy. See makeKnownLinkObj for further documentation.
133119 *
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
 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
138124 * be included in the link text. Other characters will be appended after
139125 * the end of the link.
140 - *
141 - * @static
142126 */
143 - public static function makeKnownLink( $title, $text = '', $query = '', $trail = '', $prefix = '',$aprops = '') {
 127+ function makeKnownLink( $title, $text = '', $query = '', $trail = '', $prefix = '',$aprops = '') {
144128 $nt = Title::newFromText( $title );
145129 if ($nt) {
146 - return self::makeKnownLinkObj( Title::newFromText( $title ), $text, $query, $trail, $prefix, $aprops );
 130+ return $this->makeKnownLinkObj( Title::newFromText( $title ), $text, $query, $trail, $prefix , $aprops );
147131 } else {
148 - wfDebug( "Invalid title passed to Linker::makeKnownLink(): \"$title\"\n" );
 132+ wfDebug( 'Invalid title passed to Linker::makeKnownLink(): "'.$title."\"\n" );
149133 return $text == '' ? $title : $text;
150134 }
151135 }
@@ -153,21 +137,19 @@
154138 * This function is a shortcut to makeBrokenLinkObj(Title::newFromText($title),...). Do not call
155139 * it if you already have a title object handy. See makeBrokenLinkObj for further documentation.
156140 *
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
 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
161145 * be included in the link text. Other characters will be appended after
162146 * the end of the link.
163 - *
164 - * @static
165147 */
166 - public static function makeBrokenLink( $title, $text = '', $query = '', $trail = '' ) {
 148+ function makeBrokenLink( $title, $text = '', $query = '', $trail = '' ) {
167149 $nt = Title::newFromText( $title );
168150 if ($nt) {
169 - return self::makeBrokenLinkObj( Title::newFromText( $title ), $text, $query, $trail );
 151+ return $this->makeBrokenLinkObj( Title::newFromText( $title ), $text, $query, $trail );
170152 } else {
171 - wfDebug( "Invalid title passed to Linker::makeBrokenLink(): \"$title\"\n" );
 153+ wfDebug( 'Invalid title passed to Linker::makeBrokenLink(): "'.$title."\"\n" );
172154 return $text == '' ? $title : $text;
173155 }
174156 }
@@ -176,21 +158,19 @@
177159 * This function is a shortcut to makeStubLinkObj(Title::newFromText($title),...). Do not call
178160 * it if you already have a title object handy. See makeStubLinkObj for further documentation.
179161 *
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
 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
184166 * be included in the link text. Other characters will be appended after
185167 * the end of the link.
186 - *
187 - * @static
188168 */
189 - public static function makeStubLink( $title, $text = '', $query = '', $trail = '' ) {
 169+ function makeStubLink( $title, $text = '', $query = '', $trail = '' ) {
190170 $nt = Title::newFromText( $title );
191171 if ($nt) {
192 - return self::makeStubLinkObj( Title::newFromText( $title ), $text, $query, $trail );
 172+ return $this->makeStubLinkObj( Title::newFromText( $title ), $text, $query, $trail );
193173 } else {
194 - wfDebug( "Invalid title passed to Linker::makeStubLink(): \"$title\"\n" );
 174+ wfDebug( 'Invalid title passed to Linker::makeStubLink(): "'.$title."\"\n" );
195175 return $text == '' ? $title : $text;
196176 }
197177 }
@@ -200,22 +180,22 @@
201181 * call this lots of times, pre-fill the link cache with a LinkBatch, otherwise each
202182 * call to this will result in a DB query.
203183 *
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
 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.
212192 */
213 - public static function makeLinkObj( $nt, $text= '', $query = '', $trail = '', $prefix = '' ) {
 193+ function makeLinkObj( $nt, $text= '', $query = '', $trail = '', $prefix = '' ) {
214194 global $wgUser;
215195 $fname = 'Linker::makeLinkObj';
216196 wfProfileIn( $fname );
217197
218198 # Fail gracefully
219 - if ( !is_object($nt) ) {
 199+ if ( ! is_object($nt) ) {
220200 # throw new MWException();
221201 wfProfileOut( $fname );
222202 return "<!-- ERROR -->{$prefix}{$text}{$trail}";
@@ -227,7 +207,7 @@
228208 $u = $nt->getFullURL();
229209 $link = $nt->getPrefixedURL();
230210 if ( '' == $text ) { $text = $nt->getPrefixedText(); }
231 - $style = self::getInterwikiLinkAttributes( $link, $text, 'extiw' );
 211+ $style = $this->getInterwikiLinkAttributes( $link, $text, 'extiw' );
232212
233213 $inside = '';
234214 if ( '' != $trail ) {
@@ -238,6 +218,7 @@
239219 }
240220
241221 # Check for anchors, normalize the anchor
 222+
242223 $parts = explode( '#', $u, 2 );
243224 if ( count( $parts ) == 2 ) {
244225 $anchor = urlencode( Sanitizer::decodeCharReferences( str_replace(' ', '_', $parts[1] ) ) );
@@ -257,13 +238,13 @@
258239 return $t;
259240 } elseif ( $nt->isAlwaysKnown() ) {
260241 # Image links, special page links and self-links with fragements are always known.
261 - $retVal = self::makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
 242+ $retVal = $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
262243 } else {
263244 wfProfileIn( $fname.'-immediate' );
264245 # Work out link colour immediately
265246 $aid = $nt->getArticleID() ;
266247 if ( 0 == $aid ) {
267 - $retVal = self::makeBrokenLinkObj( $nt, $text, $query, $trail, $prefix );
 248+ $retVal = $this->makeBrokenLinkObj( $nt, $text, $query, $trail, $prefix );
268249 } else {
269250 $threshold = $wgUser->getOption('stubthreshold') ;
270251 if ( $threshold > 0 ) {
@@ -286,9 +267,9 @@
287268 $size = 1 ;
288269 }
289270 if ( $size < $threshold ) {
290 - $retVal = self::makeStubLinkObj( $nt, $text, $query, $trail, $prefix );
 271+ $retVal = $this->makeStubLinkObj( $nt, $text, $query, $trail, $prefix );
291272 } else {
292 - $retVal = self::makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
 273+ $retVal = $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
293274 }
294275 }
295276 wfProfileOut( $fname.'-immediate' );
@@ -301,19 +282,18 @@
302283 * Make a link for a title which definitely exists. This is faster than makeLinkObj because
303284 * it doesn't have to do a database query. It's also valid for interwiki titles and special
304285 * pages.
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
 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
316295 */
317 - public static function makeKnownLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '', $style = '' ) {
 296+ function makeKnownLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '', $style = '' ) {
 297+
318298 $fname = 'Linker::makeKnownLinkObj';
319299 wfProfileIn( $fname );
320300
@@ -341,12 +321,12 @@
342322 $text = htmlspecialchars( $nt->getPrefixedText() );
343323 }
344324 if ( $style == '' ) {
345 - $style = self::getInternalLinkAttributesObj( $nt, $text );
 325+ $style = $this->getInternalLinkAttributesObj( $nt, $text );
346326 }
347327
348328 if ( $aprops !== '' ) $aprops = ' ' . $aprops;
349329
350 - list( $inside, $trail ) = self::splitTrail( $trail );
 330+ list( $inside, $trail ) = Linker::splitTrail( $trail );
351331 $r = "<a href=\"{$u}\"{$style}{$aprops}>{$prefix}{$text}{$inside}</a>{$trail}";
352332 wfProfileOut( $fname );
353333 return $r;
@@ -355,18 +335,16 @@
356336 /**
357337 * Make a red link to the edit page of a given title.
358338 *
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
 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
363343 * be included in the link text. Other characters will be appended after
364344 * the end of the link.
365 - *
366 - * @static
367345 */
368 - public static function makeBrokenLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
 346+ function makeBrokenLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
369347 # Fail gracefully
370 - if ( !isset($nt) ) {
 348+ if ( ! isset($nt) ) {
371349 # throw new MWException();
372350 return "<!-- ERROR -->{$prefix}{$text}{$trail}";
373351 }
@@ -384,9 +362,9 @@
385363 if ( '' == $text ) {
386364 $text = htmlspecialchars( $nt->getPrefixedText() );
387365 }
388 - $style = self::getInternalLinkAttributesObj( $nt, $text, 'yes' );
 366+ $style = $this->getInternalLinkAttributesObj( $nt, $text, "yes" );
389367
390 - list( $inside, $trail ) = self::splitTrail( $trail );
 368+ list( $inside, $trail ) = Linker::splitTrail( $trail );
391369 $s = "<a href=\"{$u}\"{$style}>{$prefix}{$text}{$inside}</a>{$trail}";
392370
393371 wfProfileOut( $fname );
@@ -396,16 +374,14 @@
397375 /**
398376 * Make a brown link to a short article.
399377 *
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
 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
404382 * be included in the link text. Other characters will be appended after
405383 * the end of the link.
406 - *
407 - * @static
408384 */
409 - public static function makeStubLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
 385+ function makeStubLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
410386 $link = $nt->getPrefixedURL();
411387
412388 $u = $nt->escapeLocalURL( $query );
@@ -413,9 +389,9 @@
414390 if ( '' == $text ) {
415391 $text = htmlspecialchars( $nt->getPrefixedText() );
416392 }
417 - $style = self::getInternalLinkAttributesObj( $nt, $text, 'stub' );
 393+ $style = $this->getInternalLinkAttributesObj( $nt, $text, 'stub' );
418394
419 - list( $inside, $trail ) = self::splitTrail( $trail );
 395+ list( $inside, $trail ) = Linker::splitTrail( $trail );
420396 $s = "<a href=\"{$u}\"{$style}>{$prefix}{$text}{$inside}</a>{$trail}";
421397 return $s;
422398 }
@@ -423,47 +399,40 @@
424400 /**
425401 * Generate either a normal exists-style link or a stub link, depending
426402 * on the given page size.
427 - *
 403+ *
428404 * @param $size Integer
429 - * @param $nt Title object
 405+ * @param $nt Title object.
430406 * @param $text String
431407 * @param $query String
432408 * @param $trail String
433409 * @param $prefix String
434 - * @return String HTML of link
435 - *
436 - * @static
 410+ * @return string HTML of link
437411 */
438 - public static function makeSizeLinkObj( $size, $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
 412+ function makeSizeLinkObj( $size, $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
439413 global $wgUser;
440414 $threshold = intval( $wgUser->getOption( 'stubthreshold' ) );
441415 if( $size < $threshold ) {
442 - return self::makeStubLinkObj( $nt, $text, $query, $trail, $prefix );
 416+ return $this->makeStubLinkObj( $nt, $text, $query, $trail, $prefix );
443417 } else {
444 - return self::makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
 418+ return $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
445419 }
446420 }
447421
448 - /**
 422+ /**
449423 * Make appropriate markup for a link to the current article. This is currently rendered
450424 * as the bold link text. The calling sequence is the same as the other make*LinkObj functions,
451425 * despite $query not being used.
452 - *
453 - * @static
454426 */
455 - public static function makeSelfLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
 427+ function makeSelfLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
456428 if ( '' == $text ) {
457429 $text = htmlspecialchars( $nt->getPrefixedText() );
458430 }
459 - list( $inside, $trail ) = self::splitTrail( $trail );
 431+ list( $inside, $trail ) = Linker::splitTrail( $trail );
460432 return "<strong class=\"selflink\">{$prefix}{$text}{$inside}</strong>{$trail}";
461433 }
462434
463 - /**
464 - * @todo document
465 - * @static
466 - */
467 - public static function fnamePart( $url ) {
 435+ /** @todo document */
 436+ function fnamePart( $url ) {
468437 $basename = strrchr( $url, '/' );
469438 if ( false === $basename ) {
470439 $basename = $url;
@@ -473,66 +442,62 @@
474443 return htmlspecialchars( $basename );
475444 }
476445
477 - /**
478 - * @deprecated Obsolete alias
479 - */
480 - private static function makeImage( $url, $alt = '' ) {
481 - return self::makeExternalImage( $url, $alt );
 446+ /** Obsolete alias */
 447+ function makeImage( $url, $alt = '' ) {
 448+ return $this->makeExternalImage( $url, $alt );
482449 }
483450
484 - /**
485 - * @todo document
486 - * @static
487 - */
488 - public static function makeExternalImage( $url, $alt = '' ) {
 451+ /** @todo document */
 452+ function makeExternalImage( $url, $alt = '' ) {
489453 if ( '' == $alt ) {
490 - $alt = self::fnamePart( $url );
 454+ $alt = $this->fnamePart( $url );
491455 }
492456 $s = '<img src="'.$url.'" alt="'.$alt.'" />';
493457 return $s;
494458 }
495459
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 ) {
 460+ /** @todo document */
 461+ function makeImageLinkObj( $nt, $label, $alt, $align = '', $width = false, $height = false, $framed = false,
 462+ $thumb = false, $manual_thumb = '', $page = null )
 463+ {
502464 global $wgContLang, $wgUser, $wgThumbLimits, $wgGenerateThumbnailOnParse;
503465
504 - $img = new Image( $nt );
 466+ $img = new Image( $nt );
505467
506 - if ( !is_null( $page ) ) {
 468+ if ( ! is_null( $page ) ) {
507469 $img->selectPage( $page );
508470 }
509471
510472 if ( !$img->allowInlineDisplay() && $img->exists() ) {
511 - return self::makeKnownLinkObj( $nt );
 473+ return $this->makeKnownLinkObj( $nt );
512474 }
513475
514 - $url = $img->getViewURL();
 476+ $url = $img->getViewURL();
515477 $error = $prefix = $postfix = '';
516478
517479 wfDebug( "makeImageLinkObj: '$width'x'$height', \"$label\"\n" );
518480
519 - if ( 'center' == $align ) {
 481+ if ( 'center' == $align )
 482+ {
520483 $prefix = '<div class="center">';
521484 $postfix = '</div>';
522485 $align = 'none';
523486 }
524487
525488 if ( $thumb || $framed ) {
 489+
526490 # Create a thumbnail. Alignment depends on language
527 - # writing direction: right-aligned for left-to-right-
 491+ # writing direction, # right aligned for left-to-right-
528492 # languages ("Western languages"), left-aligned
529493 # for right-to-left-languages ("Semitic languages")
530494 #
531 - # If thumbnail width has not been provided, it is set
 495+ # If thumbnail width has not been provided, it is set
532496 # to the default user option as specified in Language*.php
533497 if ( $align == '' ) {
534498 $align = $wgContLang->isRTL() ? 'left' : 'right';
535499 }
536500
 501+
537502 if ( $width === false ) {
538503 $wopt = $wgUser->getOption( 'thumbsize' );
539504
@@ -543,12 +508,14 @@
544509 $width = min( $img->getWidth(), $wgThumbLimits[$wopt] );
545510 }
546511
547 - return $prefix.self::makeThumbLinkObj( $img, $label, $alt, $align, $width, $height, $framed, $manual_thumb ).$postfix;
 512+ return $prefix.$this->makeThumbLinkObj( $img, $label, $alt, $align, $width, $height, $framed, $manual_thumb ).$postfix;
548513 }
549514
550515 if ( $width && $img->exists() ) {
 516+
551517 # Create a resized image, without the additional thumbnail
552518 # features
 519+
553520 if ( $height == false )
554521 $height = -1;
555522 if ( $manual_thumb == '') {
@@ -582,7 +549,7 @@
583550 if ( $error ) {
584551 $s = $error;
585552 } elseif ( $url == '' ) {
586 - $s = self::makeBrokenImageLinkObj( $img->getTitle() );
 553+ $s = $this->makeBrokenImageLinkObj( $img->getTitle() );
587554 //$s .= "<br />{$alt}<br />{$url}<br />\n";
588555 } else {
589556 $s = '<a href="'.$u.'" class="image" title="'.$alt.'">' .
@@ -601,10 +568,8 @@
602569 /**
603570 * Make HTML for a thumbnail including image, border and caption
604571 * $img is an Image object
605 - *
606 - * @static
607572 */
608 - public static function makeThumbLinkObj( $img, $label = '', $alt, $align = 'right', $boxwidth = 180, $boxheight=false, $framed=false , $manual_thumb = "" ) {
 573+ function makeThumbLinkObj( $img, $label = '', $alt, $align = 'right', $boxwidth = 180, $boxheight=false, $framed=false , $manual_thumb = "" ) {
609574 global $wgStylePath, $wgContLang, $wgGenerateThumbnailOnParse;
610575 $thumbUrl = '';
611576 $error = '';
@@ -641,17 +606,19 @@
642607 }
643608 $oboxwidth = $boxwidth + 2;
644609
645 - if ( $manual_thumb != '' ) { # Use manually specified thumbnail
 610+ if ( $manual_thumb != '' ) # Use manually specified thumbnail
 611+ {
646612 $manual_title = Title::makeTitleSafe( NS_IMAGE, $manual_thumb ); #new Title ( $manual_thumb ) ;
647613 if( $manual_title ) {
648614 $manual_img = new Image( $manual_title );
649615 $thumbUrl = $manual_img->getViewURL();
650 - if ( $manual_img->exists() ) {
 616+ if ( $manual_img->exists() )
 617+ {
651618 $width = $manual_img->getWidth();
652619 $height = $manual_img->getHeight();
653 - $boxwidth = $width;
654 - $boxheight = $height;
655 - $oboxwidth = $boxwidth + 2;
 620+ $boxwidth = $width ;
 621+ $boxheight = $height ;
 622+ $oboxwidth = $boxwidth + 2 ;
656623 }
657624 }
658625 }
@@ -671,7 +638,7 @@
672639 $s .= htmlspecialchars( $error );
673640 $zoomicon = '';
674641 } elseif( !$img->exists() ) {
675 - $s .= self::makeBrokenImageLinkObj( $img->getTitle() );
 642+ $s .= $this->makeBrokenImageLinkObj( $img->getTitle() );
676643 $zoomicon = '';
677644 } else {
678645 $s .= '<a href="'.$u.'" class="internal" title="'.$alt.'">'.
@@ -693,12 +660,10 @@
694661
695662 /**
696663 * Pass a title object, not a title string
697 - *
698 - * @static
699664 */
700 - public static function makeBrokenImageLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
 665+ function makeBrokenImageLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
701666 # Fail gracefully
702 - if ( !isset($nt) ) {
 667+ if ( ! isset($nt) ) {
703668 # throw new MWException();
704669 return "<!-- ERROR -->{$prefix}{$text}{$trail}";
705670 }
@@ -716,34 +681,33 @@
717682 if ( '' == $text ) {
718683 $text = htmlspecialchars( $nt->getPrefixedText() );
719684 }
720 - $style = self::getInternalLinkAttributesObj( $nt, $text, 'yes' );
721 - list( $inside, $trail ) = self::splitTrail( $trail );
 685+ $style = $this->getInternalLinkAttributesObj( $nt, $text, "yes" );
 686+ list( $inside, $trail ) = Linker::splitTrail( $trail );
722687 $s = "<a href=\"{$url}\"{$style}>{$prefix}{$text}{$inside}</a>{$trail}";
723688
724689 wfProfileOut( $fname );
725690 return $s;
726691 }
727692
728 - /**
729 - * @todo document
730 - * @static
731 - */
732 - public static function makeMediaLink( $name, /* wtf?! */ $url, $alt = '' ) {
 693+ /** @todo document */
 694+ function makeMediaLink( $name, /* wtf?! */ $url, $alt = '' ) {
733695 $nt = Title::makeTitleSafe( NS_IMAGE, $name );
734 - return self::makeMediaLinkObj( $nt, $alt );
 696+ return $this->makeMediaLinkObj( $nt, $alt );
735697 }
736698
737699 /**
738700 * Create a direct link to a given uploaded file.
739 - *
740 - * @param $title Title object
741 - * @param $text String pre-sanitized HTML
742 - * @return String HTML
743 - *
744 - * @static
 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
745709 * @todo Handle invalid or missing images better.
746710 */
747 - public static function makeMediaLinkObj( $title, $text = '' ) {
 711+ function makeMediaLinkObj( $title, $text = '' ) {
748712 if( is_null( $title ) ) {
749713 ### HOTFIX. Instead of breaking, return empty string.
750714 return $text;
@@ -767,24 +731,19 @@
768732 }
769733 }
770734
771 - /**
772 - * @todo document
773 - * @static
774 - */
775 - public static function specialLink( $name, $key = '' ) {
 735+ /** @todo document */
 736+ function specialLink( $name, $key = '' ) {
776737 global $wgContLang;
777738
778739 if ( '' == $key ) { $key = strtolower( $name ); }
779740 $pn = $wgContLang->ucfirst( $name );
780 - return self::makeKnownLink( $wgContLang->specialPage( $pn ), wfMsg( $key ) );
 741+ return $this->makeKnownLink( $wgContLang->specialPage( $pn ),
 742+ wfMsg( $key ) );
781743 }
782744
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 );
 745+ /** @todo document */
 746+ function makeExternalLink( $url, $text, $escape = true, $linktype = '', $ns = null ) {
 747+ $style = $this->getExternalLinkAttributes( $url, $text, 'external ' . $linktype );
789748 global $wgNoFollowLinks, $wgNoFollowNsExceptions;
790749 if( $wgNoFollowLinks && !(isset($ns) && in_array($ns, $wgNoFollowNsExceptions)) ) {
791750 $style .= ' rel="nofollow"';
@@ -798,47 +757,45 @@
799758
800759 /**
801760 * Make user link (or user contributions for unregistered users)
802 - * @param $userId Integer user id in database
803 - * @param $userText String user name in database
804 - * @return String HTML fragment
805 - *
806 - * @static
 761+ * @param $userId Integer: user id in database.
 762+ * @param $userText String: user name in database
 763+ * @return string HTML fragment
 764+ * @private
807765 */
808 - public static function userLink( $userId, $userText ) {
 766+ function userLink( $userId, $userText ) {
809767 $encName = htmlspecialchars( $userText );
810768 if( $userId == 0 ) {
811769 $contribsPage = SpecialPage::getTitleFor( 'Contributions' );
812 - return self::makeKnownLinkObj( $contribsPage,
 770+ return $this->makeKnownLinkObj( $contribsPage,
813771 $encName, 'target=' . urlencode( $userText ) );
814772 } else {
815773 $userPage = Title::makeTitle( NS_USER, $userText );
816 - return self::makeLinkObj( $userPage, $encName );
 774+ return $this->makeLinkObj( $userPage, $encName );
817775 }
818776 }
819777
820778 /**
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
 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
826783 */
827 - public static function userToolLinks( $userId, $userText ) {
 784+ function userToolLinks( $userId, $userText ) {
828785 global $wgUser, $wgDisableAnonTalk, $wgSysopUserBans;
829786 $talkable = !( $wgDisableAnonTalk && 0 == $userId );
830787 $blockable = ( $wgSysopUserBans || 0 == $userId );
831788
832789 $items = array();
833790 if( $talkable ) {
834 - $items[] = self::userTalkLink( $userId, $userText );
 791+ $items[] = $this->userTalkLink( $userId, $userText );
835792 }
836793 if( $userId ) {
837794 $contribsPage = SpecialPage::getTitleFor( 'Contributions' );
838 - $items[] = self::makeKnownLinkObj( $contribsPage,
 795+ $items[] = $this->makeKnownLinkObj( $contribsPage,
839796 wfMsgHtml( 'contribslink' ), 'target=' . urlencode( $userText ) );
840797 }
841798 if( $blockable && $wgUser->isAllowed( 'block' ) ) {
842 - $items[] = self::blockLink( $userId, $userText );
 799+ $items[] = $this->blockLink( $userId, $userText );
843800 }
844801
845802 if( $items ) {
@@ -849,45 +806,41 @@
850807 }
851808
852809 /**
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
 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
858814 */
859 - public static function userTalkLink( $userId, $userText ) {
 815+ function userTalkLink( $userId, $userText ) {
860816 global $wgLang;
861817 $talkname = $wgLang->getNsText( NS_TALK ); # use the shorter name
862818
863819 $userTalkPage = Title::makeTitle( NS_USER_TALK, $userText );
864 - $userTalkLink = self::makeLinkObj( $userTalkPage, $talkname );
 820+ $userTalkLink = $this->makeLinkObj( $userTalkPage, $talkname );
865821 return $userTalkLink;
866822 }
867823
868824 /**
869 - * @param $userId Integer userid
870 - * @param $userText String user name in database
 825+ * @param $userId Integer: userid
 826+ * @param $userText String: user name in database.
871827 * @return string HTML fragment with block link
872 - *
873 - * @static
 828+ * @private
874829 */
875 - public static function blockLink( $userId, $userText ) {
 830+ function blockLink( $userId, $userText ) {
876831 $blockPage = SpecialPage::getTitleFor( 'Blockip' );
877 - $blockLink = self::makeKnownLinkObj( $blockPage,
 832+ $blockLink = $this->makeKnownLinkObj( $blockPage,
878833 wfMsgHtml( 'blocklink' ), 'ip=' . urlencode( $userText ) );
879834 return $blockLink;
880835 }
881 -
 836+
882837 /**
883838 * Generate a user link if the current user is allowed to view it
884 - * @param $rev Revision object
 839+ * @param $rev Revision object.
885840 * @return string HTML
886 - *
887 - * @static
888841 */
889 - public static function revUserLink( $rev ) {
 842+ function revUserLink( $rev ) {
890843 if( $rev->userCan( Revision::DELETED_USER ) ) {
891 - $link = self::userLink( $rev->getRawUser(), $rev->getRawUserText() );
 844+ $link = $this->userLink( $rev->getRawUser(), $rev->getRawUserText() );
892845 } else {
893846 $link = wfMsgHtml( 'rev-deleted-user' );
894847 }
@@ -899,16 +852,14 @@
900853
901854 /**
902855 * Generate a user tool link cluster if the current user is allowed to view it
903 - * @param $rev Revision object
 856+ * @param $rev Revision object.
904857 * @return string HTML
905 - *
906 - * @static
907858 */
908 - public static function revUserTools( $rev ) {
 859+ function revUserTools( $rev ) {
909860 if( $rev->userCan( Revision::DELETED_USER ) ) {
910 - $link = self::userLink( $rev->getRawUser(), $rev->getRawUserText() ) .
 861+ $link = $this->userLink( $rev->getRawUser(), $rev->getRawUserText() ) .
911862 ' ' .
912 - self::userToolLinks( $rev->getRawUser(), $rev->getRawUserText() );
 863+ $this->userToolLinks( $rev->getRawUser(), $rev->getRawUserText() );
913864 } else {
914865 $link = wfMsgHtml( 'rev-deleted-user' );
915866 }
@@ -917,24 +868,22 @@
918869 }
919870 return $link;
920871 }
921 -
 872+
922873 /**
923874 * This function is called by all recent changes variants, by the page history,
924875 * and by the user contributions list. It is responsible for formatting edit
925876 * comments. It escapes any HTML in the comment, but adds some CSS to format
926877 * auto-generated comments (from section editing) and formats [[wikilinks]].
927 - *
 878+ *
928879 * The $title parameter must be a title OBJECT. It is used to generate a
929880 * direct link to the section in the autocomment.
930881 * @author Erik Moeller <moeller@scireview.de>
931 - *
 882+ *
932883 * Note: there's not always a title to pass to this function.
933884 * Since you can't set a default parameter for a reference, I've turned it
934885 * temporarily to a value pass. Should be adjusted further. --brion
935 - *
936 - * @static
937886 */
938 - public static function formatComment( $comment, $title = NULL ) {
 887+ function formatComment($comment, $title = NULL) {
939888 $fname = 'Linker::formatComment';
940889 wfProfileIn( $fname );
941890
@@ -964,7 +913,7 @@
965914 $section = str_replace( ']]', '', $section );
966915 $sectionTitle = wfClone( $title );
967916 $sectionTitle->mFragment = $section;
968 - $link = self::makeKnownLinkObj( $sectionTitle, wfMsg( 'sectionlink' ) );
 917+ $link = $this->makeKnownLinkObj( $sectionTitle, wfMsg( 'sectionlink' ) );
969918 }
970919 $sep='-';
971920 $auto=$link.$auto;
@@ -987,7 +936,7 @@
988937 if( preg_match( '/^' . $medians . '(.*)$/i', $match[1], $submatch ) ) {
989938 # Media link; trail not supported.
990939 $linkRegexp = '/\[\[(.*?)\]\]/';
991 - $thelink = self::makeMediaLink( $submatch[1], "", $text );
 940+ $thelink = $this->makeMediaLink( $submatch[1], "", $text );
992941 } else {
993942 # Other kind of link
994943 if( preg_match( $wgContLang->linkTrail(), $match[4], $submatch ) ) {
@@ -998,7 +947,7 @@
999948 $linkRegexp = '/\[\[(.*?)\]\]' . preg_quote( $trail, '/' ) . '/';
1000949 if ($match[1][0] == ':')
1001950 $match[1] = substr($match[1], 1);
1002 - $thelink = self::makeLink( $match[1], $text, "", $trail );
 951+ $thelink = $this->makeLink( $match[1], $text, "", $trail );
1003952 }
1004953 $comment = preg_replace( $linkRegexp, wfRegexReplacement( $thelink ), $comment, 1 );
1005954 }
@@ -1009,36 +958,33 @@
1010959 /**
1011960 * Wrap a comment in standard punctuation and formatting if
1012961 * it's non-empty, otherwise return empty string.
1013 - *
1014 - * @param $comment String the comment
1015 - * @param $title Title object
1016 - * @return String
1017 - *
1018 - * @static
 962+ *
 963+ * @param $comment String: the comment.
 964+ * @param $title Title object.
 965+ *
 966+ * @return string
1019967 */
1020 - public static function commentBlock( $comment, $title = NULL ) {
 968+ function commentBlock( $comment, $title = NULL ) {
1021969 // '*' used to be the comment inserted by the software way back
1022970 // in antiquity in case none was provided, here for backwards
1023971 // compatability, acc. to brion -ævar
1024972 if( $comment == '' || $comment == '*' ) {
1025973 return '';
1026974 } else {
1027 - $formatted = self::formatComment( $comment, $title );
 975+ $formatted = $this->formatComment( $comment, $title );
1028976 return " <span class=\"comment\">($formatted)</span>";
1029977 }
1030978 }
1031 -
 979+
1032980 /**
1033981 * Wrap and format the given revision's comment block, if the current
1034982 * user is allowed to view it.
1035 - * @param $rev Revision object
1036 - * @return String HTML
1037 - *
1038 - * @static
 983+ * @param $rev Revision object.
 984+ * @return string HTML
1039985 */
1040 - public static function revComment( $rev ) {
 986+ function revComment( $rev ) {
1041987 if( $rev->userCan( Revision::DELETED_COMMENT ) ) {
1042 - $block = self::commentBlock( $rev->getRawComment(), $rev->getTitle() );
 988+ $block = $this->commentBlock( $rev->getRawComment(), $rev->getTitle() );
1043989 } else {
1044990 $block = " <span class=\"comment\">" .
1045991 wfMsgHtml( 'rev-deleted-comment' ) . "</span>";
@@ -1049,49 +995,35 @@
1050996 return $block;
1051997 }
1052998
1053 - /**
1054 - * @todo document
1055 - * @static
1056 - */
1057 - public static function tocIndent() {
 999+ /** @todo document */
 1000+ function tocIndent() {
10581001 return "\n<ul>";
10591002 }
10601003
1061 - /**
1062 - * @todo document
1063 - * @static
1064 - */
1065 - public static function tocUnindent($level) {
 1004+ /** @todo document */
 1005+ function tocUnindent($level) {
10661006 return "</li>\n" . str_repeat( "</ul>\n</li>\n", $level>0 ? $level : 0 );
10671007 }
10681008
10691009 /**
10701010 * parameter level defines if we are on an indentation level
1071 - *
1072 - * @static
10731011 */
1074 - public static function tocLine( $anchor, $tocline, $tocnumber, $level ) {
 1012+ function tocLine( $anchor, $tocline, $tocnumber, $level ) {
10751013 return "\n<li class=\"toclevel-$level\"><a href=\"#" .
10761014 $anchor . '"><span class="tocnumber">' .
10771015 $tocnumber . '</span> <span class="toctext">' .
10781016 $tocline . '</span></a>';
10791017 }
10801018
1081 - /**
1082 - * @todo document
1083 - * @static
1084 - */
1085 - static function tocLineEnd() {
 1019+ /** @todo document */
 1020+ function tocLineEnd() {
10861021 return "</li>\n";
10871022 }
10881023
1089 - /**
1090 - * @todo document
1091 - * @static
1092 - */
1093 - static function tocList($toc) {
 1024+ /** @todo document */
 1025+ function tocList($toc) {
10941026 global $wgJsMimeType;
1095 - $title = wfMsgForContent('toc') ;
 1027+ $title = wfMsgForContent('toc') ;
10961028 return
10971029 '<table id="toc" class="toc" summary="' . $title .'"><tr><td>'
10981030 . '<div id="toctitle"><h2>' . $title . "</h2></div>\n"
@@ -1108,33 +1040,29 @@
11091041 . "</script>\n";
11101042 }
11111043
1112 - /**
1113 - * @todo document
1114 - * @static
1115 - */
1116 - public static function editSectionLinkForOther( $title, $section ) {
 1044+ /** @todo document */
 1045+ function editSectionLinkForOther( $title, $section ) {
11171046 global $wgContLang;
11181047
11191048 $title = Title::newFromText( $title );
11201049 $editurl = '&section='.$section;
1121 - $url = self::makeKnownLinkObj( $title, wfMsg('editsection'), 'action=edit'.$editurl );
 1050+ $url = $this->makeKnownLinkObj( $title, wfMsg('editsection'), 'action=edit'.$editurl );
11221051
11231052 return "<span class=\"editsection\">[".$url."]</span>";
 1053+
11241054 }
11251055
11261056 /**
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
 1057+ * @param $title Title object.
 1058+ * @param $section Integer: section number.
 1059+ * @param $hint Link String: title, or default if omitted or empty
11321060 */
1133 - public static function editSectionLink( $nt, $section, $hint='' ) {
 1061+ function editSectionLink( $nt, $section, $hint='' ) {
11341062 global $wgContLang;
11351063
11361064 $editurl = '&section='.$section;
11371065 $hint = ( $hint=='' ) ? '' : ' title="' . wfMsgHtml( 'editsectionhint', htmlspecialchars( $hint ) ) . '"';
1138 - $url = self::makeKnownLinkObj( $nt, wfMsg('editsection'), 'action=edit'.$editurl, '', '', '', $hint );
 1066+ $url = $this->makeKnownLinkObj( $nt, wfMsg('editsection'), 'action=edit'.$editurl, '', '', '', $hint );
11391067
11401068 return "<span class=\"editsection\">[".$url."]</span>";
11411069 }
@@ -1142,10 +1070,10 @@
11431071 /**
11441072 * Split a link trail, return the "inside" portion and the remainder of the trail
11451073 * as a two-element array
1146 - *
 1074+ *
11471075 * @static
11481076 */
1149 - public static function splitTrail( $trail ) {
 1077+ static function splitTrail( $trail ) {
11501078 static $regex = false;
11511079 if ( $regex === false ) {
11521080 global $wgContLang;
@@ -1160,5 +1088,6 @@
11611089 }
11621090 return array( $inside, $trail );
11631091 }
 1092+
11641093 }
11651094 ?>
Index: trunk/phase3/includes/SpecialUpload.php
@@ -254,7 +254,7 @@
255255 * @access private
256256 */
257257 function processUpload() {
258 - global $wgOut;
 258+ global $wgUser, $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,15 +395,18 @@
396396 }
397397
398398 if( $nt->getArticleID() ) {
399 - $dlink = Linker::makeKnownLinkObj( $nt );
 399+ global $wgUser;
 400+ $sk = $wgUser->getSkin();
 401+ $dlink = $sk->makeKnownLinkObj( $nt );
400402 $warning .= '<li>'.wfMsgHtml( 'fileexists', $dlink ).'</li>';
401403 } else {
402404 # If the file existed before and was deleted, warn the user of this
403405 # Don't bother doing so if the image exists now, however
404406 $image = new Image( $nt );
405407 if( $image->wasDeleted() ) {
 408+ $skin = $wgUser->getSkin();
406409 $ltitle = SpecialPage::getTitleFor( 'Log' );
407 - $llink = Linker::makeKnownLinkObj( $ltitle, wfMsgHtml( 'deletionlog' ), 'type=delete&page=' . $nt->getPrefixedUrl() );
 410+ $llink = $skin->makeKnownLinkObj( $ltitle, wfMsgHtml( 'deletionlog' ), 'type=delete&page=' . $nt->getPrefixedUrl() );
408411 $warning .= wfOpenElement( 'li' ) . wfMsgWikiHtml( 'filewasdeleted', $llink ) . wfCloseElement( 'li' );
409412 }
410413 }
@@ -588,11 +591,12 @@
589592 * @access private
590593 */
591594 function showSuccess() {
592 - global $wgOut, $wgContLang;
 595+ global $wgUser, $wgOut, $wgContLang;
593596
594 - $ilink = Linker::makeMediaLink( $this->mUploadSaveName, Image::imageUrl( $this->mUploadSaveName ) );
 597+ $sk = $wgUser->getSkin();
 598+ $ilink = $sk->makeMediaLink( $this->mUploadSaveName, Image::imageUrl( $this->mUploadSaveName ) );
595599 $dname = $wgContLang->getNsText( NS_IMAGE ) . ':'.$this->mUploadSaveName;
596 - $dlink = Linker::makeKnownLink( $dname, $dname );
 600+ $dlink = $sk->makeKnownLink( $dname, $dname );
597601
598602 $wgOut->addHTML( '<h2>' . wfMsgHtml( 'successfulupload' ) . "</h2>\n" );
599603 $text = wfMsgWikiHtml( 'fileuploaded', $ilink, $dlink );
@@ -700,6 +704,7 @@
701705 $wgOut->addHTML( '<div id="uploadtext">' );
702706 $wgOut->addWikiText( wfMsg( 'uploadtext' ) );
703707 $wgOut->addHTML( '</div>' );
 708+ $sk = $wgUser->getSkin();
704709
705710
706711 $sourcefilename = wfMsgHtml( 'sourcefilename' );
Index: trunk/phase3/includes/SpecialPrefixindex.php
@@ -56,10 +56,12 @@
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, $wgContLang;
 60+ global $wgOut, $wgUser, $wgContLang;
6161
6262 $fname = 'indexShowChunk';
6363
 64+ $sk = $wgUser->getSkin();
 65+
6466 if (!isset($from)) $from = $prefix;
6567
6668 $fromList = $this->getNamespaceKeyAndText($namespace, $from);
@@ -100,7 +102,7 @@
101103 $t = Title::makeTitle( $s->page_namespace, $s->page_title );
102104 if( $t ) {
103105 $link = ($s->page_is_redirect ? '<div class="allpagesredirect">' : '' ) .
104 - Linker::makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) .
 106+ $sk->makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) .
105107 ($s->page_is_redirect ? '</div>' : '' );
106108 } else {
107109 $link = '[[' . htmlspecialchars( $s->page_title ) . ']]';
@@ -127,11 +129,11 @@
128130 $out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">';
129131 $out2 .= '<tr valign="top"><td align="left">' . $nsForm;
130132 $out2 .= '</td><td align="right" style="font-size: smaller; margin-bottom: 1em;">' .
131 - Linker::makeKnownLink( $wgContLang->specialPage( $this->name ),
 133+ $sk->makeKnownLink( $wgContLang->specialPage( $this->name ),
132134 wfMsg ( 'allpages' ) );
133135 if ( isset($dbr) && $dbr && ($n == $this->maxPerPage) && ($s = $dbr->fetchObject( $res )) ) {
134136 $namespaceparam = $namespace ? "&namespace=$namespace" : "";
135 - $out2 .= " | " . Linker::makeKnownLink(
 137+ $out2 .= " | " . $sk->makeKnownLink(
136138 $wgContLang->specialPage( $this->name ),
137139 wfMsg ( 'nextpage', $s->page_title ),
138140 "from=" . wfUrlEncode ( $s->page_title ) .
Index: trunk/phase3/includes/Parser.php
@@ -1037,8 +1037,9 @@
10381038 substr($m[0], 0, 20 ) . '"' );
10391039 }
10401040
1041 - $url = wfMsg( $urlmsg, $id );
1042 - $la = Linker::getExternalLinkAttributes( $url, "$keyword $id" );
 1041+ $url = wfMsg( $urlmsg, $id);
 1042+ $sk =& $this->mOptions->getSkin();
 1043+ $la = $sk->getExternalLinkAttributes( $url, $keyword.$id );
10431044 $text = "<a href=\"{$url}\"{$la}>{$keyword} {$id}</a>";
10441045 }
10451046 return $text;
@@ -1257,6 +1258,8 @@
12581259 $fname = 'Parser::replaceExternalLinks';
12591260 wfProfileIn( $fname );
12601261
 1262+ $sk =& $this->mOptions->getSkin();
 1263+
12611264 $bits = preg_split( EXT_LINK_BRACKETED, $text, -1, PREG_SPLIT_DELIM_CAPTURE );
12621265
12631266 $s = $this->replaceFreeExternalLinks( array_shift( $bits ) );
@@ -1318,7 +1321,7 @@
13191322 # This means that users can paste URLs directly into the text
13201323 # Funny characters like &ouml; aren't valid in URLs anyway
13211324 # This was changed in August 2004
1322 - $s .= Linker::makeExternalLink( $url, $text, false, $linktype, $this->mTitle->getNamespace() ) . $dtrail . $trail;
 1325+ $s .= $sk->makeExternalLink( $url, $text, false, $linktype, $this->mTitle->getNamespace() ) . $dtrail . $trail;
13231326
13241327 # Register link in the output object.
13251328 # Replace unnecessary URL escape codes with the referenced character
@@ -1344,6 +1347,8 @@
13451348 $s = array_shift( $bits );
13461349 $i = 0;
13471350
 1351+ $sk =& $this->mOptions->getSkin();
 1352+
13481353 while ( $i < count( $bits ) ){
13491354 $protocol = $bits[$i++];
13501355 $remainder = $bits[$i++];
@@ -1395,7 +1400,7 @@
13961401 $text = $this->maybeMakeExternalImage( $url );
13971402 if ( $text === false ) {
13981403 # Not an image, make a link
1399 - $text = Linker::makeExternalLink( $url, $wgContLang->markNoConversion($url), true, 'free', $this->mTitle->getNamespace() );
 1404+ $text = $sk->makeExternalLink( $url, $wgContLang->markNoConversion($url), true, 'free', $this->mTitle->getNamespace() );
14001405 # Register it in the output object...
14011406 # Replace unnecessary URL escape codes with their equivalent characters
14021407 $pasteurized = Parser::replaceUnusualEscapes( $url );
@@ -1450,6 +1455,7 @@
14511456 * @private
14521457 */
14531458 function maybeMakeExternalImage( $url ) {
 1459+ $sk =& $this->mOptions->getSkin();
14541460 $imagesfrom = $this->mOptions->getAllowExternalImagesFrom();
14551461 $imagesexception = !empty($imagesfrom);
14561462 $text = false;
@@ -1457,7 +1463,7 @@
14581464 || ( $imagesexception && strpos( $url, $imagesfrom ) === 0 ) ) {
14591465 if ( preg_match( EXT_IMAGE_REGEX, $url ) ) {
14601466 # Image found
1461 - $text = Linker::makeExternalImage( htmlspecialchars( $url ) );
 1467+ $text = $sk->makeExternalImage( htmlspecialchars( $url ) );
14621468 }
14631469 }
14641470 return $text;
@@ -1479,6 +1485,8 @@
14801486 # the % is needed to support urlencoded titles as well
14811487 if ( !$tc ) { $tc = Title::legalChars() . '#%'; }
14821488
 1489+ $sk =& $this->mOptions->getSkin();
 1490+
14831491 #split the entire text string on occurences of [[
14841492 $a = explode( '[[', ' ' . $s );
14851493 #get the first element (all text up to first [[), and remove the space we added
@@ -1726,13 +1734,13 @@
17271735 if( ( $nt->getPrefixedText() === $selflink ) &&
17281736 ( $nt->getFragment() === '' ) ) {
17291737 # Self-links are handled specially; generally de-link and change to bold.
1730 - $s .= $prefix . Linker::makeSelfLinkObj( $nt, $text, '', $trail );
 1738+ $s .= $prefix . $sk->makeSelfLinkObj( $nt, $text, '', $trail );
17311739 continue;
17321740 }
17331741
17341742 # Special and Media are pseudo-namespaces; no pages actually exist in them
17351743 if( $ns == NS_MEDIA ) {
1736 - $link = Linker::makeMediaLinkObj( $nt, $text );
 1744+ $link = $sk->makeMediaLinkObj( $nt, $text );
17371745 # Cloak with NOPARSE to avoid replacement in replaceExternalLinks
17381746 $s .= $prefix . $this->armorLinks( $link ) . $trail;
17391747 $this->mOutput->addImage( $nt->getDBkey() );
@@ -1807,7 +1815,8 @@
18081816 */
18091817 function makeKnownLinkHolder( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
18101818 list( $inside, $trail ) = Linker::splitTrail( $trail );
1811 - $link = Linker::makeKnownLinkObj( $nt, $text, $query, $inside, $prefix );
 1819+ $sk =& $this->mOptions->getSkin();
 1820+ $link = $sk->makeKnownLinkObj( $nt, $text, $query, $inside, $prefix );
18121821 return $this->armorLinks( $link ) . $trail;
18131822 }
18141823
@@ -3372,6 +3381,9 @@
33733382 $enoughToc = false;
33743383 }
33753384
 3385+ # We need this to perform operations on the HTML
 3386+ $sk =& $this->mOptions->getSkin();
 3387+
33763388 # headline counter
33773389 $headlineCount = 0;
33783390 $sectionCount = 0; # headlineCount excluding template sections
@@ -3415,7 +3427,7 @@
34163428 $toclevel++;
34173429 $sublevelCount[$toclevel] = 0;
34183430 if( $toclevel<$wgMaxTocLevel ) {
3419 - $toc .= Linker::tocIndent();
 3431+ $toc .= $sk->tocIndent();
34203432 }
34213433 }
34223434 elseif ( $level < $prevlevel && $toclevel > 1 ) {
@@ -3439,13 +3451,13 @@
34403452 }
34413453 }
34423454 if( $toclevel<$wgMaxTocLevel ) {
3443 - $toc .= Linker::tocUnindent( $prevtoclevel - $toclevel );
 3455+ $toc .= $sk->tocUnindent( $prevtoclevel - $toclevel );
34443456 }
34453457 }
34463458 else {
34473459 # No change in level, end TOC line
34483460 if( $toclevel<$wgMaxTocLevel ) {
3449 - $toc .= Linker::tocLineEnd();
 3461+ $toc .= $sk->tocLineEnd();
34503462 }
34513463 }
34523464
@@ -3505,7 +3517,7 @@
35063518 $anchor .= '_' . $refcount[$headlineCount];
35073519 }
35083520 if( $enoughToc && ( !isset($wgMaxTocLevel) || $toclevel<$wgMaxTocLevel ) ) {
3509 - $toc .= Linker::tocLine($anchor, $tocline, $numbering, $toclevel);
 3521+ $toc .= $sk->tocLine($anchor, $tocline, $numbering, $toclevel);
35103522 }
35113523 # give headline the correct <h#> tag
35123524 @$head[$headlineCount] .= "<a name=\"$anchor\"></a><h".$level.$matches[2][$headlineCount];
@@ -3515,9 +3527,9 @@
35163528 $head[$headlineCount] = '';
35173529 }
35183530 if( $istemplate )
3519 - $head[$headlineCount] .= Linker::editSectionLinkForOther($templatetitle, $templatesection);
 3531+ $head[$headlineCount] .= $sk->editSectionLinkForOther($templatetitle, $templatesection);
35203532 else
3521 - $head[$headlineCount] .= Linker::editSectionLink($this->mTitle, $sectionCount+1, $headline_hint);
 3533+ $head[$headlineCount] .= $sk->editSectionLink($this->mTitle, $sectionCount+1, $headline_hint);
35223534 }
35233535 // Yes, the headline logically goes before the edit section. Why isn't it there
35243536 // in source? Ask the CSS people. The float gets screwed up if you do that.
@@ -3532,9 +3544,9 @@
35333545
35343546 if( $enoughToc ) {
35353547 if( $toclevel<$wgMaxTocLevel ) {
3536 - $toc .= Linker::tocUnindent( $toclevel - 1 );
 3548+ $toc .= $sk->tocUnindent( $toclevel - 1 );
35373549 }
3538 - $toc = Linker::tocList( $toc );
 3550+ $toc = $sk->tocList( $toc );
35393551 }
35403552
35413553 # split up and insert constructed headlines
@@ -3549,7 +3561,7 @@
35503562
35513563 # Disabled because it broke block formatting
35523564 # For example, a bullet point in the top line
3553 - # $full .= Linker::editSectionLink(0);
 3565+ # $full .= $sk->editSectionLink(0);
35543566 }
35553567 $full .= $block;
35563568 if( $enoughToc && !$i && $isMain && !$this->mForceTocPosition ) {
@@ -3892,7 +3904,7 @@
38933905
38943906 /**
38953907 * Replace <!--LINK--> link placeholders with actual links, in the buffer
3896 - * Placeholders created in Linker::makeLinkObj()
 3908+ * Placeholders created in Skin::makeLinkObj()
38973909 * Returns an array of links found, indexed by PDBK:
38983910 * 0 - broken
38993911 * 1 - normal link
@@ -3909,6 +3921,7 @@
39103922
39113923 $pdbks = array();
39123924 $colours = array();
 3925+ $sk =& $this->mOptions->getSkin();
39133926 $linkCache =& LinkCache::singleton();
39143927
39153928 if ( !empty( $this->mLinkHolders['namespaces'] ) ) {
@@ -4089,15 +4102,15 @@
40904103 $linkCache->addBadLinkObj( $title );
40914104 $colours[$pdbk] = 0;
40924105 $this->mOutput->addLink( $title, 0 );
4093 - $wgOutputReplace[$searchkey] = Linker::makeBrokenLinkObj( $title,
 4106+ $wgOutputReplace[$searchkey] = $sk->makeBrokenLinkObj( $title,
40944107 $this->mLinkHolders['texts'][$key],
40954108 $this->mLinkHolders['queries'][$key] );
40964109 } elseif ( $colours[$pdbk] == 1 ) {
4097 - $wgOutputReplace[$searchkey] = Linker::makeKnownLinkObj( $title,
 4110+ $wgOutputReplace[$searchkey] = $sk->makeKnownLinkObj( $title,
40984111 $this->mLinkHolders['texts'][$key],
40994112 $this->mLinkHolders['queries'][$key] );
41004113 } elseif ( $colours[$pdbk] == 2 ) {
4101 - $wgOutputReplace[$searchkey] = Linker::makeStubLinkObj( $title,
 4114+ $wgOutputReplace[$searchkey] = $sk->makeStubLinkObj( $title,
41024115 $this->mLinkHolders['texts'][$key],
41034116 $this->mLinkHolders['queries'][$key] );
41044117 }
@@ -4123,7 +4136,7 @@
41244137 $wgOutputReplace = array();
41254138 foreach( $this->mInterwikiLinkHolders['texts'] as $key => $link ) {
41264139 $title = $this->mInterwikiLinkHolders['titles'][$key];
4127 - $wgOutputReplace[$key] = Linker::makeLinkObj( $title, $link );
 4140+ $wgOutputReplace[$key] = $sk->makeLinkObj( $title, $link );
41284141 }
41294142
41304143 $text = preg_replace_callback(
@@ -4203,6 +4216,7 @@
42044217 $ig->setShowBytes( false );
42054218 $ig->setShowFilename( false );
42064219 $ig->setParsing();
 4220+ $ig->useSkin( $this->mOptions->getSkin() );
42074221
42084222 if( isset( $params['caption'] ) )
42094223 $ig->setCaption( $params['caption'] );
@@ -4331,7 +4345,8 @@
43324346 $alt = Sanitizer::stripAllTags( $alt );
43334347
43344348 # Linker does the rest
4335 - return Linker::makeImageLinkObj( $nt, $caption, $alt, $align, $width, $height, $framed, $thumb, $manual_thumb, $page );
 4349+ $sk =& $this->mOptions->getSkin();
 4350+ return $sk->makeImageLinkObj( $nt, $caption, $alt, $align, $width, $height, $framed, $thumb, $manual_thumb, $page );
43364351 }
43374352
43384353 /**
@@ -4667,6 +4682,7 @@
46684683 var $mInterwikiMagic; # Interlanguage links are removed and returned in an array
46694684 var $mAllowExternalImages; # Allow external images inline
46704685 var $mAllowExternalImagesFrom; # If not, any exception?
 4686+ var $mSkin; # Reference to the preferred skin
46714687 var $mDateFormat; # Date format index
46724688 var $mEditSection; # Create "edit section" links
46734689 var $mNumberHeadings; # Automatically number headings
@@ -4676,7 +4692,7 @@
46774693 var $mMaxIncludeSize; # Maximum size of template expansions, in bytes
46784694 var $mRemoveComments; # Remove HTML comments. ONLY APPLIES TO PREPROCESS OPERATIONS
46794695
4680 - var $mUser; # Stored user object, just used to initialise the date format
 4696+ var $mUser; # Stored user object, just used to initialise the skin
46814697
46824698 function getUseTeX() { return $this->mUseTeX; }
46834699 function getUseDynamicDates() { return $this->mUseDynamicDates; }
@@ -4691,6 +4707,13 @@
46924708 function getMaxIncludeSize() { return $this->mMaxIncludeSize; }
46934709 function getRemoveComments() { return $this->mRemoveComments; }
46944710
 4711+ function &getSkin() {
 4712+ if ( !isset( $this->mSkin ) ) {
 4713+ $this->mSkin = $this->mUser->getSkin();
 4714+ }
 4715+ return $this->mSkin;
 4716+ }
 4717+
46954718 function getDateFormat() {
46964719 if ( !isset( $this->mDateFormat ) ) {
46974720 $this->mDateFormat = $this->mUser->getDatePreference();
@@ -4708,6 +4731,7 @@
47094732 function setNumberHeadings( $x ) { return wfSetVar( $this->mNumberHeadings, $x ); }
47104733 function setAllowSpecialInclusion( $x ) { return wfSetVar( $this->mAllowSpecialInclusion, $x ); }
47114734 function setTidy( $x ) { return wfSetVar( $this->mTidy, $x); }
 4735+ function setSkin( $x ) { $this->mSkin = $x; }
47124736 function setInterfaceMessage( $x ) { return wfSetVar( $this->mInterfaceMessage, $x); }
47134737 function setMaxIncludeSize( $x ) { return wfSetVar( $this->mMaxIncludeSize, $x ); }
47144738 function setRemoveComments( $x ) { return wfSetVar( $this->mRemoveComments, $x ); }
@@ -4748,6 +4772,7 @@
47494773 $this->mInterwikiMagic = $wgInterwikiMagic;
47504774 $this->mAllowExternalImages = $wgAllowExternalImages;
47514775 $this->mAllowExternalImagesFrom = $wgAllowExternalImagesFrom;
 4776+ $this->mSkin = null; # Deferred
47524777 $this->mDateFormat = null; # Deferred
47534778 $this->mEditSection = true;
47544779 $this->mNumberHeadings = $user->getOption( 'numberheadings' );
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Datatype.php
@@ -324,9 +324,9 @@
325325 * @access public
326326 * @static
327327 */
328 - static function makeAttributeSearchURL($attribute,$value) {
 328+ static function makeAttributeSearchURL($attribute,$value,$skin) {
329329 global $wgServer;
330 - return $wgServer . Skin::makeSpecialUrl('SearchTriple','attribute=' . urlencode($attribute) . '&value=' . urlencode($value) . '&do=' . urlencode('Search Attributes'));
 330+ return $wgServer . $skin->makeSpecialUrl('SearchTriple','attribute=' . urlencode($attribute) . '&value=' . urlencode($value) . '&do=' . urlencode('Search Attributes'));
331331 }
332332
333333 /**
@@ -334,9 +334,9 @@
335335 * @access public
336336 * @static
337337 */
338 - static function makeRelationSearchURL($relation,$object) {
 338+ static function makeRelationSearchURL($relation,$object,$skin) {
339339 global $wgServer;
340 - return $wgServer . Skin::makeSpecialUrl('SearchTriple','relation=' . urlencode($relation) . '&object=' . urlencode($object) . '&do=' . urlencode('Search Relations'));
 340+ return $wgServer . $skin->makeSpecialUrl('SearchTriple','relation=' . urlencode($relation) . '&object=' . urlencode($object) . '&do=' . urlencode('Search Relations'));
341341 }
342342
343343 /**
Index: trunk/extensions/SemanticMediaWiki/specials/Relations/SMW_SpecialTypes.php
@@ -87,9 +87,9 @@
8888 /**
8989 * Returns the info about a type as HTML
9090 */
91 - function getTypeInfo ($label, $skin = null) { // if $skin is left null, we better be in MW1.9+
 91+ function getTypeInfo ($label, $skin) {
9292 $title = Title::makeTitle( SMW_NS_TYPE, $label );
93 - $link = $skin ? $skin->makeLinkObj( $title, $title->getText() ) : Linker::makeLinkObj( $title, $title->getText() );
 93+ $link = $skin->makeLinkObj( $title, $title->getText() );
9494
9595 // Unlike Attributes and Relations, we don't have a count and there's no URL to search by type.
9696 $text = $link;
@@ -117,13 +117,8 @@
118118
119119 }
120120
121 - function formatResult( $result, $old = null ) {
122 - if($old) { // pre-1.9
123 - $skin = $result;
124 - $result = $old;
125 - return $this->getTypeInfo($result->title, $skin);
126 - }
127 - return $this->getTypeInfo($result->title);
 121+ function formatResult( $skin, $result ) {
 122+ return $this->getTypeInfo($result->title, $skin);
128123 }
129124
130125 }
Index: trunk/extensions/SemanticMediaWiki/specials/Relations/SMW_SpecialUnusedRelations.php
@@ -61,15 +61,10 @@
6262 return false;
6363 }
6464
65 - function formatResult( $result, $old = null ) {
66 - if($old) { // pre-1.9
67 - $skin = $result;
68 - $result = $old;
69 - }
 65+ function formatResult( $skin, $result ) {
7066 global $wgLang;
7167 $title = Title::makeTitle( SMW_NS_RELATION, $result->title );
72 - return $old ? $skin->makeLinkObj( $title, $title->getText() )
73 - : Linker::makeLinkObj( $title, $title->getText() );
 68+ return $skin->makeLinkObj( $title, $title->getText() );
7469 }
7570 }
7671
@@ -104,4 +99,4 @@
105100
106101
107102 }
108 -?>
 103+?>
\ No newline at end of file
Index: trunk/extensions/SemanticMediaWiki/specials/Relations/SMW_SpecialAttributes.php
@@ -53,16 +53,11 @@
5454 return false;
5555 }
5656
57 - function formatResult( $result, $old = null ) {
58 - if($old) { // pre-1.9
59 - $skin = $result;
60 - $result = $old;
61 - }
 57+ function formatResult( $skin, $result ) {
6258 global $wgLang, $wgExtraNamespaces;
6359 // The attribute title is in value, see getSQL().
6460 $attrtitle = Title::makeTitle( SMW_NS_ATTRIBUTE, $result->value );
65 - $attrlink = $old ? $skin->makeLinkObj( $attrtitle, $attrtitle->getText() )
66 - : Linker::makeLinkObj( $attrtitle, $attrtitle->getText() );
 61+ $attrlink = $skin->makeLinkObj( $attrtitle, $attrtitle->getText() );
6762 // The value_datatype is in title, see getSQL().
6863 if (strncmp($result->title, $wgExtraNamespaces[SMW_NS_TYPE], count($wgExtraNamespaces[SMW_NS_TYPE])) == 0) {
6964 // The value_datatype is a Type: page name.
@@ -77,10 +72,10 @@
7873 $typetitle = NULL;
7974 }
8075 }
81 - $typelink = $old ? $skin->makeLinkObj( $typetitle ) : Linker::makeLinkObj( $typetitle );
 76+ $typelink = $skin->makeLinkObj( $typetitle);
8277 // Note: It doesn't seem possible to reuse this infolink object.
8378 $searchlink = new SMWInfolink(
84 - SMWInfolink::makeAttributeSearchURL($attrtitle->getText(),''),
 79+ SMWInfolink::makeAttributeSearchURL($attrtitle->getText(),'',$skin),
8580 '+','smwsearch');
8681
8782 return "$attrlink ($result->count)" . wfMsg('smw_attr_type_join', $typelink) . ' ' . $searchlink->getHTML();
@@ -97,4 +92,4 @@
9893 SpecialPage::addPage( new SpecialPage('Attributes','',true,'doSpecialAttributes',false) );
9994 }
10095
101 -?>
 96+?>
\ No newline at end of file
Index: trunk/extensions/SemanticMediaWiki/specials/Relations/SMW_SpecialUnusedAttributes.php
@@ -60,15 +60,10 @@
6161 return false;
6262 }
6363
64 - function formatResult( $result, $old = null ) {
65 - if($old) { // pre-1.9
66 - $skin = $result;
67 - $result = $old;
68 - }
 64+ function formatResult( $skin, $result ) {
6965 global $wgLang;
7066 $title = Title::makeTitle( SMW_NS_ATTRIBUTE, $result->title );
71 - return $old ? $skin->makeLinkObj( $title, $title->getText() )
72 - : Linker::makeLinkObj( $title, $title->getText() );
 67+ return $skin->makeLinkObj( $title, $title->getText() );
7368 }
7469 }
7570
@@ -82,4 +77,4 @@
8378 SpecialPage::addPage( new SpecialPage('UnusedAttributes','',true,'doSpecialUnsusedAttributes',false) );
8479 }
8580
86 -?>
 81+?>
\ No newline at end of file
Index: trunk/extensions/SemanticMediaWiki/specials/Relations/SMW_SpecialRelations.php
@@ -53,18 +53,13 @@
5454 return false;
5555 }
5656
57 - function formatResult( $result, $old = null ) {
58 - if($old) { // pre-1.9
59 - $skin = $result;
60 - $result = $old;
61 - }
 57+ function formatResult( $skin, $result ) {
6258 global $wgLang;
6359 $title = Title::makeTitle( SMW_NS_RELATION, $result->title );
64 - $rlink = $old ? $skin->makeLinkObj( $title, $title->getText() )
65 - : Linker::makeLinkObj( $title, $title->getText() );
 60+ $rlink = $skin->makeLinkObj( $title, $title->getText() );
6661 // Note: It doesn't seem possible to reuse this infolink object.
6762 $searchlink = new SMWInfolink(
68 - SMWInfolink::makeRelationSearchURL($title->getText(),''),
 63+ SMWInfolink::makeRelationSearchURL($title->getText(),'',$skin),
6964 '+','smwsearch');
7065
7166 return "$rlink ($result->count) " . $searchlink->getHTML();
@@ -82,4 +77,4 @@
8378 SpecialPage::addPage( new SpecialPage('Relations','',true,'doSpecialRelations',false) );
8479 }
8580
86 -?>
 81+?>
\ No newline at end of file
Index: trunk/extensions/LinkSearch/LinkSearch.php
@@ -75,16 +75,12 @@
7676 AND el_index LIKE $encSearch";
7777 }
7878
79 - function formatResult( $result, $old = null ) {
80 - if($old) { // pre-1.9
81 - $skin = $result;
82 - $result = $old;
83 - }
 79+ function formatResult( $skin, $result ) {
8480 $title = Title::makeTitle( $result->namespace, $result->title );
8581 $url = $result->url;
8682
87 - $pageLink = $old ? $skin->makeKnownLinkObj( $title ) : Linker::makeKnownLinkObj( $title );
88 - $urlLink = $old ? $skin->makeExternalLink( $url, $url ) : Linker::makeExternalLink( $url, $url );
 83+ $pageLink = $skin->makeKnownLinkObj( $title );
 84+ $urlLink = $skin->makeExternalLink( $url, $url );
8985
9086 return wfMsgHtml( 'linksearch-line', $urlLink, $pageLink );
9187 }
Index: trunk/extensions/CrossNamespaceLinks/SpecialCrossNamespaceLinks_body.php
@@ -102,18 +102,13 @@
103103
104104 function sortDescending() { return false; }
105105
106 - function formatResult( $result, $old = null ) {
107 - if($old) { // pre-1.9
108 - $skin = $result;
109 - $result = $old;
110 - }
 106+ function formatResult( $skin, $result ) {
111107 global $wgContLang, $wgLang;
112108
113109 $nt = Title::makeTitle( NS_MAIN, $result->title );
114110 $text = $wgContLang->convert( $nt->getPrefixedText() );
115111
116 - $plink = $old ? $skin->makeKnownLink( $nt->getPrefixedText(), htmlspecialchars( $text ) )
117 - : Linker::makeKnownLink( $nt->getPrefixedText(), htmlspecialchars( $text ) );
 112+ $plink = $skin->makeKnownLink( $nt->getPrefixedText(), htmlspecialchars( $text ) );
118113
119114 return wfMsgExt( 'crossnamespacelinkstext', array( 'parsemag' ), $plink, $wgLang->formatNum( $result->namespace ), htmlspecialchars( $wgLang->getNsText( $result->value ) ) );
120115 }
Index: trunk/extensions/interact/SpecialInteract.php
@@ -43,13 +43,9 @@
4444 }
4545
4646
47 - function formatResult( $result, $old = null ) {
48 - if($old) { // pre-1.9
49 - $skin = $result;
50 - $result = $old;
51 - }
 47+ function formatResult( $skin, $result) {
5248 $title = Title::makeTitle( $result->namespace, $result->title );
53 - $link = $old ? $skin->makeKnownLinkObj( $title ) : Linker::makeKnownLinkObj( $title );
 49+ $link = $skin->makeKnownLinkObj( $title );
5450 return "$link";
5551 }
5652 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r17479* (bug 7405) Make Linker methods static. Patch by Dan Li.nickj05:21, 8 November 2006
r17480* (bug 7405) Change extensions to use static calls to Linker. Patch by Dan Li.simetrical05:23, 8 November 2006