Index: trunk/extensions/CodeReview/ui/CodeView.php |
— | — | @@ -17,8 +17,13 @@ |
18 | 18 | /** |
19 | 19 | * @var CodeCommentLinkerHtml |
20 | 20 | */ |
21 | | - var $codeCommentLinker; |
| 21 | + var $codeCommentLinkerHtml; |
22 | 22 | |
| 23 | + /** |
| 24 | + * @var CodeCommentLinkerWiki |
| 25 | + */ |
| 26 | + var $codeCommentLinkerWiki; |
| 27 | + |
23 | 28 | function __construct( $repo ) { |
24 | 29 | $this->mRepo = ( $repo instanceof CodeRepository ) |
25 | 30 | ? $repo |
— | — | @@ -27,7 +32,8 @@ |
28 | 33 | global $wgUser; |
29 | 34 | $this->skin = $wgUser->getSkin(); |
30 | 35 | |
31 | | - $this->codeCommentLinker = new CodeCommentLinkerHtml( $repo ); |
| 36 | + $this->codeCommentLinkerHtml = new CodeCommentLinkerHtml( $this->mRepo ); |
| 37 | + $this->codeCommentLinkerWiki = new CodeCommentLinkerWiki( $this->mRepo ); |
32 | 38 | } |
33 | 39 | |
34 | 40 | function validPost( $permission ) { |
— | — | @@ -51,7 +57,7 @@ |
52 | 58 | |
53 | 59 | function formatMessage( $text ) { |
54 | 60 | $text = nl2br( htmlspecialchars( $text ) ); |
55 | | - return $this->codeCommentLinker->link( $text ); |
| 61 | + return $this->codeCommentLinkerHtml->link( $text ); |
56 | 62 | } |
57 | 63 | |
58 | 64 | function messageFragment( $value ) { |
Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php |
— | — | @@ -661,7 +661,6 @@ |
662 | 662 | */ |
663 | 663 | protected function formatComment( $comment, $replyForm = '' ) { |
664 | 664 | global $wgOut, $wgLang; |
665 | | - $linker = new CodeCommentLinkerWiki( $this->mRepo ); |
666 | 665 | |
667 | 666 | if ( $comment->id === 0 ) { |
668 | 667 | $linkId = 'cpreview'; |
— | — | @@ -687,7 +686,7 @@ |
688 | 687 | $this->commentReplyLink( $comment->id ) . |
689 | 688 | '</div>' . |
690 | 689 | '<div class="mw-codereview-comment-text">' . |
691 | | - $wgOut->parse( $linker->link( $comment->text ) ) . |
| 690 | + $wgOut->parse( $this->codeCommentLinkerWiki->link( $comment->text ) ) . |
692 | 691 | '</div>' . |
693 | 692 | $replyForm . |
694 | 693 | '</div>'; |
Index: trunk/extensions/CodeReview/ui/CodeReleaseNotes.php |
— | — | @@ -47,7 +47,6 @@ |
48 | 48 | |
49 | 49 | protected function showReleaseNotes() { |
50 | 50 | global $wgOut; |
51 | | - $linker = new CodeCommentLinkerHtml( $this->mRepo ); |
52 | 51 | $dbr = wfGetDB( DB_SLAVE ); |
53 | 52 | $where = array(); |
54 | 53 | if ( $this->mEndRev ) { |
— | — | @@ -85,8 +84,8 @@ |
86 | 85 | $summary = str_replace( "\n", "<br />", $summary ); // Newlines -> <br /> |
87 | 86 | $wgOut->addHTML( "<li>" ); |
88 | 87 | $wgOut->addHTML( |
89 | | - $linker->link( $summary ) . " <i>(" . htmlspecialchars( $row->cr_author ) . |
90 | | - ', ' . $linker->link( "r{$row->cr_id}" ) . ")</i>" |
| 88 | + $this->codeCommentLinkerHtml->link( $summary ) . " <i>(" . htmlspecialchars( $row->cr_author ) . |
| 89 | + ', ' . $this->codeCommentLinkerHtml->link( "r{$row->cr_id}" ) . ")</i>" |
91 | 90 | ); |
92 | 91 | $wgOut->addHTML( "</li>\n" ); |
93 | 92 | } |