Index: trunk/phase3/includes/specials/SpecialMovepage.php |
— | — | @@ -42,55 +42,53 @@ |
43 | 43 | } |
44 | 44 | |
45 | 45 | public function execute( $par ) { |
46 | | - global $wgUser, $wgOut, $wgRequest; |
47 | | - |
48 | 46 | # Check for database lock |
49 | 47 | if ( wfReadOnly() ) { |
50 | | - $wgOut->readOnlyPage(); |
51 | | - return; |
| 48 | + throw new ReadOnlyError; |
52 | 49 | } |
53 | 50 | |
54 | 51 | $this->setHeaders(); |
55 | 52 | $this->outputHeader(); |
56 | 53 | |
57 | | - $target = !is_null( $par ) ? $par : $wgRequest->getVal( 'target' ); |
| 54 | + $request = $this->getRequest(); |
| 55 | + $target = !is_null( $par ) ? $par : $request->getVal( 'target' ); |
58 | 56 | |
59 | 57 | // Yes, the use of getVal() and getText() is wanted, see bug 20365 |
60 | | - $oldTitleText = $wgRequest->getVal( 'wpOldTitle', $target ); |
61 | | - $newTitleText = $wgRequest->getText( 'wpNewTitle' ); |
| 58 | + $oldTitleText = $request->getVal( 'wpOldTitle', $target ); |
| 59 | + $newTitleText = $request->getText( 'wpNewTitle' ); |
62 | 60 | |
63 | 61 | $this->oldTitle = Title::newFromText( $oldTitleText ); |
64 | 62 | $this->newTitle = Title::newFromText( $newTitleText ); |
65 | 63 | |
66 | 64 | if( is_null( $this->oldTitle ) ) { |
67 | | - $wgOut->showErrorPage( 'notargettitle', 'notargettext' ); |
68 | | - return; |
| 65 | + throw new ErrorPageError( 'notargettitle', 'notargettext' ); |
69 | 66 | } |
70 | 67 | if( !$this->oldTitle->exists() ) { |
71 | | - $wgOut->showErrorPage( 'nopagetitle', 'nopagetext' ); |
72 | | - return; |
| 68 | + throw new ErrorPageError( 'nopagetitle', 'nopagetext' ); |
73 | 69 | } |
74 | 70 | |
| 71 | + $user = $this->getUser(); |
| 72 | + |
75 | 73 | # Check rights |
76 | | - $permErrors = $this->oldTitle->getUserPermissionsErrors( 'move', $wgUser ); |
| 74 | + $permErrors = $this->oldTitle->getUserPermissionsErrors( 'move', $user ); |
77 | 75 | if( !empty( $permErrors ) ) { |
78 | | - $wgOut->showPermissionsErrorPage( $permErrors ); |
| 76 | + $this->getOutput()->showPermissionsErrorPage( $permErrors ); |
79 | 77 | return; |
80 | 78 | } |
81 | 79 | |
82 | | - $def = !$wgRequest->wasPosted(); |
| 80 | + $def = !$request->wasPosted(); |
83 | 81 | |
84 | | - $this->reason = $wgRequest->getText( 'wpReason' ); |
85 | | - $this->moveTalk = $wgRequest->getBool( 'wpMovetalk', $def ); |
86 | | - $this->fixRedirects = $wgRequest->getBool( 'wpFixRedirects', $def ); |
87 | | - $this->leaveRedirect = $wgRequest->getBool( 'wpLeaveRedirect', $def ); |
88 | | - $this->moveSubpages = $wgRequest->getBool( 'wpMovesubpages', false ); |
89 | | - $this->deleteAndMove = $wgRequest->getBool( 'wpDeleteAndMove' ) && $wgRequest->getBool( 'wpConfirm' ); |
90 | | - $this->moveOverShared = $wgRequest->getBool( 'wpMoveOverSharedFile', false ); |
91 | | - $this->watch = $wgRequest->getCheck( 'wpWatch' ) && $wgUser->isLoggedIn(); |
| 82 | + $this->reason = $request->getText( 'wpReason' ); |
| 83 | + $this->moveTalk = $request->getBool( 'wpMovetalk', $def ); |
| 84 | + $this->fixRedirects = $request->getBool( 'wpFixRedirects', $def ); |
| 85 | + $this->leaveRedirect = $request->getBool( 'wpLeaveRedirect', $def ); |
| 86 | + $this->moveSubpages = $request->getBool( 'wpMovesubpages', false ); |
| 87 | + $this->deleteAndMove = $request->getBool( 'wpDeleteAndMove' ) && $request->getBool( 'wpConfirm' ); |
| 88 | + $this->moveOverShared = $request->getBool( 'wpMoveOverSharedFile', false ); |
| 89 | + $this->watch = $request->getCheck( 'wpWatch' ) && $user->isLoggedIn(); |
92 | 90 | |
93 | | - if ( 'submit' == $wgRequest->getVal( 'action' ) && $wgRequest->wasPosted() |
94 | | - && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) { |
| 91 | + if ( 'submit' == $request->getVal( 'action' ) && $request->wasPosted() |
| 92 | + && $user->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) { |
95 | 93 | $this->doSubmit(); |
96 | 94 | } else { |
97 | 95 | $this->showForm( '' ); |
— | — | @@ -105,17 +103,16 @@ |
106 | 104 | * OutputPage::wrapWikiMsg(). |
107 | 105 | */ |
108 | 106 | function showForm( $err ) { |
109 | | - global $wgOut, $wgUser, $wgContLang, $wgFixDoubleRedirects; |
| 107 | + global $wgContLang, $wgFixDoubleRedirects, $wgMaximumMovedPages; |
110 | 108 | |
111 | | - $skin = $this->getSkin(); |
| 109 | + $this->getSkin()->setRelevantTitle( $this->oldTitle ); |
112 | 110 | |
113 | | - $oldTitleLink = $skin->link( $this->oldTitle ); |
| 111 | + $oldTitleLink = Linker::link( $this->oldTitle ); |
114 | 112 | |
115 | | - $wgOut->setPagetitle( wfMsg( 'move-page', $this->oldTitle->getPrefixedText() ) ); |
116 | | - $skin->setRelevantTitle( $this->oldTitle ); |
| 113 | + $out = $this->getOutput(); |
| 114 | + $out->setPagetitle( wfMsg( 'move-page', $this->oldTitle->getPrefixedText() ) ); |
| 115 | + $out->addModules( 'mediawiki.special.movePage' ); |
117 | 116 | |
118 | | - $wgOut->addModules( 'mediawiki.special.movePage' ); |
119 | | - |
120 | 117 | $newTitle = $this->newTitle; |
121 | 118 | |
122 | 119 | if( !$newTitle ) { |
— | — | @@ -135,8 +132,10 @@ |
136 | 133 | } |
137 | 134 | } |
138 | 135 | |
139 | | - if ( !empty($err) && $err[0] == 'articleexists' && $wgUser->isAllowed( 'delete' ) ) { |
140 | | - $wgOut->addWikiMsg( 'delete_and_move_text', $newTitle->getPrefixedText() ); |
| 136 | + $user = $this->getUser(); |
| 137 | + |
| 138 | + if ( !empty($err) && $err[0] == 'articleexists' && $user->isAllowed( 'delete' ) ) { |
| 139 | + $out->addWikiMsg( 'delete_and_move_text', $newTitle->getPrefixedText() ); |
141 | 140 | $movepagebtn = wfMsg( 'delete_and_move' ); |
142 | 141 | $submitVar = 'wpDeleteAndMove'; |
143 | 142 | $confirm = " |
— | — | @@ -149,17 +148,17 @@ |
150 | 149 | $err = ''; |
151 | 150 | } else { |
152 | 151 | if ($this->oldTitle->getNamespace() == NS_USER && !$this->oldTitle->isSubpage() ) { |
153 | | - $wgOut->wrapWikiMsg( "<div class=\"error mw-moveuserpage-warning\">\n$1\n</div>", 'moveuserpage-warning' ); |
| 152 | + $out->wrapWikiMsg( "<div class=\"error mw-moveuserpage-warning\">\n$1\n</div>", 'moveuserpage-warning' ); |
154 | 153 | } |
155 | | - $wgOut->addWikiMsg( $wgFixDoubleRedirects ? 'movepagetext' : |
| 154 | + $out->addWikiMsg( $wgFixDoubleRedirects ? 'movepagetext' : |
156 | 155 | 'movepagetext-noredirectfixer' ); |
157 | 156 | $movepagebtn = wfMsg( 'movepagebtn' ); |
158 | 157 | $submitVar = 'wpMove'; |
159 | 158 | $confirm = false; |
160 | 159 | } |
161 | 160 | |
162 | | - if ( !empty($err) && $err[0] == 'file-exists-sharedrepo' && $wgUser->isAllowed( 'reupload-shared' ) ) { |
163 | | - $wgOut->addWikiMsg( 'move-over-sharedrepo', $newTitle->getPrefixedText() ); |
| 161 | + if ( !empty($err) && $err[0] == 'file-exists-sharedrepo' && $user->isAllowed( 'reupload-shared' ) ) { |
| 162 | + $out->addWikiMsg( 'move-over-sharedrepo', $newTitle->getPrefixedText() ); |
164 | 163 | $submitVar = 'wpMoveOverSharedFile'; |
165 | 164 | $err = ''; |
166 | 165 | } |
— | — | @@ -179,19 +178,19 @@ |
180 | 179 | } |
181 | 180 | |
182 | 181 | if ( $considerTalk ) { |
183 | | - $wgOut->addWikiMsg( 'movepagetalktext' ); |
| 182 | + $out->addWikiMsg( 'movepagetalktext' ); |
184 | 183 | } |
185 | 184 | |
186 | | - $token = htmlspecialchars( $wgUser->editToken() ); |
| 185 | + $token = htmlspecialchars( $user->editToken() ); |
187 | 186 | |
188 | 187 | if ( !empty($err) ) { |
189 | | - $wgOut->setSubtitle( wfMsg( 'formerror' ) ); |
| 188 | + $out->setSubtitle( wfMsg( 'formerror' ) ); |
190 | 189 | if( $err[0] == 'hookaborted' ) { |
191 | 190 | $hookErr = $err[1]; |
192 | 191 | $errMsg = "<p><strong class=\"error\">$hookErr</strong></p>\n"; |
193 | | - $wgOut->addHTML( $errMsg ); |
| 192 | + $out->addHTML( $errMsg ); |
194 | 193 | } else { |
195 | | - $wgOut->wrapWikiMsg( "<p><strong class=\"error\">\n$1\n</strong></p>", $err ); |
| 194 | + $out->wrapWikiMsg( "<p><strong class=\"error\">\n$1\n</strong></p>", $err ); |
196 | 195 | } |
197 | 196 | } |
198 | 197 | |
— | — | @@ -205,13 +204,13 @@ |
206 | 205 | $noticeMsg = 'protectedpagemovewarning'; |
207 | 206 | $classes[] = 'mw-textarea-protected'; |
208 | 207 | } |
209 | | - $wgOut->addHTML( "<div class='mw-warning-with-logexcerpt'>\n" ); |
210 | | - $wgOut->addWikiMsg( $noticeMsg ); |
211 | | - LogEventsList::showLogExtract( $wgOut, 'protect', $this->oldTitle->getPrefixedText(), '', array( 'lim' => 1 ) ); |
212 | | - $wgOut->addHTML( "</div>\n" ); |
| 208 | + $out->addHTML( "<div class='mw-warning-with-logexcerpt'>\n" ); |
| 209 | + $out->addWikiMsg( $noticeMsg ); |
| 210 | + LogEventsList::showLogExtract( $out, 'protect', $this->oldTitle->getPrefixedText(), '', array( 'lim' => 1 ) ); |
| 211 | + $out->addHTML( "</div>\n" ); |
213 | 212 | } |
214 | 213 | |
215 | | - $wgOut->addHTML( |
| 214 | + $out->addHTML( |
216 | 215 | Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalURL( 'action=submit' ), 'id' => 'movepage' ) ) . |
217 | 216 | Xml::openElement( 'fieldset' ) . |
218 | 217 | Xml::element( 'legend', null, wfMsg( 'move-page-legend' ) ) . |
— | — | @@ -245,7 +244,7 @@ |
246 | 245 | ); |
247 | 246 | |
248 | 247 | if( $considerTalk ) { |
249 | | - $wgOut->addHTML( " |
| 248 | + $out->addHTML( " |
250 | 249 | <tr> |
251 | 250 | <td></td> |
252 | 251 | <td class='mw-input'>" . |
— | — | @@ -255,8 +254,8 @@ |
256 | 255 | ); |
257 | 256 | } |
258 | 257 | |
259 | | - if ( $wgUser->isAllowed( 'suppressredirect' ) ) { |
260 | | - $wgOut->addHTML( " |
| 258 | + if ( $user->isAllowed( 'suppressredirect' ) ) { |
| 259 | + $out->addHTML( " |
261 | 260 | <tr> |
262 | 261 | <td></td> |
263 | 262 | <td class='mw-input' >" . |
— | — | @@ -268,7 +267,7 @@ |
269 | 268 | } |
270 | 269 | |
271 | 270 | if ( $hasRedirects ) { |
272 | | - $wgOut->addHTML( " |
| 271 | + $out->addHTML( " |
273 | 272 | <tr> |
274 | 273 | <td></td> |
275 | 274 | <td class='mw-input' >" . |
— | — | @@ -280,11 +279,9 @@ |
281 | 280 | } |
282 | 281 | |
283 | 282 | if( ($this->oldTitle->hasSubpages() || $this->oldTitle->getTalkPage()->hasSubpages()) |
284 | | - && $this->oldTitle->userCan( 'move-subpages' ) ) |
| 283 | + && !count( $this->oldTitle->getUserPermissionsErrors( 'move-subpages', $user ) ) ) |
285 | 284 | { |
286 | | - global $wgMaximumMovedPages, $wgLang; |
287 | | - |
288 | | - $wgOut->addHTML( " |
| 285 | + $out->addHTML( " |
289 | 286 | <tr> |
290 | 287 | <td></td> |
291 | 288 | <td class=\"mw-input\">" . |
— | — | @@ -301,7 +298,7 @@ |
302 | 299 | ? 'move-subpages' |
303 | 300 | : 'move-talk-subpages' ), |
304 | 301 | array( 'parseinline' ), |
305 | | - $wgLang->formatNum( $wgMaximumMovedPages ), |
| 302 | + $this->getLang()->formatNum( $wgMaximumMovedPages ), |
306 | 303 | # $2 to allow use of PLURAL in message. |
307 | 304 | $wgMaximumMovedPages |
308 | 305 | ) |
— | — | @@ -311,11 +308,11 @@ |
312 | 309 | ); |
313 | 310 | } |
314 | 311 | |
315 | | - $watchChecked = $wgUser->isLoggedIn() && ($this->watch || $wgUser->getBoolOption( 'watchmoves' ) |
| 312 | + $watchChecked = $user->isLoggedIn() && ($this->watch || $user->getBoolOption( 'watchmoves' ) |
316 | 313 | || $this->oldTitle->userIsWatching()); |
317 | 314 | # Don't allow watching if user is not logged in |
318 | | - if( $wgUser->isLoggedIn() ) { |
319 | | - $wgOut->addHTML( " |
| 315 | + if( $user->isLoggedIn() ) { |
| 316 | + $out->addHTML( " |
320 | 317 | <tr> |
321 | 318 | <td></td> |
322 | 319 | <td class='mw-input'>" . |
— | — | @@ -324,7 +321,7 @@ |
325 | 322 | </tr>"); |
326 | 323 | } |
327 | 324 | |
328 | | - $wgOut->addHTML( " |
| 325 | + $out->addHTML( " |
329 | 326 | {$confirm} |
330 | 327 | <tr> |
331 | 328 | <td> </td> |
— | — | @@ -339,32 +336,31 @@ |
340 | 337 | "\n" |
341 | 338 | ); |
342 | 339 | |
343 | | - $this->showLogFragment( $this->oldTitle, $wgOut ); |
344 | | - $this->showSubpages( $this->oldTitle, $wgOut ); |
| 340 | + $this->showLogFragment( $this->oldTitle ); |
| 341 | + $this->showSubpages( $this->oldTitle ); |
345 | 342 | |
346 | 343 | } |
347 | 344 | |
348 | 345 | function doSubmit() { |
349 | | - global $wgOut, $wgUser, $wgMaximumMovedPages, $wgLang; |
350 | | - global $wgFixDoubleRedirects; |
| 346 | + global $wgMaximumMovedPages, $wgFixDoubleRedirects, $wgDeleteRevisionsLimit; |
351 | 347 | |
352 | | - if ( $wgUser->pingLimiter( 'move' ) ) { |
353 | | - $wgOut->rateLimited(); |
354 | | - return; |
| 348 | + $user = $this->getUser(); |
| 349 | + |
| 350 | + if ( $user->pingLimiter( 'move' ) ) { |
| 351 | + throw new ThrottledError; |
355 | 352 | } |
356 | 353 | |
357 | 354 | $ot = $this->oldTitle; |
358 | 355 | $nt = $this->newTitle; |
359 | 356 | |
360 | 357 | # Delete to make way if requested |
361 | | - if ( $wgUser->isAllowed( 'delete' ) && $this->deleteAndMove ) { |
| 358 | + if ( $user->isAllowed( 'delete' ) && $this->deleteAndMove ) { |
362 | 359 | $article = new Article( $nt ); |
363 | 360 | |
364 | 361 | # Disallow deletions of big articles |
365 | 362 | $bigHistory = $article->isBigDeletion(); |
366 | | - if( $bigHistory && !$nt->userCan( 'bigdelete' ) ) { |
367 | | - global $wgDeleteRevisionsLimit; |
368 | | - $this->showForm( array('delete-toobig', $wgLang->formatNum( $wgDeleteRevisionsLimit ) ) ); |
| 363 | + if( $bigHistory && count( $nt->getUserPermissionsErrors( 'bigdelete', $user ) ) ) { |
| 364 | + $this->showForm( array('delete-toobig', $this->getLang()->formatNum( $wgDeleteRevisionsLimit ) ) ); |
369 | 365 | return; |
370 | 366 | } |
371 | 367 | |
— | — | @@ -386,7 +382,7 @@ |
387 | 383 | |
388 | 384 | # Show a warning if the target file exists on a shared repo |
389 | 385 | if ( $nt->getNamespace() == NS_FILE |
390 | | - && !( $this->moveOverShared && $wgUser->isAllowed( 'reupload-shared' ) ) |
| 386 | + && !( $this->moveOverShared && $user->isAllowed( 'reupload-shared' ) ) |
391 | 387 | && !RepoGroup::singleton()->getLocalRepo()->findFile( $nt ) |
392 | 388 | && wfFindFile( $nt ) ) |
393 | 389 | { |
— | — | @@ -395,7 +391,7 @@ |
396 | 392 | |
397 | 393 | } |
398 | 394 | |
399 | | - if ( $wgUser->isAllowed( 'suppressredirect' ) ) { |
| 395 | + if ( $user->isAllowed( 'suppressredirect' ) ) { |
400 | 396 | $createRedirect = $this->leaveRedirect; |
401 | 397 | } else { |
402 | 398 | $createRedirect = true; |
— | — | @@ -415,7 +411,8 @@ |
416 | 412 | |
417 | 413 | wfRunHooks( 'SpecialMovepageAfterMove', array( &$this, &$ot, &$nt ) ); |
418 | 414 | |
419 | | - $wgOut->setPagetitle( wfMsg( 'pagemovedsub' ) ); |
| 415 | + $out = $this->getOutput(); |
| 416 | + $out->setPagetitle( wfMsg( 'pagemovedsub' ) ); |
420 | 417 | |
421 | 418 | $oldUrl = $ot->getFullUrl( 'redirect=no' ); |
422 | 419 | $newUrl = $nt->getFullUrl(); |
— | — | @@ -425,8 +422,8 @@ |
426 | 423 | $newLink = "<span class='plainlinks'>[$newUrl $newText]</span>"; |
427 | 424 | |
428 | 425 | $msgName = $createRedirect ? 'movepage-moved-redirect' : 'movepage-moved-noredirect'; |
429 | | - $wgOut->addWikiMsg( 'movepage-moved', $oldLink, $newLink, $oldText, $newText ); |
430 | | - $wgOut->addWikiMsg( $msgName ); |
| 426 | + $out->addWikiMsg( 'movepage-moved', $oldLink, $newLink, $oldText, $newText ); |
| 427 | + $out->addWikiMsg( $msgName ); |
431 | 428 | |
432 | 429 | # Now we move extra pages we've been asked to move: subpages and talk |
433 | 430 | # pages. First, if the old page or the new page is a talk page, we |
— | — | @@ -435,7 +432,7 @@ |
436 | 433 | $this->moveTalk = false; |
437 | 434 | } |
438 | 435 | |
439 | | - if( !$ot->userCan( 'move-subpages' ) ) { |
| 436 | + if ( count( $ot->getUserPermissionsErrors( 'move-subpages', $user ) ) ) { |
440 | 437 | $this->moveSubpages = false; |
441 | 438 | } |
442 | 439 | |
— | — | @@ -492,7 +489,6 @@ |
493 | 490 | } |
494 | 491 | |
495 | 492 | $extraOutput = array(); |
496 | | - $skin = $this->getSkin(); |
497 | 493 | $count = 1; |
498 | 494 | foreach( $extraPages as $oldSubpage ) { |
499 | 495 | if( $ot->equals( $oldSubpage ) ) { |
— | — | @@ -514,7 +510,7 @@ |
515 | 511 | # be longer than 255 characters. |
516 | 512 | $newSubpage = Title::makeTitleSafe( $newNs, $newPageName ); |
517 | 513 | if( !$newSubpage ) { |
518 | | - $oldLink = $skin->linkKnown( $oldSubpage ); |
| 514 | + $oldLink = Linker::linkKnown( $oldSubpage ); |
519 | 515 | $extraOutput []= wfMsgHtml( 'movepage-page-unmoved', $oldLink, |
520 | 516 | htmlspecialchars(Title::makeName( $newNs, $newPageName ))); |
521 | 517 | continue; |
— | — | @@ -522,7 +518,7 @@ |
523 | 519 | |
524 | 520 | # This was copy-pasted from Renameuser, bleh. |
525 | 521 | if ( $newSubpage->exists() && !$oldSubpage->isValidMoveTarget( $newSubpage ) ) { |
526 | | - $link = $skin->linkKnown( $newSubpage ); |
| 522 | + $link = Linker::linkKnown( $newSubpage ); |
527 | 523 | $extraOutput []= wfMsgHtml( 'movepage-page-exists', $link ); |
528 | 524 | } else { |
529 | 525 | $success = $oldSubpage->moveTo( $newSubpage, true, $this->reason, $createRedirect ); |
— | — | @@ -530,22 +526,22 @@ |
531 | 527 | if ( $this->fixRedirects ) { |
532 | 528 | DoubleRedirectJob::fixRedirects( 'move', $oldSubpage, $newSubpage ); |
533 | 529 | } |
534 | | - $oldLink = $skin->linkKnown( |
| 530 | + $oldLink = Linker::linkKnown( |
535 | 531 | $oldSubpage, |
536 | 532 | null, |
537 | 533 | array(), |
538 | 534 | array( 'redirect' => 'no' ) |
539 | 535 | ); |
540 | | - $newLink = $skin->linkKnown( $newSubpage ); |
| 536 | + $newLink = Linker::linkKnown( $newSubpage ); |
541 | 537 | $extraOutput []= wfMsgHtml( 'movepage-page-moved', $oldLink, $newLink ); |
542 | 538 | ++$count; |
543 | 539 | if( $count >= $wgMaximumMovedPages ) { |
544 | | - $extraOutput []= wfMsgExt( 'movepage-max-pages', array( 'parsemag', 'escape' ), $wgLang->formatNum( $wgMaximumMovedPages ) ); |
| 540 | + $extraOutput []= wfMsgExt( 'movepage-max-pages', array( 'parsemag', 'escape' ), $this->getLang()->formatNum( $wgMaximumMovedPages ) ); |
545 | 541 | break; |
546 | 542 | } |
547 | 543 | } else { |
548 | | - $oldLink = $skin->linkKnown( $oldSubpage ); |
549 | | - $newLink = $skin->link( $newSubpage ); |
| 544 | + $oldLink = Linker::linkKnown( $oldSubpage ); |
| 545 | + $newLink = Linker::link( $newSubpage ); |
550 | 546 | $extraOutput []= wfMsgHtml( 'movepage-page-unmoved', $oldLink, $newLink ); |
551 | 547 | } |
552 | 548 | } |
— | — | @@ -553,16 +549,16 @@ |
554 | 550 | } |
555 | 551 | |
556 | 552 | if( $extraOutput !== array() ) { |
557 | | - $wgOut->addHTML( "<ul>\n<li>" . implode( "</li>\n<li>", $extraOutput ) . "</li>\n</ul>" ); |
| 553 | + $out->addHTML( "<ul>\n<li>" . implode( "</li>\n<li>", $extraOutput ) . "</li>\n</ul>" ); |
558 | 554 | } |
559 | 555 | |
560 | 556 | # Deal with watches (we don't watch subpages) |
561 | | - if( $this->watch && $wgUser->isLoggedIn() ) { |
562 | | - $wgUser->addWatch( $ot ); |
563 | | - $wgUser->addWatch( $nt ); |
| 557 | + if( $this->watch && $user->isLoggedIn() ) { |
| 558 | + $user->addWatch( $ot ); |
| 559 | + $user->addWatch( $nt ); |
564 | 560 | } else { |
565 | | - $wgUser->removeWatch( $ot ); |
566 | | - $wgUser->removeWatch( $nt ); |
| 561 | + $user->removeWatch( $ot ); |
| 562 | + $user->removeWatch( $nt ); |
567 | 563 | } |
568 | 564 | |
569 | 565 | # Re-clear the file redirect cache, which may have been polluted by |
— | — | @@ -573,20 +569,20 @@ |
574 | 570 | } |
575 | 571 | } |
576 | 572 | |
577 | | - function showLogFragment( $title, &$out ) { |
| 573 | + function showLogFragment( $title ) { |
| 574 | + $out = $this->getOutput(); |
578 | 575 | $out->addHTML( Xml::element( 'h2', null, LogPage::logName( 'move' ) ) ); |
579 | 576 | LogEventsList::showLogExtract( $out, 'move', $title->getPrefixedText() ); |
580 | 577 | } |
581 | 578 | |
582 | | - function showSubpages( $title, $out ) { |
583 | | - global $wgLang; |
584 | | - |
| 579 | + function showSubpages( $title ) { |
585 | 580 | if( !MWNamespace::hasSubpages( $title->getNamespace() ) ) |
586 | 581 | return; |
587 | 582 | |
588 | 583 | $subpages = $title->getSubpages(); |
589 | 584 | $count = $subpages instanceof TitleArray ? $subpages->count() : 0; |
590 | 585 | |
| 586 | + $out = $this->getOutput(); |
591 | 587 | $out->wrapWikiMsg( '== $1 ==', array( 'movesubpage', $count ) ); |
592 | 588 | |
593 | 589 | # No subpages. |
— | — | @@ -595,12 +591,11 @@ |
596 | 592 | return; |
597 | 593 | } |
598 | 594 | |
599 | | - $out->addWikiMsg( 'movesubpagetext', $wgLang->formatNum( $count ) ); |
600 | | - $skin = $this->getSkin(); |
| 595 | + $out->addWikiMsg( 'movesubpagetext', $this->getLang()->formatNum( $count ) ); |
601 | 596 | $out->addHTML( "<ul>\n" ); |
602 | 597 | |
603 | 598 | foreach( $subpages as $subpage ) { |
604 | | - $link = $skin->link( $subpage ); |
| 599 | + $link = Linker::link( $subpage ); |
605 | 600 | $out->addHTML( "<li>$link</li>\n" ); |
606 | 601 | } |
607 | 602 | $out->addHTML( "</ul>\n" ); |