Index: trunk/phase3/includes/HistoryPage.php |
— | — | @@ -23,8 +23,6 @@ |
24 | 24 | private $article; |
25 | 25 | /** The $article title object. Found on construction. */ |
26 | 26 | private $title; |
27 | | - /** Shortcut to the user Skin object. */ |
28 | | - private $skin; |
29 | 27 | |
30 | 28 | /** |
31 | 29 | * Construct a new HistoryPage. |
— | — | @@ -32,10 +30,8 @@ |
33 | 31 | * @param $article Article |
34 | 32 | */ |
35 | 33 | function __construct( $article ) { |
36 | | - global $wgUser; |
37 | 34 | $this->article = $article; |
38 | 35 | $this->title = $article->getTitle(); |
39 | | - $this->skin = $wgUser->getSkin(); |
40 | 36 | $this->preCacheMessages(); |
41 | 37 | } |
42 | 38 | |
— | — | @@ -90,12 +86,11 @@ |
91 | 87 | |
92 | 88 | // Creation of a subtitle link pointing to [[Special:Log]] |
93 | 89 | $logPage = SpecialPage::getTitleFor( 'Log' ); |
94 | | - $logLink = $this->skin->link( |
| 90 | + $logLink = Linker::linkKnown( |
95 | 91 | $logPage, |
96 | 92 | wfMsgHtml( 'viewpagelogs' ), |
97 | 93 | array(), |
98 | | - array( 'page' => $this->title->getPrefixedText() ), |
99 | | - array( 'known', 'noclasses' ) |
| 94 | + array( 'page' => $this->title->getPrefixedText() ) |
100 | 95 | ); |
101 | 96 | $wgOut->setSubtitle( $logLink ); |
102 | 97 | |
— | — | @@ -522,12 +517,12 @@ |
523 | 518 | } elseif ( $rev->getVisibility() && $wgUser->isAllowed( 'deletedhistory' ) ) { |
524 | 519 | // If revision was hidden from sysops, disable the link |
525 | 520 | if ( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) { |
526 | | - $cdel = $this->getSkin()->revDeleteLinkDisabled( false ); |
| 521 | + $cdel = Linker::revDeleteLinkDisabled( false ); |
527 | 522 | // Otherwise, show the link... |
528 | 523 | } else { |
529 | 524 | $query = array( 'type' => 'revision', |
530 | 525 | 'target' => $this->title->getPrefixedDbkey(), 'ids' => $rev->getId() ); |
531 | | - $del .= $this->getSkin()->revDeleteLink( $query, |
| 526 | + $del .= Linker::revDeleteLink( $query, |
532 | 527 | $rev->isDeleted( Revision::DELETED_RESTRICTED ), false ); |
533 | 528 | } |
534 | 529 | } |
— | — | @@ -540,7 +535,7 @@ |
541 | 536 | $s .= " $link"; |
542 | 537 | $s .= $dirmark; |
543 | 538 | $s .= " <span class='history-user'>" . |
544 | | - $this->getSkin()->revUserTools( $rev, true ) . "</span>"; |
| 539 | + Linker::revUserTools( $rev, true ) . "</span>"; |
545 | 540 | $s .= $dirmark; |
546 | 541 | |
547 | 542 | if ( $rev->isMinor() ) { |
— | — | @@ -548,10 +543,10 @@ |
549 | 544 | } |
550 | 545 | |
551 | 546 | if ( !is_null( $size = $rev->getSize() ) && !$rev->isDeleted( Revision::DELETED_TEXT ) ) { |
552 | | - $s .= ' ' . $this->getSkin()->formatRevisionSize( $size ); |
| 547 | + $s .= ' ' . Linker::formatRevisionSize( $size ); |
553 | 548 | } |
554 | 549 | |
555 | | - $s .= $this->getSkin()->revComment( $rev, false, true ); |
| 550 | + $s .= Linker::revComment( $rev, false, true ); |
556 | 551 | |
557 | 552 | if ( $notificationtimestamp && ( $row->rev_timestamp >= $notificationtimestamp ) ) { |
558 | 553 | $s .= ' <span class="updatedmarker">' . wfMsgHtml( 'updatedmarker' ) . '</span>'; |
— | — | @@ -564,7 +559,7 @@ |
565 | 560 | if ( $latest && $this->title->userCan( 'rollback' ) && $this->title->userCan( 'edit' ) ) { |
566 | 561 | $this->preventClickjacking(); |
567 | 562 | $tools[] = '<span class="mw-rollback-link">' . |
568 | | - $this->getSkin()->buildRollbackLink( $rev ) . '</span>'; |
| 563 | + Linker::buildRollbackLink( $rev ) . '</span>'; |
569 | 564 | } |
570 | 565 | |
571 | 566 | if ( $this->title->quickUserCan( 'edit' ) |
— | — | @@ -575,7 +570,7 @@ |
576 | 571 | $undoTooltip = $latest |
577 | 572 | ? array( 'title' => wfMsg( 'tooltip-undo' ) ) |
578 | 573 | : array(); |
579 | | - $undolink = $this->getSkin()->link( |
| 574 | + $undolink = Linker::linkKnown( |
580 | 575 | $this->title, |
581 | 576 | wfMsgHtml( 'editundo' ), |
582 | 577 | $undoTooltip, |
— | — | @@ -583,8 +578,7 @@ |
584 | 579 | 'action' => 'edit', |
585 | 580 | 'undoafter' => $next->rev_id, |
586 | 581 | 'undo' => $rev->getId() |
587 | | - ), |
588 | | - array( 'known', 'noclasses' ) |
| 582 | + ) |
589 | 583 | ); |
590 | 584 | $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>"; |
591 | 585 | } |
— | — | @@ -620,12 +614,11 @@ |
621 | 615 | $date = $wgLang->timeanddate( wfTimestamp( TS_MW, $rev->getTimestamp() ), true ); |
622 | 616 | $date = htmlspecialchars( $date ); |
623 | 617 | if ( $rev->userCan( Revision::DELETED_TEXT ) ) { |
624 | | - $link = $this->getSkin()->link( |
| 618 | + $link = Linker::linkKnown( |
625 | 619 | $this->title, |
626 | 620 | $date, |
627 | 621 | array(), |
628 | | - array( 'oldid' => $rev->getId() ), |
629 | | - array( 'known', 'noclasses' ) |
| 622 | + array( 'oldid' => $rev->getId() ) |
630 | 623 | ); |
631 | 624 | } else { |
632 | 625 | $link = $date; |
— | — | @@ -648,15 +641,14 @@ |
649 | 642 | if ( $latest || !$rev->userCan( Revision::DELETED_TEXT ) ) { |
650 | 643 | return $cur; |
651 | 644 | } else { |
652 | | - return $this->getSkin()->link( |
| 645 | + return Linker::linkKnown( |
653 | 646 | $this->title, |
654 | 647 | $cur, |
655 | 648 | array(), |
656 | 649 | array( |
657 | 650 | 'diff' => $this->title->getLatestRevID(), |
658 | 651 | 'oldid' => $rev->getId() |
659 | | - ), |
660 | | - array( 'known', 'noclasses' ) |
| 652 | + ) |
661 | 653 | ); |
662 | 654 | } |
663 | 655 | } |
— | — | @@ -677,30 +669,28 @@ |
678 | 670 | return $last; |
679 | 671 | } elseif ( $next === 'unknown' ) { |
680 | 672 | # Next row probably exists but is unknown, use an oldid=prev link |
681 | | - return $this->getSkin()->link( |
| 673 | + return Linker::linkKnown( |
682 | 674 | $this->title, |
683 | 675 | $last, |
684 | 676 | array(), |
685 | 677 | array( |
686 | 678 | 'diff' => $prevRev->getId(), |
687 | 679 | 'oldid' => 'prev' |
688 | | - ), |
689 | | - array( 'known', 'noclasses' ) |
| 680 | + ) |
690 | 681 | ); |
691 | 682 | } elseif ( !$prevRev->userCan( Revision::DELETED_TEXT ) |
692 | 683 | || !$nextRev->userCan( Revision::DELETED_TEXT ) ) |
693 | 684 | { |
694 | 685 | return $last; |
695 | 686 | } else { |
696 | | - return $this->getSkin()->link( |
| 687 | + return Linker::linkKnown( |
697 | 688 | $this->title, |
698 | 689 | $last, |
699 | 690 | array(), |
700 | 691 | array( |
701 | 692 | 'diff' => $prevRev->getId(), |
702 | 693 | 'oldid' => $next->rev_id |
703 | | - ), |
704 | | - array( 'known', 'noclasses' ) |
| 694 | + ) |
705 | 695 | ); |
706 | 696 | } |
707 | 697 | } |