Index: trunk/extensions/CodeReview/CodePathRevListView.php |
— | — | @@ -3,16 +3,7 @@ |
4 | 4 | // Special:Code/MediaWiki |
5 | 5 | class CodePathRevListView extends CodeRevisionListView { |
6 | 6 | function __construct( $repoName ) { |
7 | | - global $wgRequest; |
8 | 7 | parent::__construct( $repoName ); |
9 | | - $this->mRepo = CodeRepository::newFromName( $repoName ); |
10 | | - $this->mPath = htmlspecialchars( trim( $wgRequest->getVal( 'path' ) ) ); |
11 | | - if( strlen($this->mPath) && $this->mPath[strlen($this->mPath)-1] !== '/' ) { |
12 | | - $this->mPath .= '/'; // make sure this is a dir |
13 | | - } |
14 | | - if( strlen($this->mPath) && $this->mPath[0] !== '/' ) { |
15 | | - $this->mPath = "/{$this->mPath}"; // make sure this is a dir |
16 | | - } |
17 | 8 | } |
18 | 9 | |
19 | 10 | function execute() { |
— | — | @@ -48,10 +39,6 @@ |
49 | 40 | |
50 | 41 | // Pager for CodeRevisionListView |
51 | 42 | class SvnPathRevTablePager extends SvnRevTablePager { |
52 | | - function getSVNPath() { |
53 | | - return $this->mView->mPath; |
54 | | - } |
55 | | - |
56 | 43 | function getTitle() { |
57 | 44 | return SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/path' ); |
58 | 45 | } |
Index: trunk/extensions/CodeReview/CodeRevisionListView.php |
— | — | @@ -4,9 +4,17 @@ |
5 | 5 | class CodeRevisionListView extends CodeView { |
6 | 6 | public $mRepo, $mPath; |
7 | 7 | function __construct( $repoName ) { |
| 8 | + global $wgRequest; |
8 | 9 | parent::__construct(); |
9 | 10 | $this->mRepo = CodeRepository::newFromName( $repoName ); |
10 | | - $this->mPath = ''; |
| 11 | + $this->mPath = htmlspecialchars( trim( $wgRequest->getVal( 'path' ) ) ); |
| 12 | + if( strlen($this->mPath) && $this->mPath[strlen($this->mPath)-1] !== '/' ) { |
| 13 | + $this->mPath .= '/'; // make sure this is a dir |
| 14 | + } |
| 15 | + if( strlen($this->mPath) && $this->mPath[0] !== '/' ) { |
| 16 | + $this->mPath = "/{$this->mPath}"; // make sure this is a dir |
| 17 | + } |
| 18 | + $this->mAuthor = null; |
11 | 19 | } |
12 | 20 | |
13 | 21 | function execute() { |
— | — | @@ -28,7 +36,11 @@ |
29 | 37 | |
30 | 38 | function showForm( $path = '' ) { |
31 | 39 | global $wgOut, $wgScript; |
32 | | - $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName().'/path' ); |
| 40 | + if( $this->mAuthor ) { |
| 41 | + $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName().'/author/'.$this->mAuthor ); |
| 42 | + } else { |
| 43 | + $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName().'/path' ); |
| 44 | + } |
33 | 45 | $wgOut->addHTML( |
34 | 46 | Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get' ) ) . |
35 | 47 | "<fieldset><legend>".wfMsgHtml('code-pathsearch-legend')."</legend>" . |
— | — | @@ -57,7 +69,7 @@ |
58 | 70 | } |
59 | 71 | |
60 | 72 | function getSVNPath() { |
61 | | - return false; |
| 73 | + return $this->mView->mPath; |
62 | 74 | } |
63 | 75 | |
64 | 76 | function isFieldSortable( $field ) { |