Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -44,6 +44,7 @@ |
45 | 45 | $wgAutoloadClasses['CodeRevisionAuthorView'] = $dir . 'CodeRevisionAuthorView.php'; |
46 | 46 | $wgAutoloadClasses['CodeRevisionListView'] = $dir . 'CodeRevisionListView.php'; |
47 | 47 | $wgAutoloadClasses['CodeRevisionStatusSetter'] = $dir . 'CodeRevisionStatusSetter.php'; |
| 48 | +$wgAutoloadClasses['CodeRevisionStatusView'] = $dir . 'CodeRevisionStatusView.php'; |
48 | 49 | $wgAutoloadClasses['CodeRevisionTagger'] = $dir . 'CodeRevisionTagger.php'; |
49 | 50 | $wgAutoloadClasses['CodeRevisionTagView'] = $dir . 'CodeRevisionTagView.php'; |
50 | 51 | $wgAutoloadClasses['CodeRevisionView'] = $dir . 'CodeRevisionView.php'; |
Index: trunk/extensions/CodeReview/SpecialCode.php |
— | — | @@ -32,6 +32,9 @@ |
33 | 33 | } elseif( $params[1] == 'author' ) { |
34 | 34 | $view = new CodeRevisionAuthorView( $params[0], $params[2] ); |
35 | 35 | break; |
| 36 | + } elseif( $params[1] == 'status' ) { |
| 37 | + $view = new CodeRevisionStatusView( $params[0], $params[2] ); |
| 38 | + break; |
36 | 39 | } else { |
37 | 40 | throw new MWException( "Unexpected number of parameters" ); |
38 | 41 | } |
Index: trunk/extensions/CodeReview/CodeRevisionListView.php |
— | — | @@ -61,12 +61,14 @@ |
62 | 62 | global $wgUser, $wgLang; |
63 | 63 | switch( $name ){ |
64 | 64 | case 'cr_id': |
65 | | - global $wgUser; |
66 | | - return $wgUser->getSkin()->link( |
67 | | - SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $value ), htmlspecialchars( $value ) |
68 | | - ); |
| 65 | + return $this->mView->mSkin->link( |
| 66 | + SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $value ), |
| 67 | + htmlspecialchars( $value ) ); |
69 | 68 | case 'cr_status': |
70 | | - return htmlspecialchars( $this->mView->statusDesc( $value ) ); |
| 69 | + return $this->mView->mSkin->link( |
| 70 | + SpecialPage::getTitleFor( 'Code', |
| 71 | + $this->mRepo->getName() . '/status/' . $value ), |
| 72 | + htmlspecialchars( $this->mView->statusDesc( $value ) ) ); |
71 | 73 | case 'cr_author': |
72 | 74 | return $this->mView->authorLink( $value ); |
73 | 75 | case 'cr_message': |
Index: trunk/extensions/CodeReview/CodeRevisionStatusView.php |
— | — | @@ -0,0 +1,30 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +class CodeRevisionStatusView extends CodeRevisionListView { |
| 5 | + function __construct( $repoName, $status ) { |
| 6 | + parent::__construct( $repoName ); |
| 7 | + $this->mStatus = $status; |
| 8 | + } |
| 9 | + |
| 10 | + function getPager() { |
| 11 | + return new SvnRevStatusTablePager( $this, $this->mStatus ); |
| 12 | + } |
| 13 | +} |
| 14 | + |
| 15 | +class SvnRevStatusTablePager extends SvnRevTablePager { |
| 16 | + function __construct( $view, $status ) { |
| 17 | + parent::__construct( $view ); |
| 18 | + $this->mStatus = $status; |
| 19 | + } |
| 20 | + |
| 21 | + function getQueryInfo() { |
| 22 | + $info = parent::getQueryInfo(); |
| 23 | + $info['conds']['cr_status'] = $this->mStatus; // fixme: normalize input? |
| 24 | + return $info; |
| 25 | + } |
| 26 | + |
| 27 | + function getTitle(){ |
| 28 | + $repo = $this->mRepo->getName(); |
| 29 | + return SpecialPage::getTitleFor( 'Code', "$repo/status/$this->mStatus" ); |
| 30 | + } |
| 31 | +} |
Property changes on: trunk/extensions/CodeReview/CodeRevisionStatusView.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 32 | + native |