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