r40930 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40929‎ | r40930 | r40931 >
Date:19:47, 16 September 2008
Author:brion
Status:old
Tags:
Comment:
Add tag filter for revision list
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.php (modified) (history)
  • /trunk/extensions/CodeReview/CodeRevisionListView.php (modified) (history)
  • /trunk/extensions/CodeReview/CodeRevisionTagView.php (added) (history)
  • /trunk/extensions/CodeReview/SpecialCode.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReview.php
@@ -43,6 +43,7 @@
4444 $wgAutoloadClasses['CodeRevision'] = $dir . 'CodeRevision.php';
4545 $wgAutoloadClasses['CodeRevisionListView'] = $dir . 'CodeRevisionListView.php';
4646 $wgAutoloadClasses['CodeRevisionTagger'] = $dir . 'CodeRevisionTagger.php';
 47+$wgAutoloadClasses['CodeRevisionTagView'] = $dir . 'CodeRevisionTagView.php';
4748 $wgAutoloadClasses['CodeRevisionView'] = $dir . 'CodeRevisionView.php';
4849 $wgAutoloadClasses['CodeComment'] = $dir . 'CodeComment.php';
4950 $wgAutoloadClasses['SpecialCode'] = $dir . 'SpecialCode.php';
Index: trunk/extensions/CodeReview/SpecialCode.php
@@ -25,6 +25,13 @@
2626 case 2:
2727 $view = new CodeRevisionView( $params[0], $params[1] );
2828 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+ }
2936 case 4:
3037 if( $params[2] == 'reply' ) {
3138 $view = new CodeRevisionView( $params[0], $params[1], $params[3] );
Index: trunk/extensions/CodeReview/CodeRevisionListView.php
@@ -14,9 +14,13 @@
1515 $view->execute();
1616 return;
1717 }
18 - $pager = new SvnRevTablePager( $this );
 18+ $pager = $this->getPager();
1919 $wgOut->addHtml( $pager->getBody() . $pager->getNavigationBar() );
2020 }
 21+
 22+ function getPager() {
 23+ return new SvnRevTablePager( $this );
 24+ }
2125 }
2226
2327 // 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
130 + native

Status & tagging log