Index: trunk/phase3/includes/Linker.php |
— | — | @@ -227,6 +227,13 @@ |
228 | 228 | return $ret; |
229 | 229 | } |
230 | 230 | |
| 231 | + /** |
| 232 | + * Identical to link(), except $options defaults to 'known'. |
| 233 | + */ |
| 234 | + public function linkKnown( $target, $text = null, $customAttribs = array(), $query = array(), $options = 'known' ) { |
| 235 | + return $this->link( $target, $text, $customAttribs, $query, $options ); |
| 236 | + } |
| 237 | + |
231 | 238 | private function linkUrl( $target, $query, $options ) { |
232 | 239 | wfProfileIn( __METHOD__ ); |
233 | 240 | # We don't want to include fragments for broken links, because they |
Index: trunk/phase3/includes/ChangesList.php |
— | — | @@ -484,7 +484,7 @@ |
485 | 485 | // FIXME: Would be good to replace this extract() call with something |
486 | 486 | // that explicitly initializes variables. |
487 | 487 | extract( $rc->mAttribs ); |
488 | | - $curIdEq = 'curid=' . $rc_cur_id; |
| 488 | + $curIdEq = array( 'curid' => $rc_cur_id ); |
489 | 489 | |
490 | 490 | # If it's a new day, add the headline and flush the cache |
491 | 491 | $date = $wgLang->date( $rc_timestamp, true ); |
— | — | @@ -509,19 +509,21 @@ |
510 | 510 | // Page moves |
511 | 511 | if( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) { |
512 | 512 | $msg = ( $rc_type == RC_MOVE ) ? "1movedto2" : "1movedto2_redir"; |
513 | | - $clink = wfMsg( $msg, $this->skin->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ), |
514 | | - $this->skin->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) ); |
| 513 | + $clink = wfMsg( $msg, $this->skin->linkKnown( $rc->getTitle(), null, |
| 514 | + array(), array( 'redirect' => 'no' ) ), |
| 515 | + $this->skin->linkKnown( $rc->getMovedToTitle() ) ); |
515 | 516 | // New unpatrolled pages |
516 | 517 | } else if( $rc->unpatrolled && $rc_type == RC_NEW ) { |
517 | | - $clink = $this->skin->makeKnownLinkObj( $rc->getTitle(), '', "rcid={$rc_id}" ); |
| 518 | + $clink = $this->skin->linkKnown( $rc->getTitle(), null, array(), |
| 519 | + array( 'rcid' => $rc_id ) ); |
518 | 520 | // Log entries |
519 | 521 | } else if( $rc_type == RC_LOG ) { |
520 | 522 | if( $rc_log_type ) { |
521 | 523 | $logtitle = SpecialPage::getTitleFor( 'Log', $rc_log_type ); |
522 | | - $clink = '(' . $this->skin->makeKnownLinkObj( $logtitle, |
| 524 | + $clink = '(' . $this->skin->linkKnown( $logtitle, |
523 | 525 | LogPage::logName($rc_log_type) ) . ')'; |
524 | 526 | } else { |
525 | | - $clink = $this->skin->makeLinkObj( $rc->getTitle(), '' ); |
| 527 | + $clink = $this->skin->link( $rc->getTitle() ); |
526 | 528 | } |
527 | 529 | $watched = false; |
528 | 530 | // Log entries (old format) and special pages |
— | — | @@ -530,14 +532,14 @@ |
531 | 533 | if ( $specialName == 'Log' ) { |
532 | 534 | # Log updates, etc |
533 | 535 | $logname = LogPage::logName( $logtype ); |
534 | | - $clink = '(' . $this->skin->makeKnownLinkObj( $rc->getTitle(), $logname ) . ')'; |
| 536 | + $clink = '(' . $this->skin->linkKnown( $rc->getTitle(), $logname ) . ')'; |
535 | 537 | } else { |
536 | 538 | wfDebug( "Unexpected special page in recentchanges\n" ); |
537 | 539 | $clink = ''; |
538 | 540 | } |
539 | 541 | // Edits |
540 | 542 | } else { |
541 | | - $clink = $this->skin->makeKnownLinkObj( $rc->getTitle(), '' ); |
| 543 | + $clink = $this->skin->linkKnown( $rc->getTitle() ); |
542 | 544 | } |
543 | 545 | |
544 | 546 | # Don't show unusable diff links |
— | — | @@ -553,26 +555,28 @@ |
554 | 556 | |
555 | 557 | # Make "cur" and "diff" links |
556 | 558 | if( $rc->unpatrolled ) { |
557 | | - $rcIdQuery = "&rcid={$rc_id}"; |
| 559 | + $rcIdQuery = array( 'rcid' => $rc_id ); |
558 | 560 | } else { |
559 | | - $rcIdQuery = ''; |
| 561 | + $rcIdQuery = array(); |
560 | 562 | } |
561 | | - $querycur = $curIdEq."&diff=0&oldid=$rc_this_oldid"; |
562 | | - $querydiff = $curIdEq."&diff=$rc_this_oldid&oldid=$rc_last_oldid$rcIdQuery"; |
563 | | - $aprops = ' tabindex="'.$baseRC->counter.'"'; |
| 563 | + $querycur = $curIdEq + array( 'diff' => '0', 'oldid' => $rc_this_oldid ); |
| 564 | + $querydiff = $curIdEq + array( 'diff' => $rc_this_oldid, 'oldid' => |
| 565 | + $rc_last_oldid ) + $rcIdQuery; |
| 566 | + $attribs = array( 'tabindex' => $baseRC->counter ); |
564 | 567 | |
565 | | - # Make "diff" an "cur" links |
| 568 | + # Make "diff" and "cur" links |
566 | 569 | if( !$showdifflinks ) { |
567 | 570 | $curLink = $this->message['cur']; |
568 | 571 | $diffLink = $this->message['diff']; |
569 | 572 | } else if( in_array( $rc_type, array(RC_NEW,RC_LOG,RC_MOVE,RC_MOVE_OVER_REDIRECT) ) ) { |
570 | 573 | $curLink = ($rc_type != RC_NEW) ? $this->message['cur'] |
571 | | - : $this->skin->makeKnownLinkObj( $rc->getTitle(), |
572 | | - $this->message['cur'], $querycur, '' ,'', $aprops ); |
| 574 | + : $this->skin->linkKnown( $rc->getTitle(), $this->message['cur'], $attribs, $querycur ); |
573 | 575 | $diffLink = $this->message['diff']; |
574 | 576 | } else { |
575 | | - $diffLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['diff'], |
576 | | - $querydiff, '' ,'', $aprops ); |
| 577 | + $diffLink = $this->skin->linkKnown( $rc->getTitle(), $this->message['diff'], |
| 578 | + $attribs, $querydiff ); |
| 579 | + $curLink = $this->skin->linkKnown( $rc->getTitle(), $this->message['cur'], |
| 580 | + $attribs, $querycur ); |
577 | 581 | } |
578 | 582 | |
579 | 583 | # Make "last" link |
— | — | @@ -581,8 +585,8 @@ |
582 | 586 | } else if( $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) { |
583 | 587 | $lastLink = $this->message['last']; |
584 | 588 | } else { |
585 | | - $lastLink = $this->skin->makeKnownLinkObj( $rc->getTitle(), $this->message['last'], |
586 | | - $curIdEq.'&diff='.$rc_this_oldid.'&oldid='.$rc_last_oldid . $rcIdQuery ); |
| 589 | + $lastLink = $this->skin->linkKnown( $rc->getTitle(), $this->message['last'], |
| 590 | + array(), $curIdEq + array('diff' => $rc_this_oldid, 'oldid' => $rc_last_oldid) + $rcIdQuery ); |
587 | 591 | } |
588 | 592 | |
589 | 593 | # Make user links |