Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php |
— | — | @@ -241,7 +241,6 @@ |
242 | 242 | public function listPages() { |
243 | 243 | global $wgOut; |
244 | 244 | $out = $wgOut; |
245 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
246 | 245 | |
247 | 246 | $res = $this->loadPagesFromDB(); |
248 | 247 | $allpages = $this->buildPageArray( $res ); |
— | — | @@ -257,7 +256,7 @@ |
258 | 257 | $wgOut->addWikiMsg( 'tpt-new-pages', count( $pages ) ); |
259 | 258 | $out->addHtml( '<ol>' ); |
260 | 259 | foreach ( $pages as $page ) { |
261 | | - $link = $linker->link( $page['title'] ); |
| 260 | + $link = Linker::link( $page['title'] ); |
262 | 261 | $acts = $this->actionLinks( $page, 'proposed' ); |
263 | 262 | $out->addHtml( "<li>$link $acts</li>" ); |
264 | 263 | } |
— | — | @@ -270,7 +269,7 @@ |
271 | 270 | $out->addWikiMsg( 'tpt-old-pages', count( $pages ) ); |
272 | 271 | $out->addHtml( '<ol>' ); |
273 | 272 | foreach ( $pages as $page ) { |
274 | | - $link = $linker->link( $page['title'] ); |
| 273 | + $link = Linker::link( $page['title'] ); |
275 | 274 | if ( $page['tp:mark'] !== $page['tp:tag'] ) { |
276 | 275 | $link = "<b>$link</b>"; |
277 | 276 | } |
— | — | @@ -287,7 +286,7 @@ |
288 | 287 | $out->addWikiMsg( 'tpt-other-pages', count( $pages ) ); |
289 | 288 | $out->addHtml( '<ol>' ); |
290 | 289 | foreach ( $pages as $page ) { |
291 | | - $link = $linker->link( $page['title'] ); |
| 290 | + $link = Linker::link( $page['title'] ); |
292 | 291 | $acts = $this->actionLinks( $page, 'broken' ); |
293 | 292 | $out->addHtml( "<li>$link $acts</li>" ); |
294 | 293 | } |
— | — | @@ -300,7 +299,7 @@ |
301 | 300 | $out->addWikiMsg( 'tpt-discouraged-pages', count( $pages ) ); |
302 | 301 | $out->addHtml( '<ol>' ); |
303 | 302 | foreach ( $pages as $page ) { |
304 | | - $link = $linker->link( $page['title'] ); |
| 303 | + $link = Linker::link( $page['title'] ); |
305 | 304 | if ( $page['tp:mark'] !== $page['tp:tag'] ) { |
306 | 305 | $link = "<b>$link</b>"; |
307 | 306 | } |
— | — | @@ -320,7 +319,6 @@ |
321 | 320 | */ |
322 | 321 | protected function actionLinks( array $page, $type ) { |
323 | 322 | $actions = array(); |
324 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
325 | 323 | |
326 | 324 | $title = $page['title']; |
327 | 325 | |
— | — | @@ -329,7 +327,7 @@ |
330 | 328 | |
331 | 329 | $pending = $type === 'active' && $page['latest'] !== $page['tp:mark']; |
332 | 330 | if ( $type === 'proposed' || $pending ) { |
333 | | - $actions[] = $linker->link( |
| 331 | + $actions[] = Linker::link( |
334 | 332 | $this->getTitle(), |
335 | 333 | wfMsgHtml( 'tpt-rev-mark' ), |
336 | 334 | array( 'title' => wfMsg( 'tpt-rev-mark-tooltip' ) ), |
— | — | @@ -341,7 +339,7 @@ |
342 | 340 | ) |
343 | 341 | ); |
344 | 342 | } elseif ( $type === 'broken' ) { |
345 | | - $actions[] = $linker->link( |
| 343 | + $actions[] = Linker::link( |
346 | 344 | $this->getTitle(), |
347 | 345 | wfMsgHtml( 'tpt-rev-unmark' ), |
348 | 346 | array( 'title' => wfMsg( 'tpt-rev-unmark-tooltip' ) ), |
— | — | @@ -355,7 +353,7 @@ |
356 | 354 | } |
357 | 355 | |
358 | 356 | if ( $type === 'active' ) { |
359 | | - $actions[] = $linker->link( |
| 357 | + $actions[] = Linker::link( |
360 | 358 | $this->getTitle(), |
361 | 359 | wfMsgHtml( 'tpt-rev-discourage' ), |
362 | 360 | array( 'title' => wfMsg( 'tpt-rev-discourage-tooltip' ) ), |
— | — | @@ -367,7 +365,7 @@ |
368 | 366 | ) |
369 | 367 | ); |
370 | 368 | } elseif ( $type === 'discouraged' ) { |
371 | | - $actions[] = $linker->link( |
| 369 | + $actions[] = Linker::link( |
372 | 370 | $this->getTitle(), |
373 | 371 | wfMsgHtml( 'tpt-rev-encourage' ), |
374 | 372 | array( 'title' => wfMsg( 'tpt-rev-encourage-tooltip' ) ), |
Index: trunk/extensions/Translate/tag/PageTranslationHooks.php |
— | — | @@ -205,9 +205,6 @@ |
206 | 206 | |
207 | 207 | $userLangCode = $options->getUserLang(); |
208 | 208 | |
209 | | - // BC for <1.19 |
210 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
211 | | - |
212 | 209 | $languages = array(); |
213 | 210 | foreach ( $status as $code => $percent ) { |
214 | 211 | $name = TranslateUtils::getLanguageName( $code, false, $userLangCode ); |
— | — | @@ -241,7 +238,7 @@ |
242 | 239 | if ( $code === $userLangCode ) { |
243 | 240 | $name = Html::rawElement( 'span', array( 'class' => 'mw-pt-languages-ui' ), $name ); |
244 | 241 | } |
245 | | - $languages[] = $linker->linkKnown( $_title, "$name $percent" ); |
| 242 | + $languages[] = Linker::linkKnown( $_title, "$name $percent" ); |
246 | 243 | } |
247 | 244 | } |
248 | 245 | |
— | — | @@ -405,7 +402,6 @@ |
406 | 403 | $ready = $page->getReadyTag(); |
407 | 404 | |
408 | 405 | $title = $page->getTitle(); |
409 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
410 | 406 | |
411 | 407 | $latest = $title->getLatestRevId(); |
412 | 408 | $canmark = $ready === $latest && $marked !== $latest; |
— | — | @@ -421,7 +417,7 @@ |
422 | 418 | |
423 | 419 | $translate = SpecialPage::getTitleFor( 'Translate' ); |
424 | 420 | $linkDesc = wfMsgHtml( 'translate-tag-translate-link-desc' ); |
425 | | - $actions[] = $linker->link( $translate, $linkDesc, array(), $par ); |
| 421 | + $actions[] = Linker::link( $translate, $linkDesc, array(), $par ); |
426 | 422 | } |
427 | 423 | |
428 | 424 | if ( $canmark ) { |
— | — | @@ -433,7 +429,7 @@ |
434 | 430 | // This page has never been marked |
435 | 431 | if ( $marked === false ) { |
436 | 432 | $linkDesc = wfMsgHtml( 'translate-tag-markthis' ); |
437 | | - $actions[] = $linker->link( $translate, $linkDesc, array(), $par ); |
| 433 | + $actions[] = Linker::link( $translate, $linkDesc, array(), $par ); |
438 | 434 | } else { |
439 | 435 | $markUrl = $translate->getFullUrl( $par ); |
440 | 436 | $actions[] = wfMsgExt( 'translate-tag-markthisagain', 'parseinline', $diffUrl, $markUrl ); |
— | — | @@ -575,8 +571,9 @@ |
576 | 572 | public static function replaceSubtitle( &$subpages, $skin = null , $out = null ) { |
577 | 573 | global $wgOut; |
578 | 574 | // $out was only added in some MW version |
579 | | - if ( $out === null ) $out = $wgOut; |
580 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
| 575 | + if ( $out === null ) { |
| 576 | + $out = $wgOut; |
| 577 | + } |
581 | 578 | |
582 | 579 | if ( !TranslatablePage::isTranslationPage( $out->getTitle() ) |
583 | 580 | && !TranslatablePage::isSourcePage( $out->getTitle() ) ) { |
— | — | @@ -603,7 +600,7 @@ |
604 | 601 | $linkObj = Title::newFromText( $growinglink ); |
605 | 602 | |
606 | 603 | if ( is_object( $linkObj ) && $linkObj->exists() ) { |
607 | | - $getlink = $linker->linkKnown( |
| 604 | + $getlink = Linker::linkKnown( |
608 | 605 | SpecialPage::getTitleFor( 'MyLanguage', $growinglink ), |
609 | 606 | htmlspecialchars( $display ) |
610 | 607 | ); |
Index: trunk/extensions/Translate/TranslateHooks.php |
— | — | @@ -313,11 +313,10 @@ |
314 | 314 | global $wgLang, $wgContLang; |
315 | 315 | |
316 | 316 | $language = $forUI === null ? $wgContLang : $wgLang; |
317 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
318 | 317 | |
319 | 318 | if ( $action === 'message' ) { |
320 | 319 | $link = $forUI ? |
321 | | - $linker->link( $title, null, array(), array( 'oldid' => $params[0] ) ) : |
| 320 | + Linker::link( $title, null, array(), array( 'oldid' => $params[0] ) ) : |
322 | 321 | $title->getPrefixedText(); |
323 | 322 | return wfMessage( 'logentry-translationreview-message' )->params( |
324 | 323 | '', // User link in the new system |
— | — | @@ -339,7 +338,7 @@ |
340 | 339 | $newState = $newStateMessage->isBlank() ? $newState : $newStateMessage->text(); |
341 | 340 | |
342 | 341 | $link = $forUI ? |
343 | | - $linker->link( $title, $groupLabel, array(), array( 'language' => $languageCode ) ) : |
| 342 | + Linker::link( $title, $groupLabel, array(), array( 'language' => $languageCode ) ) : |
344 | 343 | $groupLabel; |
345 | 344 | |
346 | 345 | return wfMessage( 'logentry-groupreview-message' )->params( |
Index: trunk/extensions/Translate/utils/MessageTable.php |
— | — | @@ -128,8 +128,7 @@ |
129 | 129 | global $wgLang; |
130 | 130 | $niceTitle = htmlspecialchars( $wgLang->truncate( $title->getPrefixedText(), -35 ) ); |
131 | 131 | |
132 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker() : new Linker(); |
133 | | - $tools['edit'] = $linker->link( |
| 132 | + $tools['edit'] = Linker::link( |
134 | 133 | $title, |
135 | 134 | $niceTitle, |
136 | 135 | TranslationEditPage::jsEdit( $title, $this->group->getId() ), |
Index: trunk/extensions/Translate/utils/StatsTable.php |
— | — | @@ -231,8 +231,7 @@ |
232 | 232 | 'title' => $this->getGroupDescription( $group ) |
233 | 233 | ); |
234 | 234 | |
235 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
236 | | - $translateGroupLink = $linker->link( |
| 235 | + $translateGroupLink = Linker::link( |
237 | 236 | $this->translate, $this->getGroupLabel( $group ), $attributes, $queryParameters |
238 | 237 | ); |
239 | 238 | |
Index: trunk/extensions/Translate/utils/TranslationHelpers.php |
— | — | @@ -684,8 +684,7 @@ |
685 | 685 | $this->mustHaveDefinition(); |
686 | 686 | $en = $this->getDefinition(); |
687 | 687 | |
688 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
689 | | - $title = $linker->link( |
| 688 | + $title = Linker::link( |
690 | 689 | SpecialPage::getTitleFor( 'Translate' ), |
691 | 690 | htmlspecialchars( $this->group->getLabel() ), |
692 | 691 | array(), |
— | — | @@ -1288,8 +1287,7 @@ |
1289 | 1288 | |
1290 | 1289 | $jsEdit = TranslationEditPage::jsEdit( $target, $groupId ); |
1291 | 1290 | |
1292 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker() : new Linker(); |
1293 | | - return $linker->link( $target, $text, $jsEdit, $params ); |
| 1291 | + return Linker::link( $target, $text, $jsEdit, $params ); |
1294 | 1292 | } |
1295 | 1293 | |
1296 | 1294 | /** |
Index: trunk/extensions/Translate/specials/SpecialManageGroups.php |
— | — | @@ -44,7 +44,6 @@ |
45 | 45 | |
46 | 46 | public function execute( $par ) { |
47 | 47 | global $wgRequest; |
48 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
49 | 48 | |
50 | 49 | $this->out->setPageTitle( htmlspecialchars( wfMsg( 'translate-managegroups' ) ) ); |
51 | 50 | |
— | — | @@ -102,7 +101,7 @@ |
103 | 102 | wfDebug( __METHOD__ . ": {$group->getId()}\n" ); |
104 | 103 | |
105 | 104 | $id = $group->getId(); |
106 | | - $link = $linker->link( $this->getTitle(), $group->getLabel(), |
| 105 | + $link = Linker::link( $this->getTitle(), $group->getLabel(), |
107 | 106 | array( 'id' => "mw-group-$id" ), array( 'group' => $id ) ); |
108 | 107 | $out = $link . $separator; |
109 | 108 | |
— | — | @@ -417,8 +416,7 @@ |
418 | 417 | if ( $code === 'en' ) { |
419 | 418 | $this->doModLangs( $group ); |
420 | 419 | } else { |
421 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
422 | | - $this->out->addHTML( '<p>' . $linker->link( |
| 420 | + $this->out->addHTML( '<p>' . Linker::link( |
423 | 421 | $this->getTitle(), |
424 | 422 | wfMsgHtml( 'translate-manage-return-to-group' ), |
425 | 423 | array(), |
— | — | @@ -447,8 +445,7 @@ |
448 | 446 | continue; |
449 | 447 | } |
450 | 448 | |
451 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
452 | | - $link = $linker->link( |
| 449 | + $link = Linker::link( |
453 | 450 | $this->getTitle(), |
454 | 451 | htmlspecialchars( TranslateUtils::getLanguageName( $code, false, $wgLang->getCode() ) . " ($code)" ), |
455 | 452 | array(), |
— | — | @@ -498,14 +495,13 @@ |
499 | 496 | */ |
500 | 497 | protected function setSubtitle( $group, $code ) { |
501 | 498 | global $wgLang; |
502 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
503 | 499 | |
504 | | - $links[] = $linker->link( |
| 500 | + $links[] = Linker::link( |
505 | 501 | $this->getTitle(), |
506 | 502 | wfMsgHtml( 'translate-manage-subtitle' ) |
507 | 503 | ); |
508 | 504 | |
509 | | - $links[] = $linker->link( |
| 505 | + $links[] = Linker::link( |
510 | 506 | $this->getTitle(), |
511 | 507 | htmlspecialchars( $group->getLabel() ), |
512 | 508 | array(), |
— | — | @@ -515,7 +511,7 @@ |
516 | 512 | // Do not show language part for English. |
517 | 513 | if ( $code !== 'en' ) { |
518 | 514 | $langname = TranslateUtils::getLanguageName( $code, false, $wgLang->getCode() ); |
519 | | - $links[] = $linker->link( |
| 515 | + $links[] = Linker::link( |
520 | 516 | $this->getTitle(), |
521 | 517 | htmlspecialchars( $langname ), |
522 | 518 | array(), |
Index: trunk/extensions/Translate/specials/SpecialTranslate.php |
— | — | @@ -123,10 +123,9 @@ |
124 | 124 | if ( in_array( $taskid, array( 'untranslated', 'reviewall' ), true ) ) { |
125 | 125 | $hasOptional = count( $this->group->getTags( 'optional' ) ); |
126 | 126 | if ( $hasOptional ) { |
127 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
128 | 127 | $linktext = wfMessage( 'translate-page-description-hasoptional-open' )->escaped(); |
129 | 128 | $params = array( 'task' => 'optional' ) + $this->nondefaults; |
130 | | - $link = $linker->link( $this->getTitle(), $linktext, array(), $params ); |
| 129 | + $link = Linker::link( $this->getTitle(), $linktext, array(), $params ); |
131 | 130 | $note = wfMessage( 'translate-page-description-hasoptional' )->rawParams( $link )->parseAsBlock(); |
132 | 131 | |
133 | 132 | if ( $description ) { |
— | — | @@ -471,14 +470,12 @@ |
472 | 471 | } |
473 | 472 | |
474 | 473 | private function makeOffsetLink( $label, $offset ) { |
475 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
476 | | - |
477 | 474 | $query = array_merge( |
478 | 475 | $this->nondefaults, |
479 | 476 | array( 'offset' => $offset ) |
480 | 477 | ); |
481 | 478 | |
482 | | - $link = $linker->link( |
| 479 | + $link = Linker::link( |
483 | 480 | $this->getTitle(), |
484 | 481 | $label, |
485 | 482 | array(), |
— | — | @@ -547,9 +544,7 @@ |
548 | 545 | 'taction' => $this->options['taction'], |
549 | 546 | ); |
550 | 547 | |
551 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
552 | | - |
553 | | - $label = $linker->link( |
| 548 | + $label = Linker::link( |
554 | 549 | $title, |
555 | 550 | htmlspecialchars( $block->getLabel() ), |
556 | 551 | array(), |
Index: trunk/extensions/Translate/specials/SpecialMessageGroupStats.php |
— | — | @@ -215,8 +215,7 @@ |
216 | 216 | ); |
217 | 217 | |
218 | 218 | $text = htmlspecialchars( "$code: {$this->names[$code]}" ); |
219 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
220 | | - $link = $linker->link( $this->translate, $text, array(), $queryParameters ); |
| 219 | + $link = Linker::link( $this->translate, $text, array(), $queryParameters ); |
221 | 220 | return Html::rawElement( 'td', array(), $link ); |
222 | 221 | } |
223 | 222 | } |
Index: trunk/extensions/Translate/specials/SpecialLanguageStats.php |
— | — | @@ -225,9 +225,8 @@ |
226 | 226 | protected function outputIntroduction() { |
227 | 227 | global $wgOut, $wgLang, $wgUser; |
228 | 228 | |
229 | | - $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; |
230 | 229 | $languageName = TranslateUtils::getLanguageName( $this->target, false, $wgLang->getCode() ); |
231 | | - $rcInLangLink = $linker->link( |
| 230 | + $rcInLangLink = Linker::link( |
232 | 231 | SpecialPage::getTitleFor( 'Translate', '!recent' ), |
233 | 232 | wfMsgHtml( 'languagestats-recenttranslations' ), |
234 | 233 | array(), |