r41210 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41209‎ | r41210 | r41211 >
Date:00:07, 24 September 2008
Author:brion
Status:old
Tags:
Comment:
add a status-filtered revision list view
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.php (modified) (history)
  • /trunk/extensions/CodeReview/CodeRevisionListView.php (modified) (history)
  • /trunk/extensions/CodeReview/CodeRevisionStatusView.php (added) (history)
  • /trunk/extensions/CodeReview/SpecialCode.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReview.php
@@ -44,6 +44,7 @@
4545 $wgAutoloadClasses['CodeRevisionAuthorView'] = $dir . 'CodeRevisionAuthorView.php';
4646 $wgAutoloadClasses['CodeRevisionListView'] = $dir . 'CodeRevisionListView.php';
4747 $wgAutoloadClasses['CodeRevisionStatusSetter'] = $dir . 'CodeRevisionStatusSetter.php';
 48+$wgAutoloadClasses['CodeRevisionStatusView'] = $dir . 'CodeRevisionStatusView.php';
4849 $wgAutoloadClasses['CodeRevisionTagger'] = $dir . 'CodeRevisionTagger.php';
4950 $wgAutoloadClasses['CodeRevisionTagView'] = $dir . 'CodeRevisionTagView.php';
5051 $wgAutoloadClasses['CodeRevisionView'] = $dir . 'CodeRevisionView.php';
Index: trunk/extensions/CodeReview/SpecialCode.php
@@ -32,6 +32,9 @@
3333 } elseif( $params[1] == 'author' ) {
3434 $view = new CodeRevisionAuthorView( $params[0], $params[2] );
3535 break;
 36+ } elseif( $params[1] == 'status' ) {
 37+ $view = new CodeRevisionStatusView( $params[0], $params[2] );
 38+ break;
3639 } else {
3740 throw new MWException( "Unexpected number of parameters" );
3841 }
Index: trunk/extensions/CodeReview/CodeRevisionListView.php
@@ -61,12 +61,14 @@
6262 global $wgUser, $wgLang;
6363 switch( $name ){
6464 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 ) );
6968 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 ) ) );
7173 case 'cr_author':
7274 return $this->mView->authorLink( $value );
7375 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
132 + native

Status & tagging log