Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -41,6 +41,7 @@ |
42 | 42 | $wgAutoloadClasses['CodeRepository'] = $dir . 'CodeRepository.php'; |
43 | 43 | $wgAutoloadClasses['CodeRepoListView'] = $dir . 'CodeRepoListView.php'; |
44 | 44 | $wgAutoloadClasses['CodeRevision'] = $dir . 'CodeRevision.php'; |
| 45 | +$wgAutoloadClasses['CodeRevisionAuthorView'] = $dir . 'CodeRevisionAuthorView.php'; |
45 | 46 | $wgAutoloadClasses['CodeRevisionListView'] = $dir . 'CodeRevisionListView.php'; |
46 | 47 | $wgAutoloadClasses['CodeRevisionTagger'] = $dir . 'CodeRevisionTagger.php'; |
47 | 48 | $wgAutoloadClasses['CodeRevisionTagView'] = $dir . 'CodeRevisionTagView.php'; |
Index: trunk/extensions/CodeReview/CodeRevisionAuthorView.php |
— | — | @@ -0,0 +1,30 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +class CodeRevisionAuthorView extends CodeRevisionListView { |
| 5 | + function __construct( $repoName, $author ) { |
| 6 | + parent::__construct( $repoName ); |
| 7 | + $this->mAuthor = $author; |
| 8 | + } |
| 9 | + |
| 10 | + function getPager() { |
| 11 | + return new SvnRevAuthorTablePager( $this, $this->mAuthor ); |
| 12 | + } |
| 13 | +} |
| 14 | + |
| 15 | +class SvnRevAuthorTablePager extends SvnRevTablePager { |
| 16 | + function __construct( $view, $author ) { |
| 17 | + parent::__construct( $view ); |
| 18 | + $this->mAuthor = $author; |
| 19 | + } |
| 20 | + |
| 21 | + function getQueryInfo() { |
| 22 | + $info = parent::getQueryInfo(); |
| 23 | + $info['conds']['cr_author'] = $this->mAuthor; // fixme: normalize input? |
| 24 | + return $info; |
| 25 | + } |
| 26 | + |
| 27 | + function getTitle(){ |
| 28 | + $repo = $this->mRepo->getName(); |
| 29 | + return SpecialPage::getTitleFor( 'Code', "$repo/author/$this->mAuthor" ); |
| 30 | + } |
| 31 | +} |
Property changes on: trunk/extensions/CodeReview/CodeRevisionAuthorView.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 32 | + native |
Index: trunk/extensions/CodeReview/SpecialCode.php |
— | — | @@ -29,6 +29,9 @@ |
30 | 30 | if( $params[1] == 'tag' ) { |
31 | 31 | $view = new CodeRevisionTagView( $params[0], $params[2] ); |
32 | 32 | break; |
| 33 | + } elseif( $params[1] == 'author' ) { |
| 34 | + $view = new CodeRevisionAuthorView( $params[0], $params[2] ); |
| 35 | + break; |
33 | 36 | } else { |
34 | 37 | throw new MWException( "Unexpected number of parameters" ); |
35 | 38 | } |
— | — | @@ -69,6 +72,8 @@ |
70 | 73 | abstract function execute(); |
71 | 74 | |
72 | 75 | function authorLink( $author ) { |
| 76 | + /* |
| 77 | + // Leave this for later for now... |
73 | 78 | static $userLinks = array(); |
74 | 79 | if( isset( $userLinks[$author] ) ) |
75 | 80 | return $userLinks[$author]; |
— | — | @@ -91,6 +96,11 @@ |
92 | 97 | else |
93 | 98 | $link = htmlspecialchars( $author ); |
94 | 99 | return $userLinks[$author] = $link; |
| 100 | + */ |
| 101 | + |
| 102 | + $repo = $this->mRepo->getName(); |
| 103 | + $special = SpecialPage::getTitleFor( 'Code', "$repo/author/$author" ); |
| 104 | + return $this->mSkin->link( $special, htmlspecialchars( $author ) ); |
95 | 105 | } |
96 | 106 | |
97 | 107 | function formatMessage( $text ){ |
Index: trunk/extensions/CodeReview/CodeRevisionTagView.php |
— | — | @@ -25,4 +25,9 @@ |
26 | 26 | $info['conds']['ct_tag'] = $this->mTag; // fixme: normalize input? |
27 | 27 | return $info; |
28 | 28 | } |
| 29 | + |
| 30 | + function getTitle(){ |
| 31 | + $repo = $this->mRepo->getName(); |
| 32 | + return SpecialPage::getTitleFor( 'Code', "$repo/tag/$this->mTag" ); |
| 33 | + } |
29 | 34 | } |