Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -43,6 +43,7 @@ |
44 | 44 | $wgAutoloadClasses['CodeRevision'] = $dir . 'CodeRevision.php'; |
45 | 45 | $wgAutoloadClasses['CodeRevisionListView'] = $dir . 'CodeRevisionListView.php'; |
46 | 46 | $wgAutoloadClasses['CodeRevisionTagger'] = $dir . 'CodeRevisionTagger.php'; |
| 47 | +$wgAutoloadClasses['CodeRevisionTagView'] = $dir . 'CodeRevisionTagView.php'; |
47 | 48 | $wgAutoloadClasses['CodeRevisionView'] = $dir . 'CodeRevisionView.php'; |
48 | 49 | $wgAutoloadClasses['CodeComment'] = $dir . 'CodeComment.php'; |
49 | 50 | $wgAutoloadClasses['SpecialCode'] = $dir . 'SpecialCode.php'; |
Index: trunk/extensions/CodeReview/SpecialCode.php |
— | — | @@ -25,6 +25,13 @@ |
26 | 26 | case 2: |
27 | 27 | $view = new CodeRevisionView( $params[0], $params[1] ); |
28 | 28 | break; |
| 29 | + case 3: |
| 30 | + if( $params[1] == 'tag' ) { |
| 31 | + $view = new CodeRevisionTagView( $params[0], $params[2] ); |
| 32 | + break; |
| 33 | + } else { |
| 34 | + throw new MWException( "Unexpected number of parameters" ); |
| 35 | + } |
29 | 36 | case 4: |
30 | 37 | if( $params[2] == 'reply' ) { |
31 | 38 | $view = new CodeRevisionView( $params[0], $params[1], $params[3] ); |
Index: trunk/extensions/CodeReview/CodeRevisionListView.php |
— | — | @@ -14,9 +14,13 @@ |
15 | 15 | $view->execute(); |
16 | 16 | return; |
17 | 17 | } |
18 | | - $pager = new SvnRevTablePager( $this ); |
| 18 | + $pager = $this->getPager(); |
19 | 19 | $wgOut->addHtml( $pager->getBody() . $pager->getNavigationBar() ); |
20 | 20 | } |
| 21 | + |
| 22 | + function getPager() { |
| 23 | + return new SvnRevTablePager( $this ); |
| 24 | + } |
21 | 25 | } |
22 | 26 | |
23 | 27 | // Pager for CodeRevisionListView |
Index: trunk/extensions/CodeReview/CodeRevisionTagView.php |
— | — | @@ -0,0 +1,28 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +class CodeRevisionTagView extends CodeRevisionListView { |
| 5 | + function __construct( $repoName, $tag ) { |
| 6 | + parent::__construct( $repoName ); |
| 7 | + $this->mTag = $tag; |
| 8 | + } |
| 9 | + |
| 10 | + function getPager() { |
| 11 | + return new SvnRevTagTablePager( $this, $this->mTag ); |
| 12 | + } |
| 13 | +} |
| 14 | + |
| 15 | +class SvnRevTagTablePager extends SvnRevTablePager { |
| 16 | + function __construct( $view, $tag ) { |
| 17 | + parent::__construct( $view ); |
| 18 | + $this->mTag = $tag; |
| 19 | + } |
| 20 | + |
| 21 | + function getQueryInfo() { |
| 22 | + $info = parent::getQueryInfo(); |
| 23 | + $info['tables'][] = 'code_tags'; |
| 24 | + $info['conds'][] = 'cr_repo_id=ct_repo_id'; |
| 25 | + $info['conds'][] = 'cr_id=ct_rev_id'; |
| 26 | + $info['conds']['ct_tag'] = $this->mTag; // fixme: normalize input? |
| 27 | + return $info; |
| 28 | + } |
| 29 | +} |
Property changes on: trunk/extensions/CodeReview/CodeRevisionTagView.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 30 | + native |